void delete_hashlist(struct session *ses, struct hashtable *h, const char *pat, const char *msg_ok, const char *msg_none) { struct listnode *templist; if (is_literal(pat)) { if (delete_hash(h, pat)) { if (msg_ok) tintin_printf(ses, msg_ok, pat); } else { if (msg_none) tintin_printf(ses, msg_none, pat); } return; } templist=hash2list(h, pat); for (struct listnode *ln=templist->next; ln; ln=ln->next) { if (msg_ok) tintin_printf(ses, msg_ok, ln->left); delete_hash(h, ln->left); } if (msg_none && !templist->next) tintin_printf(ses, msg_none, pat); zap_list(templist); }
List *_rb_tree_list(QSP_ARG_DECL qrb_tree *tree_p) { if( RB_TREE_ITEM_LIST(tree_p) == NULL ){ make_rb_tree_list(tree_p); // allocates and populates a new list } else { if( ! RB_TREE_LIST_IS_CURRENT(tree_p) ){ zap_list( RB_TREE_ITEM_LIST(tree_p) ); make_rb_tree_list(tree_p); // allocates and populates a new list } } return RB_TREE_ITEM_LIST(tree_p); }
static void _hash_tbl_substring_find(QSP_ARG_DECL Frag_Match_Info *fmi_p,const char *frag) { Container *cnt_p; //Container *list_cnt_p; List *lp; cnt_p = FMI_CONTAINER(fmi_p); //list_cnt_p = ht_list_container(cnt_p->cnt_htp); lp = ht_list(cnt_p->cnt_htp); // fmi_p still points to the hash_tbl container... search_list_for_fragment(lp,fmi_p,frag); //zap_list(list_cnt_p->cnt_lp); // what does "zap" mean? BUG? zap_list(lp); // what does "zap" mean? BUG? // BUG memory leak? }
void show_hashlist(struct session *ses, struct hashtable *h, const char *pat, const char *msg_all, const char *msg_none) { struct listnode *templist; if (!*pat) { tintin_printf(ses, msg_all); templist=hash2list(h, "*"); } else templist=hash2list(h, pat); show_list(templist); if (*pat && !templist->next) tintin_printf(ses, msg_none, pat); zap_list(templist); }
static void _list_delete(QSP_ARG_DECL Container *cnt_p) { zap_list(cnt_p->cnt_lp); release_container(cnt_p); }