| 3930 | } |
| 3931 | |
| 3932 | hb_buffer_t* hb_buffer_list_rem_tail(hb_buffer_list_t *list) |
| 3933 | { |
| 3934 | if (list == NULL) |
| 3935 | { |
| 3936 | return NULL; |
| 3937 | } |
| 3938 | hb_buffer_t *tail = list->tail; |
| 3939 | |
| 3940 | if (list->head == list->tail) |
| 3941 | { |
| 3942 | list->head = list->tail = NULL; |
| 3943 | list->count = 0; |
| 3944 | list->size = 0; |
| 3945 | } |
| 3946 | else if (list->tail != NULL) |
| 3947 | { |
| 3948 | hb_buffer_t *end = list->head; |
| 3949 | while (end->next != list->tail) |
| 3950 | { |
| 3951 | end = end->next; |
| 3952 | } |
| 3953 | end->next = NULL; |
| 3954 | list->tail = end; |
| 3955 | list->count--; |
| 3956 | list->size -= tail->size; |
| 3957 | } |
| 3958 | if (tail != NULL) |
| 3959 | { |
| 3960 | tail->next = NULL; |
| 3961 | } |
| 3962 | return tail; |
| 3963 | } |
| 3964 | |
| 3965 | hb_buffer_t* hb_buffer_list_rem(hb_buffer_list_t *list, hb_buffer_t * b) |
| 3966 | { |