Lines Matching defs:obj

44 		const ucl_object_t *obj, bool first, bool print_key, bool compact);
48 const ucl_object_t *obj, bool first, bool print_key); \
50 const ucl_object_t *obj, bool print_key); \
52 const ucl_object_t *obj, bool print_key); \
54 const ucl_object_t *obj); \
56 const ucl_object_t *obj)
86 #define UCL_EMIT_IDENT_TOP_OBJ(ctx, obj) ((ctx)->top != (obj) || \
107 * @param obj
111 const ucl_object_t *obj, bool compact)
120 if (obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) {
121 ucl_elt_string_write_json (obj->key, obj->keylen, ctx);
124 func->ucl_emitter_append_len (obj->key, obj->keylen, func->ud);
127 if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) {
135 if (obj->keylen > 0 && (obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE)) {
136 ucl_elt_string_write_json (obj->key, obj->keylen, ctx);
138 else if (obj->keylen > 0) {
139 func->ucl_emitter_append_len (obj->key, obj->keylen, func->ud);
148 if (obj->keylen > 0) {
149 ucl_elt_string_write_json (obj->key, obj->keylen, ctx);
166 const ucl_object_t *obj, bool compact, bool is_array)
170 if (ctx->id == UCL_EMIT_CONFIG && obj != ctx->top) {
171 if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) {
194 const ucl_object_t *obj, bool compact)
198 if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) {
213 ucl_emitter_finish_object (ctx, obj, compact, false);
223 const ucl_object_t *obj, bool compact)
240 ucl_emitter_finish_object (ctx, obj, compact, true);
246 * @param obj object to write
251 const ucl_object_t *obj, bool print_key, bool compact)
258 ucl_emitter_print_key (print_key, ctx, obj, compact);
269 if (obj->type == UCL_ARRAY) {
271 while ((cur = ucl_object_iterate (obj, &iter, true)) != NULL) {
278 cur = obj;
292 * @param obj object to write
297 const ucl_object_t *obj, bool print_key, bool compact)
304 ucl_emitter_print_key (print_key, ctx, obj, compact);
309 if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) {
319 while ((cur = ucl_hash_iterate (obj->value.ov, &it))) {
353 * @param obj object to print
360 const ucl_object_t *obj, bool first, bool print_key, bool compact)
384 comment = ucl_object_lookup_len (ctx->comments, (const char *)&obj,
402 switch (obj->type) {
404 ucl_emitter_print_key (print_key, ctx, obj, compact);
405 func->ucl_emitter_append_int (ucl_object_toint (obj), func->ud);
406 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
410 ucl_emitter_print_key (print_key, ctx, obj, compact);
411 func->ucl_emitter_append_double (ucl_object_todouble (obj), func->ud);
412 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
415 ucl_emitter_print_key (print_key, ctx, obj, compact);
416 flag = ucl_object_toboolean (obj);
423 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
426 ucl_emitter_print_key (print_key, ctx, obj, compact);
427 if (ctx->id == UCL_EMIT_CONFIG && ucl_maybe_long_string (obj)) {
428 ucl_elt_string_write_multiline (obj->value.sv, obj->len, ctx);
431 ucl_elt_string_write_json (obj->value.sv, obj->len, ctx);
433 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
436 ucl_emitter_print_key (print_key, ctx, obj, compact);
438 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
441 ucl_emitter_common_start_object (ctx, obj, print_key, compact);
442 ucl_emitter_common_end_object (ctx, obj, compact);
445 ucl_emitter_common_start_array (ctx, obj, print_key, compact);
446 ucl_emitter_common_end_array (ctx, obj, compact);
449 ud = (struct ucl_object_userdata *)obj;
450 ucl_emitter_print_key (print_key, ctx, obj, compact);
452 ud_out = ud->emitter (obj->value.ud);
458 ucl_emitter_finish_object (ctx, obj, compact, !print_key);
481 const ucl_object_t *obj, bool first, bool print_key) { \
482 ucl_emitter_common_elt (ctx, obj, first, print_key, (compact)); \
485 const ucl_object_t *obj, bool print_key) { \
486 ucl_emitter_common_start_object (ctx, obj, print_key, (compact)); \
489 const ucl_object_t *obj, bool print_key) { \
490 ucl_emitter_common_start_array (ctx, obj, print_key, (compact)); \
493 const ucl_object_t *obj) { \
494 ucl_emitter_common_end_object (ctx, obj, (compact)); \
497 const ucl_object_t *obj) { \
498 ucl_emitter_common_end_array (ctx, obj, (compact)); \
508 const ucl_object_t *obj, bool first, bool print_key)
515 switch (obj->type) {
517 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
518 ucl_emitter_print_int_msgpack (ctx, ucl_object_toint (obj));
523 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
524 ucl_emitter_print_double_msgpack (ctx, ucl_object_todouble (obj));
528 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
529 ucl_emitter_print_bool_msgpack (ctx, ucl_object_toboolean (obj));
533 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
535 if (obj->flags & UCL_OBJECT_BINARY) {
536 ucl_emitter_print_binary_string_msgpack (ctx, obj->value.sv,
537 obj->len);
540 ucl_emitter_print_string_msgpack (ctx, obj->value.sv, obj->len);
545 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
550 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
551 ucl_emit_msgpack_start_obj (ctx, obj, print_key);
554 while ((cur = ucl_object_iterate (obj, &it, true)) != NULL) {
569 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
570 ucl_emit_msgpack_start_array (ctx, obj, print_key);
573 while ((cur = ucl_object_iterate (obj, &it, true)) != NULL) {
580 ud = (struct ucl_object_userdata *)obj;
581 ucl_emitter_print_key_msgpack (print_key, ctx, obj);
584 ud_out = ud->emitter (obj->value.ud);
589 ucl_emitter_print_string_msgpack (ctx, obj->value.sv, obj->len);
596 const ucl_object_t *obj, bool print_key)
598 ucl_emitter_print_object_msgpack (ctx, obj->len);
603 const ucl_object_t *obj, bool print_key)
605 ucl_emitter_print_array_msgpack (ctx, obj->len);
610 const ucl_object_t *obj)
617 const ucl_object_t *obj)
623 ucl_object_emit (const ucl_object_t *obj, enum ucl_emitter emit_type)
625 return ucl_object_emit_len (obj, emit_type, NULL);
629 ucl_object_emit_len (const ucl_object_t *obj, enum ucl_emitter emit_type,
636 if (obj == NULL) {
644 ucl_object_emit_full (obj, emit_type, func, NULL);
657 ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type,
670 my_ctx.top = obj;
673 my_ctx.ops->ucl_emitter_write_elt (&my_ctx, obj, true, false);