Lines Matching refs:buf

99     char *buf;  member
148 static rk_s32 get_full_name(MppCfgIoImpl *obj, char *buf, rk_s32 buf_size) in get_full_name() argument
177 buf[0] = '\0'; in get_full_name()
183 len += snprintf(buf + len, buf_size - len, "%s", name[i]); in get_full_name()
191 cfg_io_dbg_name("depth %d obj %-16s -> %s\n", obj->depth, obj->name, buf); in get_full_name()
596 char *buf; member
606 get_full_name(impl, ctx->buf, ctx->buf_size); in add_obj_info()
607 mpp_trie_add_info(ctx->trie, ctx->buf, &impl->info, sizeof(impl->info)); in add_obj_info()
643 ctx.buf = name; in mpp_cfg_to_trie()
664 #define write_byte_f(str, buf, size) write_byte(str, (void *)buf, size, __FUNCTION__) argument
675 str, str->buf, str->buf_size, str->offset, len, caller); in test_byte()
679 ret = str->buf + str->offset; in test_byte()
682 str, str->buf, str->buf_size, str->offset, len, ret, caller); in test_byte()
693 str, str->buf, str->buf_size, str->offset, pos, caller); in show_byte()
697 ret = str->buf + str->offset + pos; in show_byte()
700 str, str->buf, str->buf_size, str->offset, pos, ret, caller); in show_byte()
711 str, str->buf, str->buf_size, str->offset, len, caller); in skip_byte()
715 ret = str->buf + str->offset + len; in skip_byte()
718 str, str->buf, str->buf_size, str->offset, len, ret, caller); in skip_byte()
730 str, str->buf, str->buf_size, old, caller); in skip_ws()
737 str, str->buf, str->buf_size, str->offset, caller); in skip_ws()
743 str, str->buf, str->buf_size, old, str->offset, caller); in skip_ws()
745 return str->buf + str->offset; in skip_ws()
748 static rk_s32 write_byte(MppCfgStrBuf *str, void *buf, rk_s32 *size, const char *caller) in write_byte() argument
756 void *ptr = mpp_realloc_size(str->buf, void, str->buf_size * 2); in write_byte()
765 str, str->buf, str->buf_size, ptr, str->buf_size * 2, caller); in write_byte()
767 str->buf = ptr; in write_byte()
772 str, str->buf, str->buf_size, str->offset, buf, len, caller); in write_byte()
774 memcpy(str->buf + str->offset, buf, len); in write_byte()
776 str->buf[str->offset] = '\0'; in write_byte()
787 str, str->buf, str->buf_size, str->depth, caller); in write_indent()
813 str, str->buf, str->buf_size, str->depth, caller); in revert_comma()
821 if (str->buf[str->offset - 2] == ',') { in revert_comma()
822 str->buf[str->offset - 2] = str->buf[str->offset - 1]; in revert_comma()
823 str->buf[str->offset - 1] = str->buf[str->offset]; in revert_comma()
833 char buf[256]; in mpp_cfg_to_log() local
835 rk_s32 total = sizeof(buf) - 1; in mpp_cfg_to_log()
845 len += snprintf(buf + len, total - len, "%s : ", impl->name); in mpp_cfg_to_log()
849 len += snprintf(buf + len, total - len, "null\n"); in mpp_cfg_to_log()
852 len += snprintf(buf + len, total - len, "%s\n", impl->val.b1 ? "true" : "false"); in mpp_cfg_to_log()
855 len += snprintf(buf + len, total - len, "%d\n", impl->val.s32); in mpp_cfg_to_log()
858 len += snprintf(buf + len, total - len, "%u\n", impl->val.u32); in mpp_cfg_to_log()
861 len += snprintf(buf + len, total - len, "%lld\n", impl->val.s64); in mpp_cfg_to_log()
864 len += snprintf(buf + len, total - len, "%llu\n", impl->val.u64); in mpp_cfg_to_log()
867 len += snprintf(buf + len, total - len, "%f\n", impl->val.f32); in mpp_cfg_to_log()
870 len += snprintf(buf + len, total - len, "%lf\n", impl->val.f64); in mpp_cfg_to_log()
874 len += snprintf(buf + len, total - len, "\"%s\"\n", (char *)impl->val.str); in mpp_cfg_to_log()
881 return write_byte_f(str, buf, &len); in mpp_cfg_to_log()
887 len += snprintf(buf + len, total - len, "%s : ", impl->name); in mpp_cfg_to_log()
890 len += snprintf(buf + len, total - len, "%s\n", in mpp_cfg_to_log()
892 return write_byte_f(str, buf, &len); in mpp_cfg_to_log()
895 len += snprintf(buf + len, total - len, "%c\n", in mpp_cfg_to_log()
898 ret = write_byte_f(str, buf, &len); in mpp_cfg_to_log()
915 len += snprintf(buf + len, total - len, "%c\n", in mpp_cfg_to_log()
918 return write_byte_f(str, buf, &len); in mpp_cfg_to_log()
924 char buf[256]; in mpp_cfg_to_json() local
926 rk_s32 total = sizeof(buf) - 1; in mpp_cfg_to_json()
936 len += snprintf(buf + len, total - len, "\"%s\" : ", impl->name); in mpp_cfg_to_json()
940 len += snprintf(buf + len, total - len, "null,\n"); in mpp_cfg_to_json()
943 len += snprintf(buf + len, total - len, "%s,\n", impl->val.b1 ? "true" : "false"); in mpp_cfg_to_json()
946 len += snprintf(buf + len, total - len, "%d,\n", impl->val.s32); in mpp_cfg_to_json()
949 len += snprintf(buf + len, total - len, "%u,\n", impl->val.u32); in mpp_cfg_to_json()
952 len += snprintf(buf + len, total - len, "%lld,\n", impl->val.s64); in mpp_cfg_to_json()
955 len += snprintf(buf + len, total - len, "%llu,\n", impl->val.u64); in mpp_cfg_to_json()
958 len += snprintf(buf + len, total - len, "%f,\n", impl->val.f32); in mpp_cfg_to_json()
961 len += snprintf(buf + len, total - len, "%lf,\n", impl->val.f64); in mpp_cfg_to_json()
965 len += snprintf(buf + len, total - len, "\"%s\",\n", (char *)impl->val.str); in mpp_cfg_to_json()
972 return write_byte_f(str, buf, &len); in mpp_cfg_to_json()
978 len += snprintf(buf + len, total - len, "\"%s\" : ", impl->name); in mpp_cfg_to_json()
981 len += snprintf(buf + len, total - len, "%s,\n", in mpp_cfg_to_json()
983 return write_byte_f(str, buf, &len); in mpp_cfg_to_json()
986 len += snprintf(buf + len, total - len, "%c\n", in mpp_cfg_to_json()
989 ret = write_byte_f(str, buf, &len); in mpp_cfg_to_json()
1009 len += snprintf(buf + len, total - len, "%c,\n", in mpp_cfg_to_json()
1012 len += snprintf(buf + len, total - len, "%c\n", in mpp_cfg_to_json()
1015 return write_byte_f(str, buf, &len); in mpp_cfg_to_json()
1026 char buf[256]; in mpp_toml_top() local
1028 rk_s32 total = sizeof(buf) - 1; in mpp_toml_top()
1031 len += snprintf(buf + len, total - len, "\n[%s]\n", impl->name); in mpp_toml_top()
1033 return write_byte_f(str, buf, &len); in mpp_toml_top()
1038 char buf[256]; in mpp_toml_non_top() local
1040 rk_s32 total = sizeof(buf) - 1; in mpp_toml_non_top()
1043 len += snprintf(buf + len, total - len, "%s = ", impl->name); in mpp_toml_non_top()
1046 len += snprintf(buf + len, total - len, "%s\n", in mpp_toml_non_top()
1048 return write_byte_f(str, buf, &len); in mpp_toml_non_top()
1052 len += snprintf(buf + len, total - len, "\n[[%s]]\n", impl->parent->name); in mpp_toml_non_top()
1054 len += snprintf(buf + len, total - len, "%c\n", in mpp_toml_non_top()
1057 return write_byte_f(str, buf, &len); in mpp_toml_non_top()
1063 char buf[256]; in mpp_cfg_to_toml() local
1065 rk_s32 total = sizeof(buf) - 1; in mpp_cfg_to_toml()
1075 len += snprintf(buf + len, total - len, "%s = ", impl->name); in mpp_cfg_to_toml()
1079 len += snprintf(buf + len, total - len, "null"); in mpp_cfg_to_toml()
1082 len += snprintf(buf + len, total - len, "%s", impl->val.b1 ? "true" : "false"); in mpp_cfg_to_toml()
1085 len += snprintf(buf + len, total - len, "%d", impl->val.s32); in mpp_cfg_to_toml()
1088 len += snprintf(buf + len, total - len, "%u", impl->val.u32); in mpp_cfg_to_toml()
1091 len += snprintf(buf + len, total - len, "%lld", impl->val.s64); in mpp_cfg_to_toml()
1094 len += snprintf(buf + len, total - len, "%llu", impl->val.u64); in mpp_cfg_to_toml()
1097 len += snprintf(buf + len, total - len, "%f", impl->val.f32); in mpp_cfg_to_toml()
1100 len += snprintf(buf + len, total - len, "%lf", impl->val.f64); in mpp_cfg_to_toml()
1104 len += snprintf(buf + len, total - len, "\"%s\"", (char *)impl->val.str); in mpp_cfg_to_toml()
1112 len += snprintf(buf + len, total - len, ",\n"); in mpp_cfg_to_toml()
1114 len += snprintf(buf + len, total - len, "\n"); in mpp_cfg_to_toml()
1116 return write_byte_f(str, buf, &len); in mpp_cfg_to_toml()
1152 len += snprintf(buf + len, total - len, "%c\n", in mpp_cfg_to_toml()
1155 len += snprintf(buf + len, total - len, "%c,\n", in mpp_cfg_to_toml()
1159 return write_byte_f(str, buf, &len); in mpp_cfg_to_toml()
1164 char *buf = NULL; in parse_number() local
1170 buf = show_byte_f(str, 0); in parse_number()
1171 if (!buf) in parse_number()
1174 switch (buf[0]) { in parse_number()
1181 tmp[i] = buf[0]; in parse_number()
1234 char *buf = NULL; in parse_log_string() local
1243 buf = skip_ws_f(str); in parse_log_string()
1244 if (!buf) in parse_log_string()
1248 if (buf[0] != '\"') in parse_log_string()
1251 buf = skip_byte_f(str, 1); in parse_log_string()
1252 if (!buf) in parse_log_string()
1256 start = buf; in parse_log_string()
1259 while ((buf = show_byte_f(str, name_len)) && buf[0] != terminator) { in parse_log_string()
1263 if (!buf || buf[0] != terminator) in parse_log_string()
1267 buf = skip_byte_f(str, name_len + 1); in parse_log_string()
1268 if (!buf) in parse_log_string()
1282 char *buf = NULL; in parse_log_array() local
1295 buf = test_byte_f(str, 0); in parse_log_array()
1296 if (!buf || buf[0] != '[') { in parse_log_array()
1301 buf = skip_byte_f(str, 1); in parse_log_array()
1302 if (!buf) { in parse_log_array()
1308 buf = skip_ws_f(str); in parse_log_array()
1309 if (!buf) { in parse_log_array()
1315 if (buf[0] == ']') { in parse_log_array()
1324 buf = skip_ws_f(str); in parse_log_array()
1325 if (!buf) { in parse_log_array()
1337 buf = skip_ws_f(str); in parse_log_array()
1338 if (!buf) { in parse_log_array()
1343 if (buf[0] == ']') in parse_log_array()
1347 if (!buf || buf[0] != ']') { in parse_log_array()
1373 char *buf = NULL; in parse_log_value() local
1377 buf = test_byte_f(str, 4); in parse_log_value()
1378 if (buf && !strncmp(buf, "null", 4)) { in parse_log_value()
1387 if (buf && !strncmp(buf, "true", 4)) { in parse_log_value()
1399 buf = test_byte_f(str, 5); in parse_log_value()
1400 if (buf && !strncmp(buf, "false", 5)) { in parse_log_value()
1412 buf = test_byte_f(str, 0); in parse_log_value()
1413 if (buf && buf[0] == '\"') { in parse_log_value()
1433 if (buf && (buf[0] == '-' || (buf[0] >= '0' && buf[0] <= '9'))) { in parse_log_value()
1453 if (buf && buf[0] == '{') { in parse_log_value()
1469 if (buf && buf[0] == '[') { in parse_log_value()
1491 char *buf = NULL; in parse_log_object() local
1504 buf = test_byte_f(str, 0); in parse_log_object()
1505 if (!buf || buf[0] != '{') { in parse_log_object()
1510 buf = skip_byte_f(str, 1); in parse_log_object()
1511 if (!buf) { in parse_log_object()
1517 buf = skip_ws_f(str); in parse_log_object()
1518 if (!buf) { in parse_log_object()
1524 if (buf[0] == '}') { in parse_log_object()
1537 if (buf[0] == '[') { in parse_log_object()
1570 buf = skip_ws_f(str); in parse_log_object()
1571 if (!buf || buf[0] != ':') { in parse_log_object()
1577 buf = skip_byte_f(str, 1); in parse_log_object()
1578 if (!buf) { in parse_log_object()
1583 buf = skip_ws_f(str); in parse_log_object()
1584 if (!buf) { in parse_log_object()
1604 buf = skip_ws_f(str); in parse_log_object()
1605 if (!buf) { in parse_log_object()
1610 if (buf[0] == '}') in parse_log_object()
1635 char *buf = NULL; in mpp_cfg_from_log() local
1639 buf = skip_ws_f(str); in mpp_cfg_from_log()
1640 if (!buf) in mpp_cfg_from_log()
1643 if (buf[0] == '{') { in mpp_cfg_from_log()
1651 } else if (buf[0] == '[') { in mpp_cfg_from_log()
1660 mpp_loge_f("invalid top element '%c' on offset %d\n", buf[0], str->offset); in mpp_cfg_from_log()
1670 char *buf = NULL; in parse_json_string() local
1678 buf = skip_ws_f(str); in parse_json_string()
1679 if (!buf || buf[0] != '\"') in parse_json_string()
1682 buf = skip_byte_f(str, 1); in parse_json_string()
1683 if (!buf) in parse_json_string()
1686 start = buf; in parse_json_string()
1689 while ((buf = show_byte_f(str, name_len)) && buf[0] != '\"') { in parse_json_string()
1693 if (!buf || buf[0] != '\"') in parse_json_string()
1697 buf = skip_byte_f(str, name_len + 1); in parse_json_string()
1698 if (!buf) in parse_json_string()
1713 char *buf = NULL; in parse_json_object() local
1726 buf = test_byte_f(str, 0); in parse_json_object()
1727 if (!buf || buf[0] != '{') { in parse_json_object()
1732 buf = skip_byte_f(str, 1); in parse_json_object()
1733 if (!buf) { in parse_json_object()
1739 buf = skip_ws_f(str); in parse_json_object()
1740 if (!buf) { in parse_json_object()
1746 if (buf[0] == '}') { in parse_json_object()
1758 if (buf[0] == '[') { in parse_json_object()
1786 buf = skip_ws_f(str); in parse_json_object()
1787 if (!buf || buf[0] != ':') { in parse_json_object()
1793 buf = skip_byte_f(str, 1); in parse_json_object()
1794 if (!buf) { in parse_json_object()
1799 buf = skip_ws_f(str); in parse_json_object()
1800 if (!buf) { in parse_json_object()
1820 buf = skip_ws_f(str); in parse_json_object()
1821 if (!buf) { in parse_json_object()
1826 if (buf[0] == ',') { in parse_json_object()
1827 buf = skip_byte_f(str, 1); in parse_json_object()
1828 if (!buf) { in parse_json_object()
1833 buf = skip_ws_f(str); in parse_json_object()
1834 if (buf[0] == '}') in parse_json_object()
1844 buf = skip_ws_f(str); in parse_json_object()
1845 if (!buf || buf[0] != '}') { in parse_json_object()
1869 char *buf = NULL; in parse_json_array() local
1882 buf = test_byte_f(str, 0); in parse_json_array()
1883 if (!buf || buf[0] != '[') { in parse_json_array()
1888 buf = skip_byte_f(str, 1); in parse_json_array()
1889 if (!buf) { in parse_json_array()
1895 buf = skip_ws_f(str); in parse_json_array()
1896 if (!buf) { in parse_json_array()
1902 if (buf[0] == ']') { in parse_json_array()
1911 buf = skip_ws_f(str); in parse_json_array()
1912 if (!buf) { in parse_json_array()
1924 buf = skip_ws_f(str); in parse_json_array()
1925 if (!buf) { in parse_json_array()
1930 if (buf[0] == ',') { in parse_json_array()
1931 buf = skip_byte_f(str, 1); in parse_json_array()
1932 if (!buf) { in parse_json_array()
1937 buf = skip_ws_f(str); in parse_json_array()
1938 if (buf[0] == '}') in parse_json_array()
1947 buf = skip_ws_f(str); in parse_json_array()
1948 if (!buf || buf[0] != ']') { in parse_json_array()
1972 char *buf = NULL; in parse_json_value() local
1976 buf = test_byte_f(str, 4); in parse_json_value()
1977 if (buf && !strncmp(buf, "null", 4)) { in parse_json_value()
1986 if (buf && !strncmp(buf, "true", 4)) { in parse_json_value()
1998 buf = test_byte_f(str, 5); in parse_json_value()
1999 if (buf && !strncmp(buf, "false", 5)) { in parse_json_value()
2011 buf = test_byte_f(str, 0); in parse_json_value()
2012 if (buf && buf[0] == '\"') { in parse_json_value()
2032 if (buf && (buf[0] == '-' || (buf[0] >= '0' && buf[0] <= '9'))) { in parse_json_value()
2052 if (buf && buf[0] == '{') { in parse_json_value()
2068 if (buf && buf[0] == '[') { in parse_json_value()
2090 char *buf = NULL; in mpp_cfg_from_json() local
2094 buf = test_byte_f(str, 4); in mpp_cfg_from_json()
2095 if (buf && !strncmp(buf, "\xEF\xBB\xBF", 3)) in mpp_cfg_from_json()
2099 buf = skip_ws_f(str); in mpp_cfg_from_json()
2100 if (!buf) in mpp_cfg_from_json()
2103 if (buf[0] == '{') { in mpp_cfg_from_json()
2111 } else if (buf[0] == '[') { in mpp_cfg_from_json()
2120 mpp_loge_f("invalid top element '%c' on offset %d\n", buf[0], str->offset); in mpp_cfg_from_json()
2237 char *buf = NULL; in parse_toml_string() local
2246 buf = skip_ws_f(str); in parse_toml_string()
2247 if (!buf) in parse_toml_string()
2252 if (buf[0] != '\"') in parse_toml_string()
2255 buf = skip_byte_f(str, 1); in parse_toml_string()
2256 if (!buf) in parse_toml_string()
2266 start = buf; in parse_toml_string()
2269 while ((buf = show_byte_f(str, name_len)) && buf[0] != terminator) { in parse_toml_string()
2273 if (!buf || buf[0] != terminator) in parse_toml_string()
2278 buf = skip_byte_f(str, name_len + 1); in parse_toml_string()
2280 buf = skip_byte_f(str, name_len); in parse_toml_string()
2281 if (!buf) in parse_toml_string()
2296 char *buf = NULL; in parse_toml_array() local
2309 buf = test_byte_f(str, 0); in parse_toml_array()
2310 if (!buf || buf[0] != '[') { in parse_toml_array()
2315 buf = skip_byte_f(str, 1); in parse_toml_array()
2316 if (!buf) { in parse_toml_array()
2322 buf = skip_ws_f(str); in parse_toml_array()
2323 if (!buf) { in parse_toml_array()
2329 if (buf[0] == ']') { in parse_toml_array()
2337 buf = skip_ws_f(str); in parse_toml_array()
2338 if (!buf) { in parse_toml_array()
2350 buf = skip_ws_f(str); in parse_toml_array()
2351 if (!buf) { in parse_toml_array()
2356 if (buf[0] == ',') { in parse_toml_array()
2357 buf = skip_byte_f(str, 1); in parse_toml_array()
2358 if (!buf) { in parse_toml_array()
2363 buf = skip_ws_f(str); in parse_toml_array()
2364 if (buf[0] == '}') in parse_toml_array()
2373 if (!buf || buf[0] != ']') { in parse_toml_array()
2397 char *buf = NULL; in parse_toml_value() local
2401 buf = test_byte_f(str, 4); in parse_toml_value()
2402 if (buf && !strncmp(buf, "null", 4)) { in parse_toml_value()
2411 if (buf && !strncmp(buf, "true", 4)) { in parse_toml_value()
2423 buf = test_byte_f(str, 5); in parse_toml_value()
2424 if (buf && !strncmp(buf, "false", 5)) { in parse_toml_value()
2436 buf = test_byte_f(str, 3); in parse_toml_value()
2437 if (buf && !strncmp(buf, "\"\"\"", 3)) { in parse_toml_value()
2448 buf = test_byte_f(str, 1); in parse_toml_value()
2449 if (!buf || strncmp(buf, "\"\"", 2)) { in parse_toml_value()
2463 buf = test_byte_f(str, 0); in parse_toml_value()
2464 if (buf && buf[0] == '\"') { in parse_toml_value()
2484 if (buf && (buf[0] == '-' || (buf[0] >= '0' && buf[0] <= '9'))) { in parse_toml_value()
2504 if (buf && buf[0] == '{') { in parse_toml_value()
2520 if (buf && buf[0] == '[') { in parse_toml_value()
2541 char *buf = NULL; in parse_toml_object() local
2553 buf = test_byte_f(str, 0); in parse_toml_object()
2554 if (!buf || buf[0] != '{') { in parse_toml_object()
2559 buf = skip_byte_f(str, 1); in parse_toml_object()
2560 if (!buf) { in parse_toml_object()
2566 buf = skip_ws_f(str); in parse_toml_object()
2567 if (!buf) { in parse_toml_object()
2573 if (buf[0] == '}') { in parse_toml_object()
2580 buf = skip_ws_f(str); in parse_toml_object()
2581 if (!buf) { in parse_toml_object()
2592 if (buf[0] == '[') { in parse_toml_object()
2621 buf = skip_ws_f(str); in parse_toml_object()
2622 if (!buf || buf[0] != '=') { in parse_toml_object()
2628 buf = skip_byte_f(str, 1); in parse_toml_object()
2629 if (!buf) { in parse_toml_object()
2634 buf = skip_ws_f(str); in parse_toml_object()
2635 if (!buf) { in parse_toml_object()
2655 buf = skip_ws_f(str); in parse_toml_object()
2656 if (!buf || buf[0] == '[' || buf[0] == '}') in parse_toml_object()
2659 if (buf[0] == ',') { in parse_toml_object()
2660 buf = skip_byte_f(str, 1); in parse_toml_object()
2661 if (!buf) { in parse_toml_object()
2666 buf = skip_ws_f(str); in parse_toml_object()
2667 if (buf[0] == '[' || buf[0] == '}') in parse_toml_object()
2675 if (buf && buf[0] == '}') in parse_toml_object()
2700 char *buf = NULL; in parse_toml_table() local
2736 buf = test_byte_f(str, 0); in parse_toml_table()
2737 if (!buf || buf[0] != ']') { in parse_toml_table()
2742 buf = skip_byte_f(str, 1); in parse_toml_table()
2743 if (!buf) { in parse_toml_table()
2748 buf = skip_ws_f(str); in parse_toml_table()
2749 if (!buf) in parse_toml_table()
2752 if (buf[0] == '[') in parse_toml_table()
2767 char *buf = NULL; in parse_toml_array_table() local
2814 buf = test_byte_f(str, 1); in parse_toml_array_table()
2815 if (!buf || strncmp(buf, "]]", 2)) { in parse_toml_array_table()
2820 buf = skip_byte_f(str, 2); in parse_toml_array_table()
2821 if (!buf) { in parse_toml_array_table()
2826 buf = skip_ws_f(str); in parse_toml_array_table()
2827 if (!buf) in parse_toml_array_table()
2830 if (buf[0] == '[') in parse_toml_array_table()
2843 char *buf = NULL; in parse_toml_section() local
2852 buf = test_byte_f(str, 0); in parse_toml_section()
2853 if (!buf) { in parse_toml_section()
2858 if (buf[0] == '[') { in parse_toml_section()
2861 buf = skip_byte_f(str, 1); in parse_toml_section()
2862 if (!buf) { in parse_toml_section()
2866 if (buf[0] != '[') { in parse_toml_section()
2871 buf = skip_byte_f(str, 1); in parse_toml_section()
2872 if (!buf) { in parse_toml_section()
2903 char *buf = NULL; in mpp_cfg_from_toml() local
2907 buf = skip_ws_f(str); in mpp_cfg_from_toml()
2908 if (!buf) in mpp_cfg_from_toml()
2925 buf = skip_ws_f(str); in mpp_cfg_from_toml()
2926 if (!buf) in mpp_cfg_from_toml()
2949 str.buf = mpp_malloc_size(void, str.buf_size); in mpp_cfg_dump()
2958 mpp_cfg_print_string(str.buf); in mpp_cfg_dump()
2960 MPP_FREE(str.buf); in mpp_cfg_dump()
2963 rk_s32 mpp_cfg_to_string(MppCfgObj obj, MppCfgStrFmt fmt, char **buf) in mpp_cfg_to_string() argument
2969 if (!obj || !buf || fmt >= MPP_CFG_STR_FMT_BUTT) { in mpp_cfg_to_string()
2970 mpp_loge_f("invalid param obj %p fmt %d buf %p\n", obj, fmt, buf); in mpp_cfg_to_string()
2977 str.buf = mpp_malloc_size(void, str.buf_size); in mpp_cfg_to_string()
2999 MPP_FREE(str.buf); in mpp_cfg_to_string()
3002 *buf = str.buf; in mpp_cfg_to_string()
3006 rk_s32 mpp_cfg_from_string(MppCfgObj *obj, MppCfgStrFmt fmt, const char *buf) in mpp_cfg_from_string() argument
3012 if (!obj || fmt >= MPP_CFG_STR_FMT_BUTT || !buf) { in mpp_cfg_from_string()
3013 mpp_loge_f("invalid param obj %p fmt %d buf %p\n", obj, fmt, buf); in mpp_cfg_from_string()
3019 size = strlen(buf); in mpp_cfg_from_string()
3025 str.buf = (char *)buf; in mpp_cfg_from_string()
3031 cfg_io_dbg_from("buf %p size %d\n", buf, size); in mpp_cfg_from_string()
3032 cfg_io_dbg_from("%s", buf); in mpp_cfg_from_string()
3051 mpp_loge_f("buf %p size %d failed to get object\n", buf, size); in mpp_cfg_from_string()
3065 get_full_name(obj, str->buf, str->buf_size); in write_struct()
3067 info = mpp_trie_get_info(trie, str->buf); in write_struct()
3076 obj->depth, strof_type(obj->type), obj->name ? str->buf : "null", in write_struct()
3124 str.buf = name; in mpp_cfg_to_struct()
3226 rk_s32 mpp_cfg_print_string(char *buf) in mpp_cfg_print_string() argument
3230 rk_s32 len = strlen(buf); in mpp_cfg_print_string()
3234 if (buf[pos] == '\n') { in mpp_cfg_print_string()
3235 buf[pos] = '\0'; in mpp_cfg_print_string()
3236 mpp_logi("%s\n", &buf[start]); in mpp_cfg_print_string()
3237 buf[pos] = '\n'; in mpp_cfg_print_string()