Table of Contents | Previous | Next | Index

Messaging Access SDK Guide
Part 2. Messaging Access SDK C Reference


MIME Structures

This section defines MIME data structures, listed in alphabetical order.

file_mime_type
mime_messagePart_t 
mime_basicPart_t 
mime_multiPart_t 
mime_header_t 
mime_outputstream_t 
mime_inputstream_t 
mimeDataSink_t 
mime_message_t 

All MIME definitions are found in the mime.h and mimeparser.h files. The source file for each structure is noted in its reference entry.

[Top]

file_mime_type

Represents the file MIME type.

Syntax

#include <mime.h> 
typedef struct file_mime_type
{
   mime_content_type content_type;
   char * content_subtype;
   char * content_params;
   mime_encoding_type mime_encoding;
} file_mime_type;

Fields

The structure has the following fields:
content_type

Content description.

content_subtype

Pointer to content subtypes. For information, see MIME Content Types.

content_params

Pointer to content parameters.

mime_encoding

Encoding type. For values, see MIME Encoding Types.

Description

This structure contains MIME Content Type and MIME Encoding information, and is used only by the getFileMIMEType function.

See Also

getFileMIMEType
[Top] [MIME Structures]

mime_basicPart_t

Common structure for leaf parts: text, audio, video, image and application.

Syntax

#include <mime.h> 
typedef struct mime_basicPart
{
/* Common to all parts */
char * content_description;
mime_disp_type content_disposition;
char * content_disp_params;
/* content disposition parameters */

mime_content_type content_type;
char * content_subtype;
char * content_type_params;
char * contentID;
mime_header_t * extra_headers;
/* additional X- and Content-headers */
 /* Specific to basic part */
char * contentMD5;
mime_encoding_type encoding_type;
 /* Data that client cannot directly manipulate */ 
void * pInternal;
} mime_basicPart_t;

Fields

The structure has the following fields:
content_description

Pointer to content description.

content_disposition

Pointer to content disposition. For values, see MIME Disposition Types.

content_disp_params

Pointer to content disposition parameters.

content_type

Pointer to content types. For values, see MIME Content Types.

content_subtype

Pointer to content subtypes. For information, see MIME Content Types.

content_type_params

Pointer to content type parameters.

contentID

Pointer to content ID type.

extra_headers

Additional X- and Content-headers.

contentMD5

Pointer to content MD5.

encoding_type

Pointer to encoding type. For values, see MIME Encoding Types

pInternal

Pointer to data that the client cannot directly manipulate.

Description

This structure represents the MIME basic part, which can be of text, audio, video, image, and application content types.

For more information, see Structure of a MIME Message and Adding Content to the Message. For functions that manipulate this structure, see Basic (Leaf) Body Part Functions.

See Also

mime_multiPart_t, mime_messagePart_t, mime_message_t
[Top] [MIME Structures]

mime_header_t

Represents the MIME message header.

Syntax

#include <mime.h> 
typedef struct mime_header
{
   char * name;
   char * value;
   struct mime_header * next;
} mime_header_t;

Fields

The structure has the following fields:
name

Pointer to field name of the header name:value pair.

value

Pointer to field body of the header name:value pair.

next

Pointer to next header, if present.

Description

This structure represents the RFC 822-compliant MIME message header. It consists of lines that describe the sender, subject, recipient, date, version of MIME in use, and a variety of other information, depending on the implementation in use.

For more information, see Structure of a MIME Message and Adding Message Headers.

See Also

mime_basicPart_t, mime_multiPart_t, mime_messagePart_t, mime_message_t
[Top] [MIME Structures]

mime_inputstream_t

Represents the MIME input stream.

Syntax

#include <mime.h> 
typedef struct nsmail_inputstream mime_inputstream_t;

See Also

nsmail_inputstream_t, mime_outputstream_t
[Top] [MIME Structures]

mime_message_t

Represents the MIME message.

Syntax

