curl_slist_append.3 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  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 http://curl.haxx.se/docs/copyright.html.
  13. .\" *
  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.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .TH curl_slist_append 3 "19 Jun 2003" "libcurl 7.10.4" "libcurl Manual"
  23. .SH NAME
  24. curl_slist_append - add a string to an slist
  25. .SH SYNOPSIS
  26. .B #include <curl/curl.h>
  27. .sp
  28. .BI "struct curl_slist *curl_slist_append(struct curl_slist *" list,
  29. .BI "const char * "string ");"
  30. .ad
  31. .SH DESCRIPTION
  32. curl_slist_append() appends a specified string to a linked list of
  33. strings. The existing \fIlist\fP should be passed as the first argument while
  34. the new list is returned from this function. The specified \fIstring\fP has
  35. been appended when this function returns. curl_slist_append() copies the
  36. string.
  37. The list should be freed again (after usage) with
  38. \fBcurl_slist_free_all(3)\fP.
  39. .SH RETURN VALUE
  40. A null pointer is returned if anything went wrong, otherwise the new list
  41. pointer is returned.
  42. .SH EXAMPLE
  43. .nf
  44. CURL handle;
  45. struct curl_slist *slist=NULL;
  46. slist = curl_slist_append(slist, "pragma:");
  47. curl_easy_setopt(handle, CURLOPT_HTTPHEADER, slist);
  48. curl_easy_perform(handle);
  49. curl_slist_free_all(slist); /* free the list again */
  50. .fi
  51. .SH "SEE ALSO"
  52. .BR curl_slist_free_all "(3), "