curl_mime_addpart.3 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 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 https://curl.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. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH curl_mime_addpart 3 "22 August 2017" "libcurl" "libcurl"
  25. .SH NAME
  26. curl_mime_addpart - append a new empty part to a mime structure
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. curl_mimepart *curl_mime_addpart(curl_mime *mime);
  31. .fi
  32. .SH DESCRIPTION
  33. \fIcurl_mime_addpart(3)\fP creates and appends a new empty part to the given
  34. mime structure and returns a handle to it. The returned part handle can
  35. subsequently be populated using functions from the mime API.
  36. \fImime\fP is the handle of the mime structure in which the new part must be
  37. appended.
  38. .SH EXAMPLE
  39. .nf
  40. curl_mime *mime;
  41. curl_mimepart *part;
  42. /* create a mime handle */
  43. mime = curl_mime_init(easy);
  44. /* add a part */
  45. part = curl_mime_addpart(mime);
  46. /* continue and set name + data to the part */
  47. curl_mime_data(part, "This is the field data", CURL_ZERO_TERMINATED);
  48. curl_mime_name(part, "data");
  49. .fi
  50. .SH AVAILABILITY
  51. As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
  52. .SH RETURN VALUE
  53. A mime part structure handle, or NULL upon failure.
  54. .SH "SEE ALSO"
  55. .BR curl_mime_init "(3),"
  56. .BR curl_mime_name "(3),"
  57. .BR curl_mime_data "(3),"
  58. .BR curl_mime_data_cb "(3),"
  59. .BR curl_mime_filedata "(3),"
  60. .BR curl_mime_filename "(3),"
  61. .BR curl_mime_subparts "(3),"
  62. .BR curl_mime_type "(3),"
  63. .BR curl_mime_headers "(3),"
  64. .BR curl_mime_encoder "(3)"