lua_ucl.h (98e0ffaefb0f241cda3a72395d3be04192ae0d47) lua_ucl.h (a0409676120c1e558d0ade943019934e0f15118d)
1/* Copyright (c) 2014, Vsevolod Stakhov
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright

--- 41 unchanged lines hidden (view full) ---

50 * Import UCL object from lua state
51 * @param L lua state
52 * @param idx index of object at the lua stack to convert to UCL
53 * @return new UCL object or NULL, the caller should unref object after using
54 */
55UCL_EXTERN ucl_object_t* ucl_object_lua_import (lua_State *L, int idx);
56
57/**
1/* Copyright (c) 2014, Vsevolod Stakhov
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright

--- 41 unchanged lines hidden (view full) ---

50 * Import UCL object from lua state
51 * @param L lua state
52 * @param idx index of object at the lua stack to convert to UCL
53 * @return new UCL object or NULL, the caller should unref object after using
54 */
55UCL_EXTERN ucl_object_t* ucl_object_lua_import (lua_State *L, int idx);
56
57/**
58 * Import UCL object from lua state, escaping JSON strings
59 * @param L lua state
60 * @param idx index of object at the lua stack to convert to UCL
61 * @return new UCL object or NULL, the caller should unref object after using
62 */
63UCL_EXTERN ucl_object_t* ucl_object_lua_import_escape (lua_State *L, int idx);
64
65/**
58 * Push an object to lua
59 * @param L lua state
60 * @param obj object to push
61 * @param allow_array traverse over implicit arrays
62 */
63UCL_EXTERN int ucl_object_push_lua (lua_State *L,
64 const ucl_object_t *obj, bool allow_array);
66 * Push an object to lua
67 * @param L lua state
68 * @param obj object to push
69 * @param allow_array traverse over implicit arrays
70 */
71UCL_EXTERN int ucl_object_push_lua (lua_State *L,
72 const ucl_object_t *obj, bool allow_array);
73/**
74 * Push an object to lua replacing all ucl.null with `false`
75 * @param L lua state
76 * @param obj object to push
77 * @param allow_array traverse over implicit arrays
78 */
79UCL_EXTERN int ucl_object_push_lua_filter_nil (lua_State *L,
80 const ucl_object_t *obj,
81 bool allow_array);
65
82
66UCL_EXTERN struct ucl_lua_funcdata* ucl_object_toclosure (
67 const ucl_object_t *obj);
83UCL_EXTERN struct ucl_lua_funcdata* ucl_object_toclosure (const ucl_object_t *obj);
68
69#endif /* LUA_UCL_H_ */
84
85#endif /* LUA_UCL_H_ */