#include <mime.h> 
typedef struct mime_message
{
   mime_header_t * rfc822_headers;
   /* Data that client cannot directly manipulate */ 
   void * pInternal;
} mime_message_t;

Fields

The structure has the following fields:
rfc822_headers

Pointer to message headers that conform to RFC 822 requirements.

pInternal

Pointer to data that the client cannot directly manipulate.

Description

This structure represents an RFC 822-compliant MIME message.

For more information, see Structure of a MIME Message and Building the MIME Message. For functions that manipulate this structure, see Message Functions.

See Also

mime_header_t, mime_basicPart_t, mime_multiPart_t, mime_messagePart_t
[Top] [MIME Structures]

mime_messagePart_t

Represents the MIME message part.

Syntax

#include <mime.h> 
typedef struct mime_messagePart
{
   /* Common to all parts */
   char * content_description;
   mime_disp_type content_disposition;
   char * content_disp_params;
/* content disposition parameters */ 
   mime_content_type content_type;
   char * content_subtype;
   char * content_type_params;
   char * contentID;
   mime_header_t * extra_headers;
   /* Additional X- and Content-headers */
   /* Data that client cannot directly manipulate */ 
   void * pInternal;
} mime_messagePart_t;

Fields

The structure has the following fields:
content_description

Pointer to content description.

content_disposition

Content disposition. For values, see MIME Disposition Types.

content_disp_params

Pointer to content disposition parameters. For values, see MIME Disposition Types.

content_type

Content types. For values, see MIME Content Types.

content_subtype

Pointer to content subtypes.

content_type_params

Pointer to content type parameters.

contentID

Pointer to content ID.

extra_headers

Pointer to additional X- and Content-headers.

pInternal

Pointer to data that the client cannot directly manipulate.

Description

This structure represents the MIME message part.

For more information, see Structure of a MIME Message and Building the MIME Message. For functions that manipulate this structure, see Message Part Functions.

See Also

mime_basicPart_t, mime_multiPart_t
[Top] [MIME Structures]

mime_multiPart_t

Represents the MIME multipart content type.

Syntax

#include <mime.h> 
typedef struct mime_multiPart
{
   /* Common to all parts */
   char * content_description;
   mime_disp_type content_disposition;
   char * content_disp_params;
         /* content disposition parameters */
   mime_content_type content_type;
   char * content_subtype;
   char * content_type_params;
   char * contentID;
   mime_header_t * extra_headers;
   /* Additional X- and Content-headers */
   /* Data that client cannot directly manipulate */
   void * pInternal;
} mime_multiPart_t;

Fields

The structure has the following fields:
content_description

Pointer to content description.

content_disposition

Pointer to content disposition. For values, see MIME Disposition Types.

content_disp_params

Pointer to content disposition parameters.

content_type

Pointer to content types. For values, see MIME Content Types.

content_subtype

Pointer to content subtypes.

content_type_params

Pointer to content type parameters.

contentID

Pointer to content ID.

extra_headers

Pointer to additional X- and Content-headers.

pInternal

Pointer to data that the client cannot directly manipulate.

Description

This structure represents the MIME Multipart content type, which is made up of one or more sub-body parts. The Multipart type has several subtypes that describe how the sub-parts relate to each other, including: mixed, alternative, digest, and parallel.

For more information, see Structure of a MIME Message and Building the MIME Message. For functions that manipulate this structure, see Multipart Functions.

See Also

mime_basicPart_t, mime_messagePart_t
[Top] [MIME Structures]

mime_outputstream_t

Represents the MIME output stream.

Syntax

#include <mime.h> 
typedef struct nsmail_outputstream mime_outputstream_t;

See Also

nsmail_outputstream_t, mime_inputstream_t
[Top] [MIME Structures]

mimeDataSink_t

Represents the MIME data sink used for MIME parsing.

Syntax

