This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | myfifo_entry_struct |
struct | myfifo_struct |
Typedefs | |
typedef myfifo_entry_struct | myfifo_e |
typedef myfifo_struct | myfifo |
Functions | |
int | myfifo_length (myfifo **foo) |
void * | myfifo_pop (myfifo **foo) |
void | myfifo_push (myfifo **foo, void *data) |
void | myfifo_trav (myfifo **foo, void(*func)()) |
void | myfifo_trav_r (myfifo **foo, void(*func)()) |
typedef struct myfifo_struct myfifo |
typedef struct myfifo_entry_struct myfifo_e |
int myfifo_length | ( | myfifo ** | foo | ) |
Definition at line 33 of file myfifo.c.
References check_fifo(), and PFOO.
00034 { 00035 check_fifo(foo); 00036 return PFOO->count; 00037 }
void* myfifo_pop | ( | myfifo ** | foo | ) |
Definition at line 39 of file myfifo.c.
References check_fifo(), myfifo_entry_struct::data, myfifo_entry_struct::next, PFOO, and myfifo_entry_struct::prev.
00040 { 00041 void *tmpd; 00042 myfifo_e *tmp; 00043 00044 check_fifo(foo); 00045 tmp = PFOO->last; 00046 /* Is the list empty? */ 00047 if (tmp != NULL) { 00048 /* Are we removeing the only element? */ 00049 if (PFOO->first == PFOO->last) { 00050 PFOO->first = NULL; 00051 PFOO->last = NULL; 00052 } else 00053 tmp->prev->next = NULL; 00054 PFOO->last = tmp->prev; 00055 /* Are we going down to only one element? */ 00056 if (PFOO->last->prev == NULL) 00057 PFOO->first = PFOO->last; 00058 PFOO->count--; 00059 tmpd = tmp->data; 00060 free(tmp); 00061 return tmpd; 00062 } else 00063 return NULL; 00064 }
void myfifo_push | ( | myfifo ** | foo, | |
void * | data | |||
) |
Definition at line 66 of file myfifo.c.
References check_fifo(), myfifo_entry_struct::data, myfifo_entry_struct::next, PFOO, and myfifo_entry_struct::prev.
00067 { 00068 myfifo_e *tmp; 00069 00070 check_fifo(foo); 00071 tmp = (myfifo_e *) malloc(sizeof(myfifo_e)); 00072 tmp->data = data; 00073 tmp->next = PFOO->first; 00074 tmp->prev = NULL; 00075 PFOO->count++; 00076 if (PFOO->first == NULL) { 00077 PFOO->first = tmp; 00078 PFOO->last = tmp; 00079 } else 00080 PFOO->first->prev = tmp; 00081 PFOO->first = tmp; 00082 }
void myfifo_trav | ( | myfifo ** | foo, | |
void(*)() | func | |||
) |
Definition at line 84 of file myfifo.c.
References check_fifo(), myfifo_entry_struct::data, myfifo_entry_struct::next, and PFOO.
00085 { 00086 myfifo_e *tmp; 00087 00088 check_fifo(foo); 00089 for (tmp = PFOO->first; tmp != NULL; tmp = tmp->next) 00090 func(tmp->data); 00091 }
void myfifo_trav_r | ( | myfifo ** | foo, | |
void(*)() | func | |||
) |
Definition at line 93 of file myfifo.c.
References check_fifo(), myfifo_entry_struct::data, PFOO, and myfifo_entry_struct::prev.
00094 { 00095 myfifo_e *tmp; 00096 00097 check_fifo(foo); 00098 for (tmp = PFOO->last; tmp != NULL; tmp = tmp->prev) 00099 func(tmp->data); 00100 }