"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib-lua/dlua-script.c" between
dovecot-2.3.16.tar.gz and dovecot-2.3.17.tar.gz

About: Dovecot is an IMAP and POP3 server, written with security primarily in mind.

dlua-script.c  (dovecot-2.3.16):dlua-script.c  (dovecot-2.3.17)
skipping to change at line 384 skipping to change at line 384
i_assert(script->ref > 0); i_assert(script->ref > 0);
if (--script->ref > 0) if (--script->ref > 0)
return; return;
dlua_script_destroy(script); dlua_script_destroy(script);
} }
bool dlua_script_has_function(struct dlua_script *script, const char *fn) bool dlua_script_has_function(struct dlua_script *script, const char *fn)
{ {
i_assert(script != NULL); i_assert(script != NULL);
lua_getglobal(script->L, fn); lua_getglobal(script->L, "_G");
lua_pushstring(script->L, fn);
lua_rawget(script->L, -2);
bool ret = lua_isfunction(script->L, -1); bool ret = lua_isfunction(script->L, -1);
lua_pop(script->L, 1); lua_pop(script->L, 2);
return ret; return ret;
} }
void dlua_setmembers(lua_State *L, const struct dlua_table_values *values, void dlua_set_members(lua_State *L, const struct dlua_table_values *values,
int idx) int idx)
{ {
i_assert(L != NULL); i_assert(L != NULL);
i_assert(lua_istable(L, idx)); i_assert(lua_istable(L, idx));
while(values->name != NULL) { while(values->name != NULL) {
switch(values->type) { switch(values->type) {
case DLUA_TABLE_VALUE_STRING: case DLUA_TABLE_VALUE_STRING:
lua_pushstring(L, values->v.s); lua_pushstring(L, values->v.s);
break; break;
case DLUA_TABLE_VALUE_INTEGER: case DLUA_TABLE_VALUE_INTEGER:
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)