#include <mimeparser.h> 
typedef struct mimeDataSink
{
   void (*header)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char *name, char *value ); /* mime headers */
   void (*contentType)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         int nContentType ); /* content type */
   void (*contentSubType)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char * contentSubType ); /* content sub type */
   void (*contentTypeParams) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char * contentTypeParams );
         /* content type extra parameters */
   void (*contentID)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char * contentID ); /* content ID */
   void (*contentMD5)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char * contentMD5 ); /* content MD5 */
   void (*contentDisposition) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         int nContentDisposition ); /* content disposition */
   void (*contentDispParams)(mimeDataSinkPtr_t pSink,
         void *pCallbackObject, char * contentDispParams ); /* content disposition parameters */
   void (*contentDescription) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char * contentDescription ); /* content description */
   void (*contentEncoding) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         int nContentEncoding );/* content encoding */
   void *(*startMessageLocalStorage) ( mimeDataSinkPtr_t pSink,
         struct mime_message *m );
         /* signal start of message, local storage version */
   void *(*startMessage)(mimeDataSinkPtr_t pSink);
         /* signal start of message */
   void (*endMessage) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject );
         /* signal end of message */
   void *(*startBasicPartLocalStorage)(
         mimeDataSinkPtr_t pSink,         
         struct mime_basicPart *m );
         /* signal start of basic part, local storage version */
   void *(*startBasicPart)(mimeDataSinkPtr_t pSink);
         /* signal start of basic part */
   void (*bodyData) ( mimeDataSinkPtr_t pSink,
         void *pCallbackObject,
         char bodyData[], int len ); /* message data */
   void (*endBasicPart)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject );
         /* signal end of basic part */
   void *(*startMultiPartLocalStorage)(
         mimeDataSinkPtr_t pSink, struct mime_multiPart *m );
         /* signal start of multipart, local storage version */
   void *(*startMultiPart)(mimeDataSinkPtr_t pSink);
         /* signal start of multipart */
   void (*boundary)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject, char * boundary );
   void (*endMultiPart)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject );
         /* signal end of multipart */
   void *(*startMessagePartLocalStorage)(
         mimeDataSinkPtr_t pSink,
         struct mime_messagePart *m );
         /* signal start of message part, local storage version */
   void *(*startMessagePart)(mimeDataSinkPtr_t pSink);
         /* signal start of message part */
   void (*endMessagePart)( mimeDataSinkPtr_t pSink,
         void *pCallbackObject );
         /* signal end of message part */
   } mimeDataSink_t;

Fields

The structure has the following fields:
void (*header)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char *name,
   char *value );

MIME headers. Parameters: Identifier of the data sink, identifier of the callback object, name and value portions of header's name:value pair.

void (*contentType)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   int nContentType );

Content type. Parameters: Identifier of the data sink, identifier of the callback object, content type of the body part.

void (*contentSubType)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentSubType );

Content sub type. Parameters: Identifier of the data sink, identifier of the callback object, content subtype of the body part.

void (*contentTypeParams)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentTypeParams );

Content type extra parameters. Parameters: Identifier of the data sink, identifier of the callback object, content type parameters.

void (*contentID)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentID );

Content ID. Parameters: Identifier of the data sink, identifier of the callback object, content identifier.

void (*contentMD5)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentMD5 );

Content MD5. Parameters: Identifier of the data sink, identifier of the callback object, contentMD5 of the body part.

void (*contentDisposition)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   int nContentDisposition );

Content disposition. Parameters: Identifier of the data sink, identifier of the callback object, content disposition.

void (*contentDispParams)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentDispParams );

Content disposition parameters. Parameters: Identifier of the data sink, identifier of the callback object, content disposition params.

void (*contentDescription)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * contentDescription );

Content description. Parameters: Identifier of the data sink, identifier of the callback object, content description of the body part.

void (*contentEncoding)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   int nContentEncoding );

Content encoding. Parameters: Identifier of the data sink, identifier of the callback object, encoding type for the message content.

