Lines Matching refs:obj
74 static int ucl_object_lua_push_array (lua_State *L, const ucl_object_t *obj);
75 static int ucl_object_lua_push_scalar (lua_State *L, const ucl_object_t *obj, bool allow_array);
89 const ucl_object_t *obj) in ucl_object_lua_push_element() argument
92 ucl_object_push_lua (L, obj, true); in ucl_object_lua_push_element()
139 ucl_object_lua_push_object (lua_State *L, const ucl_object_t *obj, in ucl_object_lua_push_object() argument
146 if (allow_array && obj->next != NULL) { in ucl_object_lua_push_object()
148 return ucl_object_lua_push_array (L, obj); in ucl_object_lua_push_object()
152 while (ucl_object_iterate (obj, &it, true) != NULL) { in ucl_object_lua_push_object()
159 while ((cur = ucl_object_iterate (obj, &it, true)) != NULL) { in ucl_object_lua_push_object()
173 ucl_object_lua_push_array (lua_State *L, const ucl_object_t *obj) in ucl_object_lua_push_array() argument
179 if (obj->type == UCL_ARRAY) { in ucl_object_lua_push_array()
180 nelt = obj->len; in ucl_object_lua_push_array()
181 it = ucl_object_iterate_new (obj); in ucl_object_lua_push_array()
194 LL_FOREACH (obj, cur) { in ucl_object_lua_push_array()
200 LL_FOREACH (obj, cur) { in ucl_object_lua_push_array()
214 ucl_object_lua_push_scalar (lua_State *L, const ucl_object_t *obj, in ucl_object_lua_push_scalar() argument
219 if (allow_array && obj->next != NULL) { in ucl_object_lua_push_scalar()
221 return ucl_object_lua_push_array (L, obj); in ucl_object_lua_push_scalar()
224 switch (obj->type) { in ucl_object_lua_push_scalar()
226 lua_pushboolean (L, ucl_obj_toboolean (obj)); in ucl_object_lua_push_scalar()
229 lua_pushstring (L, ucl_obj_tostring (obj)); in ucl_object_lua_push_scalar()
233 lua_pushinteger (L, ucl_obj_toint (obj)); in ucl_object_lua_push_scalar()
235 lua_pushnumber (L, ucl_obj_toint (obj)); in ucl_object_lua_push_scalar()
240 lua_pushnumber (L, ucl_obj_todouble (obj)); in ucl_object_lua_push_scalar()
246 fd = (struct ucl_lua_funcdata *)obj->value.ud; in ucl_object_lua_push_scalar()
273 ucl_object_push_lua (lua_State *L, const ucl_object_t *obj, bool allow_array) in ucl_object_push_lua() argument
275 switch (obj->type) { in ucl_object_push_lua()
277 return ucl_object_lua_push_object (L, obj, allow_array); in ucl_object_push_lua()
279 return ucl_object_lua_push_array (L, obj); in ucl_object_push_lua()
281 return ucl_object_lua_push_scalar (L, obj, allow_array); in ucl_object_push_lua()
294 ucl_object_t *obj, *top = NULL; in ucl_object_lua_fromtable() local
338 obj = ucl_object_lua_fromelt (L, lua_gettop (L)); in ucl_object_lua_fromtable()
339 if (obj != NULL) { in ucl_object_lua_fromtable()
340 ucl_array_append (top, obj); in ucl_object_lua_fromtable()
351 obj = ucl_object_lua_fromelt (L, lua_gettop (L)); in ucl_object_lua_fromtable()
353 if (obj != NULL) { in ucl_object_lua_fromtable()
354 ucl_object_insert_key (top, obj, k, keylen, true); in ucl_object_lua_fromtable()
374 ucl_object_t *obj = NULL; in ucl_object_lua_fromelt() local
381 obj = ucl_object_fromstring_common (lua_tostring (L, idx), 0, 0); in ucl_object_lua_fromelt()
386 obj = ucl_object_fromint (num); in ucl_object_lua_fromelt()
389 obj = ucl_object_fromdouble (num); in ucl_object_lua_fromelt()
393 obj = ucl_object_frombool (lua_toboolean (L, idx)); in ucl_object_lua_fromelt()
397 obj = ucl_object_typed_new (UCL_NULL); in ucl_object_lua_fromelt()
409 obj = ucl_object_lua_fromelt (L, 1); in ucl_object_lua_fromelt()
415 obj = ucl_object_lua_fromtable (L, idx); in ucl_object_lua_fromelt()
425 obj = ucl_object_new_userdata (lua_ucl_userdata_dtor, in ucl_object_lua_fromelt()
433 return obj; in ucl_object_lua_fromelt()
448 ucl_object_t *obj; in ucl_object_lua_import() local
454 obj = ucl_object_lua_fromtable (L, idx); in ucl_object_lua_import()
457 obj = ucl_object_lua_fromelt (L, idx); in ucl_object_lua_import()
461 return obj; in ucl_object_lua_import()
465 lua_ucl_to_string (lua_State *L, const ucl_object_t *obj, enum ucl_emitter type) in lua_ucl_to_string() argument
469 result = ucl_object_emit (obj, type); in lua_ucl_to_string()
518 lua_ucl_push_opaque (lua_State *L, ucl_object_t *obj) in lua_ucl_push_opaque() argument
523 *pobj = obj; in lua_ucl_push_opaque()
642 ucl_object_t *obj; in lua_ucl_parser_get_object() local
646 obj = ucl_parser_get_object (parser); in lua_ucl_parser_get_object()
648 if (obj != NULL) { in lua_ucl_parser_get_object()
649 ret = ucl_object_push_lua (L, obj, false); in lua_ucl_parser_get_object()
651 ucl_object_unref (obj); in lua_ucl_parser_get_object()
670 ucl_object_t *obj; in lua_ucl_parser_get_object_wrapped() local
674 obj = ucl_parser_get_object (parser); in lua_ucl_parser_get_object_wrapped()
676 if (obj != NULL) { in lua_ucl_parser_get_object_wrapped()
677 lua_ucl_push_opaque (L, obj); in lua_ucl_parser_get_object_wrapped()
778 ucl_object_t *obj; in lua_ucl_object_unwrap() local
780 obj = lua_ucl_object_get (L, 1); in lua_ucl_object_unwrap()
782 if (obj) { in lua_ucl_object_unwrap()
783 ucl_object_push_lua (L, obj, true); in lua_ucl_object_unwrap()
830 ucl_object_t *obj; in lua_ucl_object_tostring() local
833 obj = lua_ucl_object_get (L, 1); in lua_ucl_object_tostring()
835 if (obj) { in lua_ucl_object_tostring()
844 return lua_ucl_to_string (L, obj, format); in lua_ucl_object_tostring()
868 ucl_object_t *obj, *schema, *ext_refs = NULL; in lua_ucl_object_validate() local
874 obj = lua_ucl_object_get (L, 1); in lua_ucl_object_validate()
877 if (schema && obj && ucl_object_type (schema) == UCL_OBJECT) { in lua_ucl_object_validate()
909 res = ucl_object_validate_root_ext (schema_elt, obj, schema, in lua_ucl_object_validate()
954 ucl_object_t *obj; in lua_ucl_object_gc() local
956 obj = lua_ucl_object_get (L, 1); in lua_ucl_object_gc()
958 ucl_object_unref (obj); in lua_ucl_object_gc()
1027 ucl_object_t *obj; in lua_ucl_to_json() local
1036 obj = ucl_object_lua_import (L, 1); in lua_ucl_to_json()
1037 if (obj != NULL) { in lua_ucl_to_json()
1038 lua_ucl_to_string (L, obj, format); in lua_ucl_to_json()
1039 ucl_object_unref (obj); in lua_ucl_to_json()
1051 ucl_object_t *obj; in lua_ucl_to_config() local
1053 obj = ucl_object_lua_import (L, 1); in lua_ucl_to_config()
1054 if (obj != NULL) { in lua_ucl_to_config()
1055 lua_ucl_to_string (L, obj, UCL_EMIT_CONFIG); in lua_ucl_to_config()
1056 ucl_object_unref (obj); in lua_ucl_to_config()
1102 ucl_object_t *obj; in lua_ucl_to_format() local
1135 obj = ucl_object_lua_import (L, 1); in lua_ucl_to_format()
1136 if (obj != NULL) { in lua_ucl_to_format()
1137 lua_ucl_to_string (L, obj, format); in lua_ucl_to_format()
1138 ucl_object_unref (obj); in lua_ucl_to_format()
1207 ucl_object_toclosure (const ucl_object_t *obj) in ucl_object_toclosure() argument
1209 if (obj == NULL || obj->type != UCL_USERDATA) { in ucl_object_toclosure()
1213 return (struct ucl_lua_funcdata*)obj->value.ud; in ucl_object_toclosure()