Functions for manipulating MIME parameters | |
MIME parameters are properties attached to certain MIME headers, such as Content-Type and Content-Disposition. MIME parameters have a textual representations as in name=value. They contain important information about the MIME structure of a message, such as the boundary string used, which charset was used to encode the message and so on. This module provides simple to use functions to query or set MIME parameters.
Each MIME header may hold an arbitrary amount of such parameters, which are delimeted by each other with a semicolon. | |
mm_param * | mm_param_new (void) |
void | mm_param_free (struct mm_param *param) |
mm_param * | mm_param_generate (const char *name, const char *value) |
char * | mm_param_setname (struct mm_param *param, const char *name, int copy) |
char * | mm_param_setvalue (struct mm_param *param, const char *value, int copy) |
const char * | mm_param_getname (struct mm_param *param) |
const char * | mm_param_getvalue (struct mm_param *param) |
void mm_param_free | ( | struct mm_param * | param | ) |
Releases all memory associated with a MIME parameter object.
param | A valid MIME parameter object to be freed |
struct mm_param* mm_param_generate | ( | const char * | name, | |
const char * | value | |||
) |
Generates a new Content-Type parameter with the given name and value
name | The name of the MIME parameter | |
value | The value of the MIME parameter |
const char* mm_param_getname | ( | struct mm_param * | param | ) |
Gets the name of a MIME parameter object
param | A valid MIME parameter object |
const char* mm_param_getvalue | ( | struct mm_param * | param | ) |
Gets the value of a MIME parameter object
param | A valid MIME parameter object |
struct mm_param* mm_param_new | ( | void | ) |
Creates a new object to hold a MIME parameter.
char* mm_param_setname | ( | struct mm_param * | param, | |
const char * | name, | |||
int | copy | |||
) |
Sets the name of the given MIME parameter
param | A valid MIME parameter object | |
name | The new name of the parameter | |
copy | If set to > 0, copy the value stored in name |
char* mm_param_setvalue | ( | struct mm_param * | param, | |
const char * | value, | |||
int | copy | |||
) |
Sets the value of the given MIME parameter
param | A valid MIME parameter object | |
name | The new value for the parameter | |
copy | If set to > 0, copy the value stored in value |