int gangDestroy (Chefão *c, int(*myfree)(void*){ Hitman *h, *aux; if (c != NULL){ h = c -> first; while (h != NULL){ aux = h; h = h -> next; myfree(aux -> data); free(aux); } free(c); return TRUE; } return FALSE; } Fila Encadeada typedef struct _lqnode_ { struc _lqnode_ *next; void * data; }lQNode; typedef struct_lqueue_{ lQNode *first; }lQueue; lQueue *lqCreate(void){ lQueue *lq; lq = (lQueue*) malloc (sizeof(lQueue)); if (lq != NULL){ lq -> first = NULL; return lq; } return NULL; int lqDestroy (LQueue *lq, int (*myfree)(void*)){ lQNode *elm;*aux; if (lq != NULL){ elm = lq -> first; while (elm != NULL){ aux = elm; elm = elm -> next; myfree(aux -> data); free(aux); } free (lq); return TRUE; } return FALSE; } int lqEnqueue (LQueue *lq, void *data){ lQeue * novono; if (novono != NULL) { novono -> data = data; novono -> next = NULL; if (lq -> first == NULL) { lq -> first = novono; } else{ aux = lq -> first; while (aux -> next != NULL) { aux = aux -> next; } aux -> next = novono; } return TRUE; } return FALSE; `} void *lqDequeue (LQueue *lq){ if (lq != NULL) { if(lq -> first != NULL) { aux = lq -> first; lq -> first = aux -> next; data - aux -> data; free (aux); return data; } return NULL; }