* hb_buffer_list implementation *********************************************************************/
| 3840 | * hb_buffer_list implementation |
| 3841 | *********************************************************************/ |
| 3842 | void hb_buffer_list_append(hb_buffer_list_t *list, hb_buffer_t *buf) |
| 3843 | { |
| 3844 | int count = 1; |
| 3845 | int size = 0; |
| 3846 | hb_buffer_t *end = buf; |
| 3847 | |
| 3848 | if (buf == NULL) |
| 3849 | { |
| 3850 | return; |
| 3851 | } |
| 3852 | |
| 3853 | // Input buffer may be a list of buffers, find the end. |
| 3854 | size += buf->size; |
| 3855 | while (end != NULL && end->next != NULL) |
| 3856 | { |
| 3857 | end = end->next; |
| 3858 | size += end->size; |
| 3859 | count++; |
| 3860 | } |
| 3861 | if (list->tail == NULL) |
| 3862 | { |
| 3863 | list->head = buf; |
| 3864 | list->tail = end; |
| 3865 | } |
| 3866 | else |
| 3867 | { |
| 3868 | list->tail->next = buf; |
| 3869 | list->tail = end; |
| 3870 | } |
| 3871 | list->count += count; |
| 3872 | list->size += size; |
| 3873 | } |
| 3874 | |
| 3875 | void hb_buffer_list_prepend(hb_buffer_list_t *list, hb_buffer_t *buf) |
| 3876 | { |
no outgoing calls
no test coverage detected