| Top |
| GMimeStream * | (*GMimeTnefTemporaryStreamFactory) () |
| GMimeTnefWriter * | g_mime_tnef_writer_new () |
| int | g_mime_tnef_writer_get_codepage () |
| guint16 | g_mime_tnef_writer_get_legacy_key () |
| void | g_mime_tnef_writer_set_temporary_stream_factory () |
| gboolean | g_mime_tnef_writer_write_attribute_int32 () |
| gboolean | g_mime_tnef_writer_write_attribute_string () |
| gboolean | g_mime_tnef_writer_write_attribute_date_time () |
| gboolean | g_mime_tnef_writer_write_attribute_bytes () |
| GMimeStream * | g_mime_tnef_writer_open_attribute_stream () |
| GMimeTnefPropertyWriter * | g_mime_tnef_writer_open_property_writer () |
| gboolean | g_mime_tnef_writer_flush () |
| gboolean | g_mime_tnef_writer_close () |
Writers generate the signature, version, codepage, lengths and checksums. Message attributes precede attachments. MapiProperties ends the message attributes; AttachRenderData starts each attachment and Attachment ends its attributes. Do not write automatically generated header attributes.
Use g_mime_tnef_writer_open_property_writer() to obtain a
GMimeTnefPropertyWriter. Property lists and streamed values use seekable temporary storage, allowing
the final output to be forward-only. A custom factory can use files instead
of the default block-backed memory. Embedded writers inherit the factory.
Close value streams, embedded writers and property writers before continuing
their parent. Finally call g_mime_tnef_writer_close() and check its result.
Finalizers never complete output: abandoning an unfinished child poisons its
parent instead of silently publishing an incomplete attribute. The root
output stream remains open and owned by its caller.
GMimeStream * (*GMimeTnefTemporaryStreamFactory) (gpointer user_data,GError **error);
Creates a new, empty, readable/writable, seekable stream at position zero. The writer owns it. Embedded writers inherit the configured factory.
GMimeTnefWriter * g_mime_tnef_writer_new (GMimeStream *stream,int codepage,guint16 legacy_key,GError **error);
Creates a writer without writing any output. The stream is referenced,
not closed. Unsupported codepages and UTF-16/UTF-32 are rejected.
Call g_mime_tnef_writer_close() to complete output before unref.
int
g_mime_tnef_writer_get_codepage (GMimeTnefWriter *writer);
Gets the output codepage.
guint16
g_mime_tnef_writer_get_legacy_key (GMimeTnefWriter *writer);
Gets the legacy key.
void g_mime_tnef_writer_set_temporary_stream_factory (GMimeTnefWriter *writer,GMimeTnefTemporaryStreamFactory factory,gpointer user_data,GDestroyNotify destroy);
Configures temporary attribute storage. NULL restores block-backed
memory streams. Each embedded writer retains the factory current when
it is created, including ownership of the callback data.
gboolean g_mime_tnef_writer_write_attribute_int32 (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,gint32 value,GError **error);
Writes a Short, Word, Long or DWord attribute, checking 16-bit ranges.
gboolean g_mime_tnef_writer_write_attribute_string (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,const char *value,GError **error);
Writes a nul-terminated String, Text or message-class attribute using the selected codepage. Message classes require 1 to 254 printable ASCII characters.
gboolean g_mime_tnef_writer_write_attribute_date_time (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,GDateTime *value,GError **error);
Writes the seven legacy date fields, without converting their timezone.
gboolean g_mime_tnef_writer_write_attribute_bytes (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,const guint8 *buffer,gsize length,GError **error);
Writes an attribute's raw value, generating its level, length and checksum.
GMimeStream * g_mime_tnef_writer_open_attribute_stream (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,GError **error);
Opens a write-only raw attribute stream backed by temporary storage. Explicitly close it before the next writer operation. Closing queues the completed attribute; the next operation writes its length and checksum.
GMimeTnefPropertyWriter * g_mime_tnef_writer_open_property_writer (GMimeTnefWriter *writer,GMimeTnefAttributeTag tag,GError **error);
Opens a property-list or recipient-table writer backed by temporary storage. Explicitly close it before advancing the attribute writer.
gboolean g_mime_tnef_writer_flush (GMimeTnefWriter *writer,GError **error);
Writes the stream header and completed buffered attributes, then flushes the underlying stream. All child writers and streams must be closed first.
gboolean g_mime_tnef_writer_close (GMimeTnefWriter *writer,GError **error);
Completes output and flushes it. Does not close the caller's output stream. For an embedded writer, also completes the enclosing property value. Repeated successful closes are harmless; errors remain latched.
typedef struct _GMimeTnefWriter GMimeTnefWriter;
A forward-only TNEF writer. The header, version, codepage, attribute lengths and checksums are generated automatically. Message attributes precede attachments; MapiProperties and Attachment finish their respective property lists. Explicitly close child streams/property writers and then the writer to report completion errors. Finalization performs no I/O.