Lines Matching defs:fmt

447 static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p);
449 static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p);
451 static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p);
532 static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p) {
559 out = print_array(item, depth, fmt, p);
562 out = print_object(item, depth, fmt, p);
583 out = print_array(item, depth, fmt, 0);
586 out = print_object(item, depth, fmt, 0);
633 static char *print_array(cJSON *item, int depth, int fmt, printbuffer *p) {
662 print_value(child, depth + 1, fmt, p);
665 len = fmt ? 2 : 1;
669 if (fmt) *ptr++ = ' ';
688 ret = print_value(child, depth + 1, fmt, 0);
691 len += strlen(ret) + 2 + (fmt ? 1 : 0);
720 if (fmt) *ptr++ = ' ';
788 static char *print_object(cJSON *item, int depth, int fmt, printbuffer *p) {
800 out = ensure(item->pAllocator, p, fmt ? depth + 4 : 3);
802 out = (char *)cJSON_malloc(item->pAllocator, fmt ? depth + 4 : 3);
806 if (fmt) {
817 len = fmt ? 2 : 1;
821 if (fmt) *ptr++ = '\n';
827 if (fmt) {
836 len = fmt ? 2 : 1;
840 if (fmt) *ptr++ = '\t';
843 print_value(child, depth, fmt, p);
846 len = (fmt ? 1 : 0) + (child->next ? 1 : 0);
850 if (fmt) *ptr++ = '\n';
855 ptr = ensure(item->pAllocator, p, fmt ? (depth + 1) : 2);
857 if (fmt)
877 if (fmt) len += depth;
880 entries[i++] = ret = print_value(child, depth, fmt, 0);
882 len += strlen(ret) + strlen(str) + 2 + (fmt ? 2 + depth : 0);
906 if (fmt) *ptr++ = '\n';
909 if (fmt)
915 if (fmt) *ptr++ = '\t';
920 if (fmt) *ptr++ = '\n';
928 if (fmt)