| Top |
GMimeMessagePartial * g_mime_message_partial_new (const char *id,int number,int total);
Creates a new MIME message/partial object.
The id
may be empty, but must be a non-NULL UTF-8 string.
const char *
g_mime_message_partial_get_id (GMimeMessagePartial *partial);
Gets the message/partial id parameter value.
the borrowed message/partial id, or NULL if absent.
The value is valid until the Content-Type or its parameters change.
[nullable]
int
g_mime_message_partial_get_number (GMimeMessagePartial *partial);
Gets the message/partial part number.
int
g_mime_message_partial_get_total (GMimeMessagePartial *partial);
Gets the total number of message/partial parts needed to reconstruct the original message.
GMimeMessage * g_mime_message_partial_join (GMimeParserOptions *options,GMimeMessage *message,GMimeMessagePartial **partials,size_t num,GError **error);
Reconstructs the GMimeMessage from the given message/partial parts
in partials
without changing their order in the caller's array.
Each fragment's content is decoded before concatenation; fragments
without content contribute no bytes. Only the last fragment is
required to specify the total number of parts. Parsed body content is
stored in memory rather than as substreams of the decoded readers.
Envelope headers are combined with those from message
using RFC 2046
rules. The source message and fragments are not changed.
Matching absent fragment ids are permitted.
options |
parser options, or |
[nullable] |
message |
the message containing the first numbered fragment |
|
partials |
an array of message/partial mime parts,
or |
[nullable][array length=num][element-type GMimeMessagePartial] |
num |
the number of elements in |
|
error |
return location for a GError. |
[nullable] |
GMimeMessage ** g_mime_message_partial_split (GMimeMessage *message,size_t max_size,size_t *nparts,GError **error);
Splits message
into an array of GMimeMessage objects each
containing a single GMimeMessagePartial object containing
max_size
bytes or fewer, preferring whole lines. A newline at the
target boundary is included in the preceding fragment, which can make
it one byte larger. nparts
is set to the number of messages returned.
If no splitting is needed, the returned array contains a reference to
the original message.
Each fragment message has a new Message-Id, distinct from the original
and from the id shared by the message/partial bodies. The original
headers are otherwise cloned without changing the source message.
The serialized fragment payload excludes envelope headers, including
unrecognized extension fields; join() restores them from the first
enclosing message.
an array of GMimeMessage objects and
sets nparts
to the number of messages returned or NULL on fail.
[nullable][transfer full][array length=nparts]