diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:57:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:57:31 +0100 |
commit | 379055dbbb4af997b4d3ffb161d447872d7ca357 (patch) | |
tree | 3774553d470f93e12ddeb454aad9b3b607cf8918 /src/lua/lua_cdb.c | |
parent | 602ae7a0b7e215ba2677131b8fdc70abc156b3ca (diff) | |
download | rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.tar.gz rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.zip |
Unify style without sorting headers.
Diffstat (limited to 'src/lua/lua_cdb.c')
-rw-r--r-- | src/lua/lua_cdb.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lua/lua_cdb.c b/src/lua/lua_cdb.c index 6832dfe59..0b0821dd0 100644 --- a/src/lua/lua_cdb.c +++ b/src/lua/lua_cdb.c @@ -31,22 +31,22 @@ LUA_FUNCTION_DEF (cdb, lookup); LUA_FUNCTION_DEF (cdb, get_name); LUA_FUNCTION_DEF (cdb, destroy); -static const struct luaL_reg cdblib_m[] = { +static const struct luaL_reg cdblib_m[] = { LUA_INTERFACE_DEF (cdb, lookup), LUA_INTERFACE_DEF (cdb, get_name), {"__tostring", lua_class_tostring}, {"__gc", lua_cdb_destroy}, {NULL, NULL} }; -static const struct luaL_reg cdblib_f[] = { +static const struct luaL_reg cdblib_f[] = { LUA_INTERFACE_DEF (cdb, create), {NULL, NULL} }; -static struct cdb * +static struct cdb * lua_check_cdb (lua_State * L) { - void *ud = luaL_checkudata (L, 1, "rspamd{cdb}"); + void *ud = luaL_checkudata (L, 1, "rspamd{cdb}"); luaL_argcheck (L, ud != NULL, 1, "'cdb' expected"); return ud ? *((struct cdb **)ud) : NULL; @@ -55,9 +55,9 @@ lua_check_cdb (lua_State * L) static gint lua_cdb_create (lua_State *L) { - struct cdb *cdb, **pcdb; - const gchar *filename; - gint fd; + struct cdb *cdb, **pcdb; + const gchar *filename; + gint fd; filename = luaL_checkstring (L, 1); /* If file begins with cdb://, just skip it */ @@ -79,7 +79,7 @@ lua_cdb_create (lua_State *L) lua_pushnil (L); } else { - pcdb = lua_newuserdata (L, sizeof (struct cdb*)); + pcdb = lua_newuserdata (L, sizeof (struct cdb *)); lua_setclass (L, "rspamd{cdb}", -1); *pcdb = cdb; } @@ -91,7 +91,7 @@ lua_cdb_create (lua_State *L) static gint lua_cdb_get_name (lua_State *L) { - struct cdb *cdb = lua_check_cdb (L); + struct cdb *cdb = lua_check_cdb (L); lua_pushstring (L, cdb->filename); return 1; @@ -100,11 +100,11 @@ lua_cdb_get_name (lua_State *L) static gint lua_cdb_lookup (lua_State *L) { - struct cdb *cdb = lua_check_cdb (L); - const gchar *what; - gchar *value; - gsize vlen; - gint64 vpos; + struct cdb *cdb = lua_check_cdb (L); + const gchar *what; + gchar *value; + gsize vlen; + gint64 vpos; /* * XXX: this code is placed here because event_loop is called inside workers, so start @@ -134,7 +134,7 @@ lua_cdb_lookup (lua_State *L) static gint lua_cdb_destroy (lua_State *L) { - struct cdb *cdb = lua_check_cdb (L); + struct cdb *cdb = lua_check_cdb (L); if (cdb) { cdb_free (cdb); @@ -158,7 +158,7 @@ luaopen_cdb (lua_State * L) lua_pushstring (L, "rspamd{cdb}"); lua_rawset (L, -3); - luaL_register (L, NULL, cdblib_m); + luaL_register (L, NULL, cdblib_m); luaL_register (L, "cdb", cdblib_f); lua_pop (L, 1); /* remove metatable from stack */ |