Defines functions and structs for header management. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | CMimeHeader_T |
A email header item. More... | |
Macros | |
#define | cmime_header_get_name(header) (header->name) |
#define | cmime_header_get_count(header) ((int)header->count) |
Functions | |
CMimeHeader_T * | cmime_header_new (void) |
Creates a new CMimeHeader_T object. More... | |
void | cmime_header_free (CMimeHeader_T *header) |
Free a CMimeHeader_T object. More... | |
void | cmime_header_set_name (CMimeHeader_T *header, const char *name) |
Set a header name, if aleready exists, name will be overwritten. More... | |
void | cmime_header_set_value (CMimeHeader_T *header, const char *value, int overwrite) |
Set/append a header value. More... | |
char * | cmime_header_get_value (CMimeHeader_T *header, int pos) |
Return header value (at given position, if header appears more than once) More... | |
char * | cmime_header_to_string (CMimeHeader_T *header) |
Return full header as newly allocated string. More... | |
Defines functions and structs for header management.
#define cmime_header_get_count | ( | header | ) | ((int)header->count) |
#define cmime_header_get_name | ( | header | ) | (header->name) |
void cmime_header_free | ( | CMimeHeader_T * | header | ) |
Free a CMimeHeader_T object.
header | CMimeHeader_T pointer |
char* cmime_header_get_value | ( | CMimeHeader_T * | header, |
int | pos | ||
) |
Return header value (at given position, if header appears more than once)
header | CMimeHeader_T pointer |
pos | Position of appearance in email |
CMimeHeader_T* cmime_header_new | ( | void | ) |
Creates a new CMimeHeader_T object.
void cmime_header_set_name | ( | CMimeHeader_T * | header, |
const char * | name | ||
) |
Set a header name, if aleready exists, name will be overwritten.
header | CMimeHeader_T pointer |
name | name of header |
void cmime_header_set_value | ( | CMimeHeader_T * | header, |
const char * | value, | ||
int | overwrite | ||
) |
Set/append a header value.
header | CMimeHeader_T pointer |
value | header value |
overwrite | 1 will overwrite value, 0 append |
char* cmime_header_to_string | ( | CMimeHeader_T * | header | ) |
Return full header as newly allocated string.
header | a CMimeHeader_T object |