summaryrefslogtreecommitdiff
path: root/doc/sgml/gmime-content-type.sgml
blob: 2b6a8b974754cfd667241e9f7ddc5d9fe20c03d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<refentry id="gmime-gmime-content-type" revision="2 Mar 2002">
<refmeta>
<refentrytitle>gmime-content-type</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GMIME Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>gmime-content-type</refname><refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



struct      <link linkend="GMimeContentType">GMimeContentType</link>;
<link linkend="GMimeContentType">GMimeContentType</link>* <link linkend="g-mime-content-type-new">g_mime_content_type_new</link>   (const char *type,
                                             const char *subtype);
<link linkend="GMimeContentType">GMimeContentType</link>* <link linkend="g-mime-content-type-new-from-string">g_mime_content_type_new_from_string</link>
                                            (const char *string);
void        <link linkend="g-mime-content-type-destroy">g_mime_content_type_destroy</link>     (<link linkend="GMimeContentType">GMimeContentType</link> *mime_type);
char*       <link linkend="g-mime-content-type-to-string">g_mime_content_type_to_string</link>   (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type);
<link linkend="gboolean">gboolean</link>    <link linkend="g-mime-content-type-is-type">g_mime_content_type_is_type</link>     (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *type,
                                             const char *subtype);
void        <link linkend="g-mime-content-type-add-parameter">g_mime_content_type_add_parameter</link>
                                            (<link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *attribute,
                                             const char *value);
const char* <link linkend="g-mime-content-type-get-parameter">g_mime_content_type_get_parameter</link>
                                            (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *attribute);
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GMimeContentType">struct GMimeContentType</title>
<programlisting>struct GMimeContentType {
	char *type;
	char *subtype;
	
	GMimeParam *params;
	GHashTable *param_hash;
};
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-new">g_mime_content_type_new ()</title>
<programlisting><link linkend="GMimeContentType">GMimeContentType</link>* g_mime_content_type_new   (const char *type,
                                             const char *subtype);</programlisting>
<para>
Creates a Content-Type object with type <parameter>type</parameter> and subtype <parameter>subtype</parameter>.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> MIME type (or NULL for "text")
</entry></row>
<row><entry align="right"><parameter>subtype</parameter>&nbsp;:</entry>
<entry> MIME subtype (or NULL for "plain")
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a new MIME Content-Type object.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-new-from-string">g_mime_content_type_new_from_string ()</title>
<programlisting><link linkend="GMimeContentType">GMimeContentType</link>* g_mime_content_type_new_from_string
                                            (const char *string);</programlisting>
<para>
Constructs a new Content-Type object based on the input string.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>string</parameter>&nbsp;:</entry>
<entry> input string containing a content-type (and params)
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a new MIME Content-Type based on the input string.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-destroy">g_mime_content_type_destroy ()</title>
<programlisting>void        g_mime_content_type_destroy     (<link linkend="GMimeContentType">GMimeContentType</link> *mime_type);</programlisting>
<para>
Destroys the given MIME Content-Type object.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>mime_type</parameter>&nbsp;:</entry>
<entry> MIME Content-Type object to destroy
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-to-string">g_mime_content_type_to_string ()</title>
<programlisting>char*       g_mime_content_type_to_string   (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type);</programlisting>
<para>
Allocates a string buffer containing the type and subtype defined
by the <parameter>mime_type</parameter>.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>mime_type</parameter>&nbsp;:</entry>
<entry> MIME Content-Type
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>an allocated string containing the type and subtype of the
content-type in the format: type/subtype.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-is-type">g_mime_content_type_is_type ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    g_mime_content_type_is_type     (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *type,
                                             const char *subtype);</programlisting>
<para>
Compares the given type and subtype with that of the given mime
type object.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>mime_type</parameter>&nbsp;:</entry>
<entry> MIME Content-Type
</entry></row>
<row><entry align="right"><parameter>type</parameter>&nbsp;:</entry>
<entry> MIME type to compare against
</entry></row>
<row><entry align="right"><parameter>subtype</parameter>&nbsp;:</entry>
<entry> MIME subtype to compare against
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>TRUE if the MIME types match or FALSE otherwise. You may
use "*" in place of <parameter>type</parameter> and/or <parameter>subtype</parameter> as a wilcard.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-add-parameter">g_mime_content_type_add_parameter ()</title>
<programlisting>void        g_mime_content_type_add_parameter
                                            (<link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *attribute,
                                             const char *value);</programlisting>
<para>
Adds a parameter to the Content-Type.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>mime_type</parameter>&nbsp;:</entry>
<entry> MIME Content-Type
</entry></row>
<row><entry align="right"><parameter>attribute</parameter>&nbsp;:</entry>
<entry> parameter name (aka attribute)
</entry></row>
<row><entry align="right"><parameter>value</parameter>&nbsp;:</entry>
<entry> parameter value
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mime-content-type-get-parameter">g_mime_content_type_get_parameter ()</title>
<programlisting>const char* g_mime_content_type_get_parameter
                                            (const <link linkend="GMimeContentType">GMimeContentType</link> *mime_type,
                                             const char *attribute);</programlisting>
<para>
Gets the parameter value specified by <parameter>attribute</parameter> if it's available.</para>
<para>

</para><informaltable pgwide=1 frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>mime_type</parameter>&nbsp;:</entry>
<entry> MIME Content-Type
</entry></row>
<row><entry align="right"><parameter>attribute</parameter>&nbsp;:</entry>
<entry> parameter name (aka attribute)
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>a const pointer to the paramer value specified by
<parameter>attribute</parameter> or <literal>NULL</literal> on fail.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>