void hashdone( struct hash * hp ) { if ( !hp ) return; if ( DEBUG_MEM || DEBUG_PROFILE ) hashstat( hp ); hash_free( hp ); }
void hashdone( struct hash *hp ) { int i; if( !hp ) return; if( DEBUG_MEM ) hashstat( hp ); if( hp->tab.base ) free( (char *)hp->tab.base ); for( i = 0; i <= hp->items.list; i++ ) free( hp->items.lists[i].base ); free( (char *)hp ); }
void hashdone( struct hash * hp ) { int i; if ( !hp ) return; if ( DEBUG_MEM || DEBUG_PROFILE ) hashstat( hp ); if ( hp->tab.base ) hash_mem_free( hp->items.datalen, (char *)hp->tab.base ); for ( i = 0; i <= hp->items.list; ++i ) hash_mem_free( hp->items.datalen, hp->items.lists[i].base ); hash_mem_free( hp->items.datalen, (char *)hp ); }
struct DATA * database_init_frompgn (FILE *finp, strlist_t *sl, const char *synfile_name, bool_t quiet) { struct DATA *pDAB = NULL; FILE *fpgn; bool_t ok = FALSE; const char *pgn; ok = NULL != (pDAB = structdata_init ()); if (NULL != synfile_name) // not provided syn_preload (quiet, synfile_name, pDAB); strlist_rwnd(sl); pgn = strlist_next(sl); while (ok && pgn) { if (!quiet) printf ("\nFile: %s\n",pgn); if (NULL != (fpgn = fopen (pgn, "r"))) { ok = fpgnscan (fpgn, quiet, pDAB); fclose(fpgn); } else { ok = FALSE; } if (ok) pgn = strlist_next(sl); } if (ok && finp) { //if (!quiet) printf ("\nFile: %s\n","standard input"); ok = fpgnscan (finp, quiet, pDAB); } return ok? pDAB: NULL; #if 0 hashstat(); #endif }