ccousas

estruturas de datos e algoritmos en C
Log | Files | Refs

lista_nodos.h (718B)


      1 #ifndef NODE_LIST_H
      2 #define NODE_LIST_H
      3 
      4 // Typedef declaration
      5 
      6 typedef struct NODE{
      7     void* item;
      8     struct NODE* sig;
      9 } NODE_T;
     10 
     11 typedef struct NODE_LIST{
     12     NODE_T* head;
     13     NODE_T* tail;
     14     int length;
     15 } NODE_LIST_T;
     16 
     17 // Function declaration
     18 
     19 NODE_LIST_T* init_node_list();
     20 int node_list_append(void* item, NODE_LIST_T* list);
     21 void* node_list_get(int index, NODE_LIST_T* list);
     22 void node_list_print(NODE_LIST_T* list, void (*print_method)(void* x, int y));
     23 int node_list_find(NODE_LIST_T* list, void* item, int (*equals_method)(void* x, void* y));
     24 int node_list_delete(int index, NODE_LIST_T* list, void (*free_method)(void* x));
     25 void node_list_free(NODE_LIST_T* list, void(*free_method)(void* x));
     26 
     27 #endif