void *(*startMessageLocalStorage)(
   mimeDataSinkPtr_t pSink,
   struct mime_message *m );

Signals start of message, local storage version. Parameters: Identifier of the data sink, MIME message that is starting.

void *(*startMessage)(
   mimeDataSinkPtr_t pSink);

Signals start of message. Parameter: Identifier of the data sink.

void (*endMessage)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject );

Signals end of message. Parameters: Identifier of the data sink, identifier of the callback object

void *(
*startBasicPartLocalStorage)(
   mimeDataSinkPtr_t pSink,
   struct mime_basicPart *m );

Signals start of basic part, local storage version. Parameters: Identifier of the data sink, MIME basic part to store.

void *(*startBasicPart)(
   mimeDataSinkPtr_t pSink,);

Signals start of basic part. Parameter: Identifier of the data sink.

void (*bodyData)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char bodyData[],
   int len );

Message data. Parameters: Identifier of the data sink, identifier of the callback object, message part data, length of the data.

void (*endBasicPart)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject );

Signals end of basic part. Parameters: Identifier of the data sink, identifier of the callback object.

void *(*startMultiPartLocalStorage)(
   mimeDataSinkPtr_t pSink,
   struct mime_multiPart *m );

Signals start of multipart, local storage version. Parameters: Identifier of the data sink, MIME multipart to store.

void *(*startMultiPart)(
   mimeDataSinkPtr_t pSink);

Signals start of multipart. Parameter: Identifier of the data sink.

void (*boundary)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject,
   char * boundary );

Generates and returns a boundary string for use in multiparts and for other uses as required. Parameters: Identifier of the data sink, identifier of the callback object, the boundary string.

void (*endMultiPart)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject );

Signals end of multipart. Parameters: Identifier of the data sink, identifier of the callback object.

void *(
*startMessagePartLocalStorage)(
   mimeDataSinkPtr_t pSink,
   struct mime_messagePart *m );

Signals start of message part, local storage
   version. Parameters: Identifier of the data sink, MIME message part to store.

void *(*startMessagePart)(
   mimeDataSinkPtr_t pSink);

Signals start of message part. Parameter: Identifier of the data sink.

void (*endMessagePart)(
   mimeDataSinkPtr_t pSink,
   void *pCallbackObject );

Signals end of message part. Parameters: Identifier of the data sink, identifier of the callback object.

Description

The MIME data sink structure is made up of function pointers and opaque data. You must define the functions yourself, and you must point these pointers to your functions. For more information, see SDK Response Sinks for C and Creating a Data Sink.

The function pointers serve as callbacks for many MIME functions. See MIME Data Sink Callbacks.

See Also

mimeDynamicParser_new
[Top] [mimeDataSink_t] [MIME Structures]

MIME Definitions

These definitions are shared by MIME API functions.

All error code definitions are found in mime.h.

[Top]

MIME Error Codes

All MIME error code definitions are found in mime.h

Error Code Value Description
MIME_OK 

0

Successful completion of function.

MIME_ERR_UNINITIALIZED

-1

Uninitialized parameter.

MIME_ERR_INVALIDPARAM

-2

Invalid parameters.

MIME_ERR_OUTOFMEMORY

-3

Out of memory.

MIME_ERR_UNEXPECTED

-4

Unexpected element.

MIME_ERR_IO

-5

Error in input/output operation.

MIME_ERR_IO_READ

-6

Error in reading input stream.

MIME_ERR_IO_WRITE 

-7

Error in writing to output stream.

MIME_ERR_IO_SOCKET

-8

Socket connection error.

MIME_ERR_IO_SELECT

-9

Error in selecting message.

MIME_ERR_IO_CONNECT

-10

Error in connecting.

MIME_ERR_IO_CLOSE

-11

Error in closing.

MIME_ERR_PARSE

-12

Internal parsing error occurred.

MIME_ERR_TIMEOUT

-13

