Lines Matching refs:iter

88 	struct l_jail_iter *iter, **iterp;  in l_jail_iter_next()  local
93 iter = *iterp; in l_jail_iter_next()
94 luaL_argcheck(L, iter != NULL, 1, "closed jail iterator"); in l_jail_iter_next()
96 jp = iter->params; in l_jail_iter_next()
98 if (jailparam_import_raw(&jp[0], &iter->jid, sizeof(iter->jid))) { in l_jail_iter_next()
99 jailparam_free(jp, iter->params_count); in l_jail_iter_next()
101 free(iter); in l_jail_iter_next()
107 iter->jid = jailparam_get(jp, iter->params_count, 0); in l_jail_iter_next()
108 if (iter->jid == -1) { in l_jail_iter_next()
115 jailparam_free(jp, iter->params_count); in l_jail_iter_next()
116 free(iter->params); in l_jail_iter_next()
117 free(iter); in l_jail_iter_next()
131 for (size_t i = 0; i < iter->params_count; ++i) { in l_jail_iter_next()
134 jp = &iter->params[i]; in l_jail_iter_next()
149 struct l_jail_iter *iter, **iterp; in l_jail_iter_close() local
157 iter = *iterp; in l_jail_iter_close()
158 if (iter == NULL) in l_jail_iter_close()
161 jailparam_free(iter->params, iter->params_count); in l_jail_iter_close()
162 free(iter->params); in l_jail_iter_close()
163 free(iter); in l_jail_iter_close()
171 struct l_jail_iter *iter; in l_list() local
178 iter = malloc(sizeof(*iter)); in l_list()
179 if (iter == NULL) in l_list()
186 iter->params_count = 3 + (nargs != 0 ? lua_rawlen(L, 1) : 0); in l_list()
187 iter->params = malloc(iter->params_count * sizeof(*iter->params)); in l_list()
188 if (iter->params == NULL) { in l_list()
189 free(iter); in l_list()
194 if (jailparam_init(&iter->params[0], "lastjid") == -1) { in l_list()
195 free(iter->params); in l_list()
196 free(iter); in l_list()
200 if (jailparam_init(&iter->params[1], "jid") == -1) { in l_list()
201 jailparam_free(iter->params, 1); in l_list()
202 free(iter->params); in l_list()
203 free(iter); in l_list()
207 if (jailparam_init(&iter->params[2], "name") == -1) { in l_list()
208 jailparam_free(iter->params, 2); in l_list()
209 free(iter->params); in l_list()
210 free(iter); in l_list()
220 iter->jid = 0; in l_list()
221 if (iter->params_count != 3) in l_list()
222 getparam_table(L, 1, iter->params, 2, &iter->params_count, in l_list()
233 sizeof(struct l_jail_iter **)) = iter; in l_list()