curl_mime_addpart.3 2.4 KB

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