comparison sidlib.c @ 254:cc6d8d47dbc2

More sidlib_stildb_free() to more logical position in the source.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Jan 2020 20:45:12 +0200
parents c98be346c706
children 3c1cb0f39703
comparison
equal deleted inserted replaced
253:c98be346c706 254:cc6d8d47dbc2
681 681
682 return res; 682 return res;
683 } 683 }
684 684
685 685
686 /* Free a given STIL database
687 */
688 void sidlib_stildb_free(SIDLibSTILDB *dbh)
689 {
690 if (dbh != NULL)
691 {
692 th_llist_free_func((th_llist_t *) dbh->nodes,
693 (void (*)(void *)) sidlib_stildb_node_free);
694
695 dbh->nodes = NULL;
696 dbh->nnodes = 0;
697
698 th_free_r(&dbh->pindex);
699 th_free(dbh);
700 }
701 }
702
703
686 /* Read database (additively) to given db-structure 704 /* Read database (additively) to given db-structure
687 */ 705 */
688 enum 706 enum
689 { 707 {
690 PM_EOF, 708 PM_EOF,
1107 1125
1108 return THERR_OK; 1126 return THERR_OK;
1109 } 1127 }
1110 1128
1111 1129
1112 /* Free a given STIL database
1113 */
1114 void sidlib_stildb_free(SIDLibSTILDB *dbh)
1115 {
1116 if (dbh != NULL)
1117 {
1118 th_llist_free_func((th_llist_t *) dbh->nodes,
1119 (void (*)(void *)) sidlib_stildb_node_free);
1120
1121 dbh->nodes = NULL;
1122 dbh->nnodes = 0;
1123
1124 th_free_r(&dbh->pindex);
1125 th_free(dbh);
1126 }
1127 }
1128
1129
1130 /* Get STIL information node from database 1130 /* Get STIL information node from database
1131 */ 1131 */
1132 SIDLibSTILNode *sidlib_stildb_get_node(SIDLibSTILDB *dbh, const char *filename) 1132 SIDLibSTILNode *sidlib_stildb_get_node(SIDLibSTILDB *dbh, const char *filename)
1133 { 1133 {
1134 SIDLibSTILNode keyItem, *key, **item; 1134 SIDLibSTILNode keyItem, *key, **item;