Browse Source

ENGINE-795: Documented bloblist_join; also fixed the first == second issue

audit_branch
parent
commit
e2cee3c842
2 changed files with 19 additions and 1 deletions
  1. +4
    -1
      src/bloblist.c
  2. +15
    -0
      src/bloblist.h

+ 4
- 1
src/bloblist.c View File

@ -168,7 +168,10 @@ DYNAMIC_API bloblist_t* bloblist_join(bloblist_t* first, bloblist_t* second) {
return second;
if (!second)
return first;
if (first == second)
return first;
bloblist_t* list_curr = first;
while (list_curr->next) {


+ 15
- 0
src/bloblist.h View File

@ -126,6 +126,21 @@ DYNAMIC_API int bloblist_length(const bloblist_t *bloblist);
DYNAMIC_API void set_blob_disposition(bloblist_t* blob,
content_disposition_type disposition);
// bloblist_join() - append second list to the first.
//
// parameters:
// first (in) first bloblist, to be head of list if not NULL
// second (in) bloblist to append to first bloblist; if first
// bloblist is NULL, this will be the head of the list
//
// return value:
// head of the joined bloblist
//
// caveats:
// This function appends the actual bloblist to the end of the first - ownership
// of the second bloblist goes to the list. THERE IS NO COPYING.
// Also, if the same pointer is sent in twice, there is no join - the original
// list will be returned as is.
DYNAMIC_API bloblist_t* bloblist_join(bloblist_t* first, bloblist_t* second);
#ifdef __cplusplus


Loading…
Cancel
Save