| 3873 | } |
| 3874 | |
| 3875 | void hb_buffer_list_prepend(hb_buffer_list_t *list, hb_buffer_t *buf) |
| 3876 | { |
| 3877 | int count = 1; |
| 3878 | int size = 0; |
| 3879 | hb_buffer_t *end = buf; |
| 3880 | |
| 3881 | if (buf == NULL) |
| 3882 | { |
| 3883 | return; |
| 3884 | } |
| 3885 | |
| 3886 | // Input buffer may be a list of buffers, find the end. |
| 3887 | size += buf->size; |
| 3888 | while (end != NULL && end->next != NULL) |
| 3889 | { |
| 3890 | end = end->next; |
| 3891 | size += end->size; |
| 3892 | count++; |
| 3893 | } |
| 3894 | if (list->tail == NULL) |
| 3895 | { |
| 3896 | list->head = buf; |
| 3897 | list->tail = end; |
| 3898 | } |
| 3899 | else |
| 3900 | { |
| 3901 | end->next = list->head; |
| 3902 | list->head = buf; |
| 3903 | } |
| 3904 | list->count += count; |
| 3905 | list->size += size; |
| 3906 | } |
| 3907 | |
| 3908 | hb_buffer_t* hb_buffer_list_rem_head(hb_buffer_list_t *list) |
| 3909 | { |
no outgoing calls
no test coverage detected