|
|
| version 1.1.1.1, 2012/02/21 16:57:34 | version 1.1.1.2, 2016/10/18 14:04:50 |
|---|---|
| Line 76 hash_status_enum hash_find(hash_type* hash_table, void | Line 76 hash_status_enum hash_find(hash_type* hash_table, void |
| hash_status_enum hash_next_item(hash_type* hash_table, hash_node_type** ppnode) { | hash_status_enum hash_next_item(hash_type* hash_table, hash_node_type** ppnode) { |
| int i; | int i; |
| if (hash_table == 0) { | |
| return HASH_STATUS_KEY_NOT_FOUND; | |
| } | |
| if(*ppnode != NULL) { | if(*ppnode != NULL) { |
| if((*ppnode)->next != NULL) { | if((*ppnode)->next != NULL) { |
| *ppnode = (*ppnode)->next; | *ppnode = (*ppnode)->next; |
| Line 101 hash_status_enum hash_next_item(hash_type* hash_table, | Line 106 hash_status_enum hash_next_item(hash_type* hash_table, |
| void hash_delete_all(hash_type* hash_table) { | void hash_delete_all(hash_type* hash_table) { |
| int i; | int i; |
| hash_node_type *n, *nn; | hash_node_type *n, *nn; |
| if(hash_table == 0) { | |
| return; | |
| } | |
| for(i = 0; i < hash_table->size; i++) { | for(i = 0; i < hash_table->size; i++) { |
| n = hash_table->table[i]; | n = hash_table->table[i]; |
| while(n != NULL) { | while(n != NULL) { |