smf_part.h File Reference

Defines the SMFPart_T data type and related functions. More...

#include <cmime.h>
Include dependency graph for smf_part.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define smf_part_get_content(part)   (part->content);
 
#define smf_part_get_postface(part)   (part->postface);
 

Typedefs

typedef CMimePart_T SMFPart_T
 A Mime part.
 

Functions

SMFPart_Tsmf_part_new (void)
 Creates a new SMFPart_T object.
 
void smf_part_free (SMFPart_T *part)
 Frees a SMFPart_T object.
 
void smf_part_set_content_type (SMFPart_T *part, const char *s)
 Set the content type for a mime part.
 
char * smf_part_get_content_type (SMFPart_T *part)
 Return content type of mime part.
 
void smf_part_set_content_disposition (SMFPart_T *part, const char *s)
 Set content disposition for mime part.
 
char * smf_part_get_content_disposition (SMFPart_T *part)
 Return content disposition of mime part.
 
void smf_part_set_content_transfer_encoding (SMFPart_T *part, const char *s)
 Set content transfer encoding for mime part.
 
char * smf_part_get_content_transfer_encoding (SMFPart_T *part)
 Return content transfer encoding of mime part.
 
void smf_part_set_content_id (SMFPart_T *part, const char *s)
 Set content id for mime part.
 
char * smf_part_get_content_id (SMFPart_T *part)
 Return content id of mime part.
 
void smf_part_set_content (SMFPart_T *part, const char *s)
 Set content for mime part.
 
void smf_part_set_postface (SMFPart_T *part, const char *s)
 Set mime parts postface.
 
char * smf_part_to_string (SMFPart_T *part, const char *nl)
 Return complete mime part as string, inclusive all mime headers.
 
int smf_part_from_file (SMFPart_T **part, char *filename, const char *nl)
 Create a SMFPart_T object from file.
 
int smf_part_to_file (SMFPart_T *part, char *filename)
 Create a file from SMFPart_T object.
 
int smf_part_from_string (SMFPart_T **part, const char *content)
 Parse given string and create a new SMFPart_T object.
 

Detailed Description

Defines the SMFPart_T data type and related functions.

SMFPart_T represents an Mime part.

To create a new SMFPart_T, use smf_part_new()

To destroy a SMFPart_T use smf_part_free()

Macro Definition Documentation

#define smf_part_get_content (   part)    (part->content);
Returns
content of mime part
#define smf_part_get_postface (   part)    (part->postface);
Returns
postface of mime part

Function Documentation

void smf_part_free ( SMFPart_T part)

Frees a SMFPart_T object.

Parameters
parta CMimePart_T object
int smf_part_from_file ( SMFPart_T **  part,
char *  filename,
const char *  nl 
)

Create a SMFPart_T object from file.

Parameters
partout param to return the new part
filenamepath to file
nlnewline character which should be used. If NULL newline character will be determined automatically.
Returns
0 on success, -1 on stat error, -2 if not a regular file
int smf_part_from_string ( SMFPart_T **  part,
const char *  content 
)

Parse given string and create a new SMFPart_T object.

Parameters
partout param to return the new mime part object
contentmime part string to parse
Returns
0 on success or -1 in case of error
char* smf_part_get_content_disposition ( SMFPart_T part)

Return content disposition of mime part.

Parameters
parta SMFPart_T object
Returns
mime parts content disposition
char* smf_part_get_content_id ( SMFPart_T part)

Return content id of mime part.

Parameters
parta SMFPart_T object
Returns
newly allocated char pointer with content id of mime part
char* smf_part_get_content_transfer_encoding ( SMFPart_T part)

Return content transfer encoding of mime part.

Parameters
parta SMFPart_T object
Returns
mime parts content transfer encoding
char* smf_part_get_content_type ( SMFPart_T part)

Return content type of mime part.

Parameters
parta SMFPart_T object
Returns
mime parts content type
SMFPart_T* smf_part_new ( void  )

Creates a new SMFPart_T object.

Returns
SMFPart_T pointer, or NULL on failure
void smf_part_set_content ( SMFPart_T part,
const char *  s 
)

Set content for mime part.

Parameters
parta SMFPart_T object
smime part content
void smf_part_set_content_disposition ( SMFPart_T part,
const char *  s 
)

Set content disposition for mime part.

Parameters
parta SMFPart_T object
scontent disosition string
void smf_part_set_content_id ( SMFPart_T part,
const char *  s 
)

Set content id for mime part.

Parameters
parta SMFPart_T object
scontent id string
void smf_part_set_content_transfer_encoding ( SMFPart_T part,
const char *  s 
)

Set content transfer encoding for mime part.

Parameters
parta SMFPart_T object
scontent transfer encoding string
void smf_part_set_content_type ( SMFPart_T part,
const char *  s 
)

Set the content type for a mime part.

Parameters
parta SMFPart_T object
scontent type string
void smf_part_set_postface ( SMFPart_T part,
const char *  s 
)

Set mime parts postface.

Parameters
parta SMFPart_T object
spostface string
int smf_part_to_file ( SMFPart_T part,
char *  filename 
)

Create a file from SMFPart_T object.

Parameters
partSMFPart_T object
filenamepath to out file
Returns
0 on success, -1 on error
char* smf_part_to_string ( SMFPart_T part,
const char *  nl 
)

Return complete mime part as string, inclusive all mime headers.

Parameters
parta SMFPart_T object
nlnewline character which should be used. If NULL newline character will be determined automatically.
Returns
a newly allocated string with complete mime part