gmime-content-type

gmime-content-type —

Synopsis




            GMimeContentType;
GMimeContentType* g_mime_content_type_new   (const char *type,
                                             const char *subtype);
GMimeContentType* g_mime_content_type_new_from_string
                                            (const char *string);
void        g_mime_content_type_destroy     (GMimeContentType *mime_type);
char*       g_mime_content_type_to_string   (const GMimeContentType *mime_type);
gboolean    g_mime_content_type_is_type     (const GMimeContentType *mime_type,
                                             const char *type,
                                             const char *subtype);
void        g_mime_content_type_set_parameter
                                            (GMimeContentType *mime_type,
                                             const char *attribute,
                                             const char *value);
const char* g_mime_content_type_get_parameter
                                            (const GMimeContentType *mime_type,
                                             const char *attribute);

Description

Details

GMimeContentType

typedef struct {
	char *type;
	char *subtype;
	
	GMimeParam *params;
	GHashTable *param_hash;
} GMimeContentType;


g_mime_content_type_new ()

GMimeContentType* g_mime_content_type_new   (const char *type,
                                             const char *subtype);

Creates a Content-Type object with type type and subtype subtype.

type : MIME type (or NULL for "text")
subtype : MIME subtype (or NULL for "plain")
Returns : a new MIME Content-Type object.

g_mime_content_type_new_from_string ()

GMimeContentType* g_mime_content_type_new_from_string
                                            (const char *string);

Constructs a new Content-Type object based on the input string.

string : input string containing a content-type (and params)
Returns : a new MIME Content-Type based on the input string.

g_mime_content_type_destroy ()

void        g_mime_content_type_destroy     (GMimeContentType *mime_type);

Destroys the given MIME Content-Type object.

mime_type : MIME Content-Type object to destroy

g_mime_content_type_to_string ()

char*       g_mime_content_type_to_string   (const GMimeContentType *mime_type);

Allocates a string buffer containing the type and subtype defined by the mime_type.

mime_type : MIME Content-Type
Returns : an allocated string containing the type and subtype of the content-type in the format: type/subtype.

g_mime_content_type_is_type ()

gboolean    g_mime_content_type_is_type     (const GMimeContentType *mime_type,
                                             const char *type,
                                             const char *subtype);

Compares the given type and subtype with that of the given mime type object.

mime_type : MIME Content-Type
type : MIME type to compare against
subtype : MIME subtype to compare against
Returns : TRUE if the MIME types match or FALSE otherwise. You may use "*" in place of type and/or subtype as a wilcard.

g_mime_content_type_set_parameter ()

void        g_mime_content_type_set_parameter
                                            (GMimeContentType *mime_type,
                                             const char *attribute,
                                             const char *value);

Sets a parameter on the Content-Type.

mime_type : MIME Content-Type
attribute : parameter name (aka attribute)
value : parameter value

g_mime_content_type_get_parameter ()

const char* g_mime_content_type_get_parameter
                                            (const GMimeContentType *mime_type,
                                             const char *attribute);

Gets the parameter value specified by attribute if it's available.

mime_type : MIME Content-Type
attribute : parameter name (aka attribute)
Returns : a const pointer to the paramer value specified by attribute or NULL on fail.