Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct hash_fechada{
- TList **items;
- int TABLE_SIZE, qtd;
- }THashFechada;
- THashFechada* cria_hash_fechada (int TABLE_SIZE, int size_element){
- THashFechada* ha = (THashFechada*) malloc(sizeof(THashFechada));
- if(ha != NULL){
- int i;
- ha->TABLE_SIZE = TABLE_SIZE;
- ha->items = (TList**) malloc(TABLE_SIZE * sizeof(TList*));
- if(ha->items == NULL){
- free(ha);
- return NULL;
- }
- ha->qtd = 0;
- for(i=0; i < ha->TABLE_SIZE; i++){
- ha->items[i] = malloc(sizeof(TList));
- ha->items[i]->element_size = size_element;
- ha->items[i]->size = 0;
- ha->items[i]->head = ha->items[i]->tail = NULL;
- ha->items[i]->free_fn = NULL;
- }
- }
- return ha;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement