src/utils_lua.[ch]: Various small bugfixes.
[collectd.git] / src / utils_lua.h
1 /**
2  * collectd - src/utils_lua.h
3  * Copyright (C) 2010       Florian Forster
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; only version 2.1 of the License is
8  * applicable.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  *
19  * Authors:
20  *   Florian Forster <octo at collectd.org>
21  **/
22
23 #ifndef UTILS_LUA_H
24 #define UTILS_LUA_H 1
25
26 #include "collectd.h"
27 #include "plugin.h"
28
29 #ifndef DONT_POISON_SPRINTF_YET
30 # error "Files including utils_lua.h need to define DONT_POISON_SPRINTF_YET."
31 #endif
32 #include <lua.h>
33
34 /*
35  * access functions (stack -> C)
36  */
37 cdtime_t      luaC_tocdtime (lua_State *l, int idx);
38 int           luaC_tostringbuffer (lua_State *l, int idx, char *buffer, size_t buffer_size);
39 value_t       luaC_tovalue (lua_State *l, int idx, int ds_type);
40 value_list_t *luaC_tovaluelist (lua_State *l, int idx);
41
42 /*
43  * push functions (C -> stack)
44  */
45 int luaC_pushcdtime (lua_State *l, cdtime_t t);
46 int luaC_pushvalue (lua_State *l, value_t v, int ds_type);
47 int luaC_pushvaluelist (lua_State *l, const data_set_t *ds, const value_list_t *vl);
48
49 #endif /* UTILS_LUA_H */
50 /* vim: set sw=2 sts=2 et fdm=marker : */