1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
23 #include "tool_setup.h"
25 #ifndef CURL_DISABLE_LIBCURL_OPTION
29 /* The last #include files should be: */
33 * slist_wc_append() appends a string to the linked list. This function can be
34 * used as an initialization function as well as an append function.
36 struct slist_wc *slist_wc_append(struct slist_wc *list,
39 struct curl_slist *new_item = curl_slist_append(NULL, data);
45 list = malloc(sizeof(struct slist_wc));
48 curl_slist_free_all(new_item);
52 list->first = new_item;
53 list->last = new_item;
57 list->last->next = new_item;
58 list->last = list->last->next;
62 /* be nice and clean up resources */
63 void slist_wc_free_all(struct slist_wc *list)
68 curl_slist_free_all(list->first);
72 #endif /* CURL_DISABLE_LIBCURL_OPTION */