Unverified Commit 2e4074c9 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

docs: curl_mime_*.3 man page formatting edits

parent d24c05b9
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -28,18 +28,16 @@ curl_mime_addpart - append a new empty part to a mime structure
.BI "curl_mimepart * curl_mime_addpart(curl_mime * " mime ");"
.ad
.SH DESCRIPTION
curl_mime_addpart() appends a new empty part to the given mime structure and
returns a handle to it.
The returned part can be subsequently filled using functions from the mime API.
\fIcurl_mime_addpart(3)\fP creates and appends a new empty part to the given
mime structure and returns a handle to it.  The returned part handle can
subsequently be populated using functions from the mime API.

\fImime\fP is the handle of the mime structure in which the new part must be
appended.

.SH AVAILABILITY
As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
.SH RETURN VALUE
A mime part structure handle, or NULL upon failure.

.SH "SEE ALSO"
.BR curl_mime_init "(3),"
.BR curl_mime_name "(3),"
+4 −4
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ curl_mime_data - set a mime part's body data from memory
.BI ", size_t " datasize ");"
.ad
.SH DESCRIPTION
curl_mime_data() sets a mime part's body content from memory data.
\fIcurl_mime_data(3)\fP sets a mime part's body content from memory data.

\fIdata\fP points to the data bytes: those are copied to the part and their
storage may safely be reused after call.
@@ -43,13 +43,13 @@ is retained. It is possible to unassign part's contents by setting
\fIdata\fP to NULL.

Setting very large data is memory consuming: one might consider using
\fIcurl_mime_data_cb\fP() in such a case.

\fIcurl_mime_data_cb(3)\fP in such a case.
.SH AVAILABILITY
As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
.SH RETURN VALUE
CURLE_OK or a CURL error code upon failure.

.SH "SEE ALSO"
.BR curl_mime_addpart "(3),"
.BR curl_mime_data_cb "(3)"
.BR curl_mime_name "(3)"
.BR curl_mime_type "(3)"
+15 −11
Original line number Diff line number Diff line
@@ -38,20 +38,24 @@ void freefunc(void *arg);
.BI "        curl_free_callback " freefunc ", void * " arg ");"
.ad
.SH DESCRIPTION
curl_mime_data_cb() sets the data source of a mime part's body content from
a data read callback function.
\fIcurl_mime_data_cb(3)\fP sets the data source of a mime part's body content
from a data read callback function.

\fIpart\fP is the part's to assign contents to.
\fIreadfunc\fP is a pointer to a data read callback function, with a
signature as shown by the above prototype. It may not be set to NULL.
\fIseekfunc\fP is a pointer to a seek callback function, with a
signature as shown by the above prototype. This function will be used upon
resending data (i.e.: after a redirect); this pointer may be set to NULL,
in which case a resend is not possible.

\fIreadfunc\fP is a pointer to a data read callback function, with a signature
as shown by the above prototype. It may not be set to NULL.

\fIseekfunc\fP is a pointer to a seek callback function, with a signature as
shown by the above prototype. This function will be used upon resending data
(i.e.: after a redirect); this pointer may be set to NULL, in which case a
resend is not possible.

\fIfreefunc\fP is a pointer to a user resource freeing callback function, with
a signature as shown by the above prototype. If no resource is to be freed,
it may safely be set to NULL. This function will be called upon mime
structure freeing.
a signature as shown by the above prototype. If no resource is to be freed, it
may safely be set to NULL. This function will be called upon mime structure
freeing.

\fIarg\fP is a user defined argument to callback functions.

The read callback function gets called by libcurl as soon as it needs to
+6 −5
Original line number Diff line number Diff line
@@ -29,17 +29,18 @@ curl_mime_filedata - set a mime part's body data from a file contents
.BI " const char * " filename ");"
.ad
.SH DESCRIPTION
curl_mime_filedata() sets a mime part's body content from the named file's
contents.
\fIcurl_mime_filedata(3)\fP sets a mime part's body content from the named
file's contents.

\fIpart\fP is the part's to assign contents to.

\fIfilename\fP points to the nul-terminated file's path name. The pointer can
be NULL to detach previous part contents settings.
Filename storage can be safely be reused after this call.
be NULL to detach previous part contents settings.  Filename storage can be
safely be reused after this call.

As a side effect, the part's remote file name is set to the base name of the
given \fIfilename\fP if it is a valid named file. This can be undone or
overriden by a subsequent call to \fIcurl_mime_filename\fP().
overriden by a subsequent call to \fIcurl_mime_filename(3)\fP.

Setting a part's contents twice is valid: only the value set by the last call
is retained.
+6 −7
Original line number Diff line number Diff line
@@ -29,10 +29,10 @@ curl_mime_filename - set a mime part's remote file name
.BI "const char * " filename ");"
.ad
.SH DESCRIPTION
curl_mime_filename() sets a mime part's remote file name. When remote file
name is set, content data is processed as a file, whatever is the part's
content source. A part's remote file name is transmitted to the server in
the associated Content-Disposition generated header.
\fIcurl_mime_filename(3)\fP sets a mime part's remote file name. When remote
file name is set, content data is processed as a file, whatever is the part's
content source. A part's remote file name is transmitted to the server in the
associated Content-Disposition generated header.

\fIpart\fP is the part's handle to assign the remote file name to.
\fIfilename\fP points to the nul-terminated file name string; it may be set to
@@ -41,11 +41,10 @@ NULL to remove a previously attached remote file name.
The remote file name string is copied into the part, thus the associated
storage may safely be released or reused after call. Setting a part's file
name twice is valid: only the value set by the last call is retained.

.SH AVAILABILITY
As long as at least one of HTTP, SMTP or IMAP is enabled. Added in 7.56.0.
.SH RETURN VALUE
CURLE_OK or a CURL error code upon failure.

.SH "SEE ALSO"
.BR curl_mime_addpart "(3) "
.BR curl_mime_filedata "(3) "
Loading