Timeout occurred. Recoverable error. Wait and call processResponses later.

MIME_ERR_INVALID_INDEX

-14

Invalid index.

MIME_ERR_CANTOPENFILE 

-15

Cannot open file.

MIME_ERR_CANT_SET

-16

Cannot set MIME text.

MIME_ERR_ALREADY_SET

-17

Item already set.

MIME_ERR_CANT_DELETE

-18

Cannot delete item.

MIME_ERR_CANT_ADD 

-19

Cannot add item.

MIME_ERR_EOF

-1

End of file reached.

MIME_ERR_EMPTY_DATASINK

-83

Data sink missing.

MIME_ERR_ENCODE 

-84

Encoding error.

MIME_ERR_NO_SUCH_HEADER

-85

Header type does not exist.

MIME_ERR_NO_HEADERS 

-86

Header missing.

MIME_ERR_NOT_SET 

-87

Item not set.

MIME_ERR_NO_BODY 

-88

Message body missing.

MIME_ERR_NOT_FOUND 

-89

Cannot find search item.

MIME_ERR_NO_CONTENT_SUBTYPE 

-90

Content subtype missing.

MIME_ERR_INVALID_ENCODING 

-91

Invalid encoding type.

MIME_ERR_INVALID_BASICPART 

-92

Invalid basic message part.

MIME_ERR_INVALID_MULTIPART 

-93

Invalid multipart.

MIME_ERR_INVALID_MESSAGEPART 

-94

Invalid message part.

MIME_ERR_INVALID_MESSAGE 

-95

Invalid message.

MIME_ERR_INVALID_CONTENTTYPE

-96

Invalid content type.

MIME_ERR_INVALID_CONTENTID 

-97

Invalid content identifier.

MIME_ERR_NO_DATA

-98

Data missing.

MIME_ERR_NOTIMPL

-99

Function or feature not implemented.

[Top] [MIME Definitions]

MIME Type Definitions

All C interface definitions are found in mime.h and mimeparser.h.

[Top] [MIME Definitions]

MIME Encoding Types

MIME Encoding Type definitions are found in mime.h._

MIME Encoding Type Description
MIME_ENCODING_BASE64

Base 64 encoding.

MIME_ENCODING_QP

Quoted Printable encoding.

MIME_ENCODING_Q

Quoted encoding.

MIME_ENCODING_7BIT

7 bit data with NO transfer encoding.

MIME_ENCODING_8BIT

8 bit data with NO transfer encoding.

MIME_ENCODING_BINARY

Binary data with NO transfer encoding.

[Top] [MIME Definitions] [MIME Type Definitions]

MIME Disposition Types

MIME Disposition Type definitions are found in mime.h.

MIME Display Type Description
MIME_DISPOSITION_UNINITIALIZED = 0

Setting not in use.

MIME_DISPOSITION_INLINE = 1

Display attachment in-line within message.

MIME_DISPOSITION_ATTACHMENT 

Access attachment from icon.

[Top] [MIME Definitions] [MIME Type Definitions]

MIME Content Types

MIME Content Type definitions are found in mime.h.

MIME Content Type Values Description
MIME_CONTENT_TEXT

1

Text content.

MIME_CONTENT_AUDIO

2

Audio content.

MIME_CONTENT_IMAGE

3

Image content.

MIME_CONTENT_VIDEO

4

Video content.

MIME_CONTENT_APPLICATION

4

Application content.

MIME_CONTENT_MULTIPART

5

Multipart content.

MIME_CONTENT_MESSAGEPART

6

Message content.

[Top] [MIME Definitions] [MIME Type Definitions]

MIME Buffer Size

MIME Buffer Size definitions are found in mime.h.

Buffer Definition Value Description
MIME_BUFSIZE 

1024

Default buffer size for MIME.

[Top] [MIME Definitions]


Table of Contents | Previous | Next | Index

Last Updated: June 3, 1998

Copyright © 1998 Netscape Communications Corporation