| 122 | } |
| 123 | |
| 124 | static inline void *stklist_pop(StackList_t *p) |
| 125 | { |
| 126 | int head = 0; |
| 127 | |
| 128 | if (p==NULL) |
| 129 | return NULL; |
| 130 | |
| 131 | if (p->top > 0 ){ |
| 132 | return (void*)p->ele[--p->top]; |
| 133 | } |
| 134 | else |
| 135 | return NULL; |
| 136 | } |
| 137 | |
| 138 | //id: the id of element to be freed. |
| 139 | //return code: -1: faile; >=0:OK. |