void llist_free(llist_t *list) { llist_t next; lassert(list); for (; *list; *list = next) { next = (*list)->rest; L_FREE(*list); } }
void L_clean_jrg_info (L_JRG_Info *jrg_info) { HashTable h; L_Target_Info *t; h = jrg_info->target_hash; HashTable_start (h); while ((t = (L_Target_Info *) HashTable_next (h))) L_FREE (L_Target_Info, t); HashTable_free (h); return; }
llist_t llist_pop(llist_t list, void **x) { llist_t p; lassert(list); p = list->rest; if (x) { *x = list->first; L_FREE(list); return p; } else { return list; } }
int main(int argc, char *argv[]) { #if HAS_HIREDIS const char *text = "hello, world"; l_redis_connection_t conn = l_create_redis_connection(NULL, 0); l_redis_set(conn, "foo", text); const char *val = l_redis_get(conn, "foo"); assert(!strcmp(val, text)); L_FREE(val); l_close_redis_connection(conn); #endif return 0; }