Defines the SMFPart_T data type and related functions.
More...
#include <cmime.h>
Go to the source code of this file.
|
SMFPart_T * | smf_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.
|
|
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()
#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
Frees a SMFPart_T object.
- Parameters
-
int smf_part_from_file |
( |
SMFPart_T ** |
part, |
|
|
char * |
filename, |
|
|
const char * |
nl |
|
) |
| |
Create a SMFPart_T object from file.
- Parameters
-
part | out param to return the new part |
filename | path to file |
nl | newline 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
-
part | out param to return the new mime part object |
content | mime 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
-
- Returns
- mime parts content disposition
char* smf_part_get_content_id |
( |
SMFPart_T * |
part | ) |
|
Return content id of mime part.
- Parameters
-
- 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
-
- Returns
- mime parts content transfer encoding
char* smf_part_get_content_type |
( |
SMFPart_T * |
part | ) |
|
Return content type of mime part.
- Parameters
-
- Returns
- mime parts content type
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
-
part | a SMFPart_T object |
s | mime part content |
void smf_part_set_content_disposition |
( |
SMFPart_T * |
part, |
|
|
const char * |
s |
|
) |
| |
Set content disposition for mime part.
- Parameters
-
part | a SMFPart_T object |
s | content disosition string |
void smf_part_set_content_id |
( |
SMFPart_T * |
part, |
|
|
const char * |
s |
|
) |
| |
Set content id for mime part.
- Parameters
-
part | a SMFPart_T object |
s | content id string |
void smf_part_set_content_transfer_encoding |
( |
SMFPart_T * |
part, |
|
|
const char * |
s |
|
) |
| |
Set content transfer encoding for mime part.
- Parameters
-
part | a SMFPart_T object |
s | content transfer encoding string |
void smf_part_set_content_type |
( |
SMFPart_T * |
part, |
|
|
const char * |
s |
|
) |
| |
Set the content type for a mime part.
- Parameters
-
part | a SMFPart_T object |
s | content type string |
void smf_part_set_postface |
( |
SMFPart_T * |
part, |
|
|
const char * |
s |
|
) |
| |
Set mime parts postface.
- Parameters
-
part | a SMFPart_T object |
s | postface string |
int smf_part_to_file |
( |
SMFPart_T * |
part, |
|
|
char * |
filename |
|
) |
| |
Create a file from SMFPart_T object.
- Parameters
-
part | SMFPart_T object |
filename | path 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
-
part | a SMFPart_T object |
nl | newline character which should be used. If NULL newline character will be determined automatically. |
- Returns
- a newly allocated string with complete mime part