curl/docs/libcurl/curl_slist_free_all.md
Daniel Stenberg 8c1d9378ac
curldown: make 'added-in:' a mandatory header field
- generate AVAILABILITY manpage sections automatically - for consistent
  wording

- allows us to double-check against other documumentation (symbols-in-versions
  etc)

- enables proper automation/scripting based on this data

- lots of them were wrong or missing in the manpages

- several of them repeated (sometimes mismatching) backend support info

Add test 1488 to verify "added-in" version numbers against
symbols-in-versions.

Closes #14217
2024-07-18 18:04:09 +02:00

922 B

c SPDX-License-Identifier Title Section Source See-also Protocol Added-in
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. curl curl_slist_free_all 3 libcurl
curl_slist_append (3)
All
7.1

NAME

curl_slist_free_all - free an entire curl_slist list

SYNOPSIS

#include <curl/curl.h>

void curl_slist_free_all(struct curl_slist *list);

DESCRIPTION

curl_slist_free_all() removes all traces of a previously built curl_slist linked list.

Passing in a NULL pointer in list makes this function return immediately with no action.

EXAMPLE

int main(void)
{
  CURL *handle;
  struct curl_slist *slist = NULL;

  slist = curl_slist_append(slist, "X-libcurl: coolness");

  if(!slist)
    return -1;

  curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);

  curl_easy_perform(handle);

  curl_slist_free_all(slist); /* free the list again */
}

RETURN VALUE

Nothing.