+ if (i == sif_used) return;
+ memmove(sif_list+i, sif_list+i+1, (sif_used-i-1)*sizeof(sif_list[0]));
+ memmove(sif_list_extra+i, sif_list_extra+i+1, (sif_used-i-1)*sizeof(sif_list_extra[0]));
+ sif_used--;
+}
+
+void
+nuf_free_ehf(struct eh_func *ehf)
+{
+ if (ehf->extra != NULL)
+ free(ehf->extra);
+}
+
+DEFINE_EH_FUNC_LIST(nuf_list, EH_ADD_TAIL, nuf_free_ehf);
+
+int
+nuf_wrapper(void *extra, void *callextra)
+{
+ struct funcargs *fa = (struct funcargs *)extra;
+ struct userNode *user = (struct userNode *)callextra;
+
+ ((new_user_func_t)fa->func)(user, fa->extra);
+
+ if (user->dead)
+ return EH_STOP;
+
+ return EH_CONT;
+}
+
+void
+reg_new_user_func_pos(new_user_func_t handler, void *extra, int pos)
+{
+ struct funcargs *fa = malloc(sizeof(struct funcargs));
+
+ fa->func = (void *)handler;
+ fa->extra = extra;
+
+ reg_hook_func_pos(&nuf_list, nuf_wrapper, (void *)fa, pos);
+}
+
+void
+reg_new_user_func(new_user_func_t handler, void *extra)
+{
+ reg_new_user_func_pos(handler, extra, EH_ADD_DEFAULT);
+}
+
+void
+call_new_user_funcs(struct userNode* user)
+{
+ call_hook_func_args(&nuf_list, (void *)user);