smf_header.h File Reference

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

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

Go to the source code of this file.

Typedefs

typedef CMimeHeader_T SMFHeader_T
 Represents a message header.
 

Functions

SMFHeader_Tsmf_header_new (void)
 Creates a new SMFHeader_T object.
 
void smf_header_free (SMFHeader_T *header)
 Free a SMFHeader_T object.
 
void smf_header_set_name (SMFHeader_T *header, const char *name)
 Set a header name, if aleready exists, name will be overwritten.
 
char * smf_header_get_name (SMFHeader_T *header)
 Return header name.
 
void smf_header_set_value (SMFHeader_T *header, const char *value, int overwrite)
 Set/append a header value.
 
char * smf_header_get_value (SMFHeader_T *header, int pos)
 Return header value (at given position, if header appears more than once)
 
int smf_header_get_count (SMFHeader_T *header)
 Get header value count.
 
char * smf_header_to_string (SMFHeader_T *header)
 Return full header as newly allocated string.
 

Detailed Description

Defines the SMFHeader_T data type and related functions.

SMFHeader_T represents an email header.

To create a new SMFHeader_T, use smf_header_new()

To destroy a SMFHeader_T use smf_header_free()

Function Documentation

void smf_header_free ( SMFHeader_T header)

Free a SMFHeader_T object.

Parameters
headerSMFHeader_T pointer
int smf_header_get_count ( SMFHeader_T header)

Get header value count.

Parameters
headerSMFHeader_T object
Returns
header value count
char* smf_header_get_name ( SMFHeader_T header)

Return header name.

Parameters
headerSMFHeader_T object
Returns
header name
char* smf_header_get_value ( SMFHeader_T header,
int  pos 
)

Return header value (at given position, if header appears more than once)

Parameters
headerSMFHeader_T pointer
posPosition of appearance in email
Returns
header value
SMFHeader_T* smf_header_new ( void  )

Creates a new SMFHeader_T object.

Returns
SMFHeader_T pointer, or NULL on failure
void smf_header_set_name ( SMFHeader_T header,
const char *  name 
)

Set a header name, if aleready exists, name will be overwritten.

Parameters
headerSMFHeader_T pointer
namename of header
void smf_header_set_value ( SMFHeader_T header,
const char *  value,
int  overwrite 
)

Set/append a header value.

Parameters
headerSMFHeader_T pointer
valueheader value
overwrite1 will overwrite value, 0 append
char* smf_header_to_string ( SMFHeader_T header)

Return full header as newly allocated string.

Parameters
headera SMFHeader_T object
Returns
full header as newly allocated string