]>
Commit | Line | Data |
---|---|---|
f11a948a MS |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
2 | <html> | |
3 | <!-- SECTION: Programming --> | |
4 | <head> | |
5 | <title>MIME API</title> | |
6 | <meta name="keywords" content="Programming"> | |
7 | <meta name="creator" content="Mini-XML v2.6"> | |
8 | <style type="text/css"><!-- | |
9 | BODY { | |
10 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
11 | } | |
12 | ||
13 | H1, H2, H3, H4, H5, H6, P, TD, TH { | |
14 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
15 | } | |
16 | ||
17 | KBD { | |
18 | font-family: monaco, courier, monospace; | |
19 | font-weight: bold; | |
20 | } | |
21 | ||
22 | PRE { | |
23 | font-family: monaco, courier, monospace; | |
24 | } | |
25 | ||
26 | PRE.command { | |
27 | margin-left: 36pt; | |
28 | } | |
29 | ||
30 | P.compact { | |
31 | margin: 0; | |
32 | } | |
33 | ||
34 | P.example { | |
35 | font-style: italic; | |
36 | margin-left: 36pt; | |
37 | } | |
38 | ||
39 | PRE.example { | |
40 | background: #eeeeee; | |
41 | border: dotted thin #999999; | |
42 | margin-left: 36pt; | |
178cb736 | 43 | padding: 10pt; |
f11a948a MS |
44 | } |
45 | ||
46 | PRE.command EM, PRE.example EM { | |
47 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
48 | } | |
49 | ||
50 | P.command { | |
51 | font-family: monaco, courier, monospace; | |
52 | margin-left: 36pt; | |
53 | } | |
54 | ||
55 | P.formula { | |
56 | font-style: italic; | |
57 | margin-left: 36pt; | |
58 | } | |
59 | ||
60 | BLOCKQUOTE { | |
178cb736 | 61 | background: #eeeeee; |
f11a948a MS |
62 | border: solid thin #999999; |
63 | padding: 10pt; | |
64 | } | |
65 | ||
66 | A IMG { | |
67 | border: none; | |
68 | } | |
69 | ||
70 | A:link:hover IMG { | |
71 | background: #f0f0f0; | |
72 | border-radius: 10px; | |
73 | -moz-border-radius: 10px; | |
74 | } | |
75 | ||
76 | A:link, A:visited { | |
77 | font-weight: normal; | |
78 | text-decoration: none; | |
79 | } | |
80 | ||
81 | A:link:hover, A:visited:hover, A:active { | |
82 | text-decoration: underline; | |
83 | } | |
84 | ||
85 | SUB, SUP { | |
86 | font-size: 50%; | |
87 | } | |
88 | ||
89 | TR.data, TD.data, TR.data TD { | |
90 | margin-top: 10pt; | |
91 | padding: 5pt; | |
92 | border-bottom: solid 1pt #999999; | |
93 | } | |
94 | ||
95 | TR.data TH { | |
96 | border-bottom: solid 1pt #999999; | |
97 | padding-top: 10pt; | |
98 | padding-left: 5pt; | |
99 | text-align: left; | |
100 | } | |
101 | ||
102 | DIV.table TABLE { | |
103 | border: solid thin #999999; | |
104 | border-collapse: collapse; | |
105 | border-spacing: 0; | |
106 | margin-left: auto; | |
107 | margin-right: auto; | |
108 | } | |
109 | ||
110 | DIV.table CAPTION { | |
111 | caption-side: top; | |
112 | font-size: 120%; | |
113 | font-style: italic; | |
114 | font-weight: bold; | |
115 | margin-left: auto; | |
116 | margin-right: auto; | |
117 | } | |
118 | ||
119 | DIV.table TABLE TD { | |
120 | border: solid thin #cccccc; | |
121 | padding-top: 5pt; | |
122 | } | |
123 | ||
124 | DIV.table TABLE TH { | |
125 | background: #cccccc; | |
126 | border: none; | |
127 | border-bottom: solid thin #999999; | |
128 | } | |
129 | ||
130 | DIV.figure TABLE { | |
131 | margin-left: auto; | |
132 | margin-right: auto; | |
133 | } | |
134 | ||
135 | DIV.figure CAPTION { | |
136 | caption-side: bottom; | |
137 | font-size: 120%; | |
138 | font-style: italic; | |
139 | font-weight: bold; | |
140 | margin-left: auto; | |
141 | margin-right: auto; | |
142 | } | |
143 | ||
144 | TH.label { | |
145 | text-align: right; | |
146 | vertical-align: top; | |
147 | } | |
148 | ||
149 | TH.sublabel { | |
150 | text-align: right; | |
151 | font-weight: normal; | |
152 | } | |
153 | ||
154 | HR { | |
155 | border: solid thin; | |
156 | } | |
157 | ||
158 | SPAN.info { | |
159 | background: black; | |
160 | border: thin solid black; | |
161 | color: white; | |
162 | font-size: 80%; | |
163 | font-style: italic; | |
164 | font-weight: bold; | |
165 | white-space: nowrap; | |
166 | } | |
167 | ||
168 | H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { | |
169 | float: right; | |
170 | font-size: 100%; | |
171 | } | |
172 | ||
178cb736 MS |
173 | H1.title { |
174 | } | |
175 | ||
f11a948a MS |
176 | H2.title, H3.title { |
177 | border-bottom: solid 2pt #000000; | |
178 | } | |
179 | ||
180 | DIV.indent, TABLE.indent { | |
181 | margin-top: 2em; | |
182 | margin-left: auto; | |
183 | margin-right: auto; | |
184 | width: 90%; | |
185 | } | |
186 | ||
187 | TABLE.indent { | |
188 | border-collapse: collapse; | |
189 | } | |
190 | ||
191 | TABLE.indent TD, TABLE.indent TH { | |
192 | padding: 0; | |
193 | } | |
194 | ||
195 | TABLE.list { | |
196 | border-collapse: collapse; | |
197 | margin-left: auto; | |
198 | margin-right: auto; | |
199 | width: 90%; | |
200 | } | |
201 | ||
202 | TABLE.list TH { | |
203 | background: white; | |
204 | border-bottom: solid thin #cccccc; | |
205 | color: #444444; | |
206 | padding-top: 10pt; | |
207 | padding-left: 5pt; | |
208 | text-align: left; | |
209 | vertical-align: bottom; | |
210 | white-space: nowrap; | |
211 | } | |
212 | ||
213 | TABLE.list TH A { | |
214 | color: #4444cc; | |
215 | } | |
216 | ||
217 | TABLE.list TD { | |
218 | border-bottom: solid thin #eeeeee; | |
219 | padding-top: 5pt; | |
220 | padding-left: 5pt; | |
221 | } | |
222 | ||
223 | TABLE.list TR:nth-child(even) { | |
224 | background: #f8f8f8; | |
225 | } | |
226 | ||
227 | TABLE.list TR:nth-child(odd) { | |
228 | background: #f4f4f4; | |
229 | } | |
230 | ||
231 | DT { | |
232 | margin-left: 36pt; | |
233 | margin-top: 12pt; | |
234 | } | |
235 | ||
236 | DD { | |
237 | margin-left: 54pt; | |
238 | } | |
239 | ||
240 | DL.category DT { | |
241 | font-weight: bold; | |
242 | } | |
243 | ||
244 | P.summary { | |
245 | margin-left: 36pt; | |
246 | font-family: monaco, courier, monospace; | |
247 | } | |
248 | ||
249 | DIV.summary TABLE { | |
250 | border: solid thin #999999; | |
251 | border-collapse: collapse; | |
252 | border-spacing: 0; | |
253 | margin: 10px; | |
254 | } | |
255 | ||
256 | DIV.summary TABLE TD, DIV.summary TABLE TH { | |
257 | border: solid thin #999999; | |
258 | padding: 5px; | |
259 | text-align: left; | |
260 | vertical-align: top; | |
261 | } | |
262 | ||
263 | DIV.summary TABLE THEAD TH { | |
264 | background: #eeeeee; | |
265 | } | |
266 | ||
267 | /* API documentation styles... */ | |
268 | div.body h1 { | |
269 | margin: 0; | |
270 | } | |
271 | div.body h2 { | |
272 | margin-top: 1.5em; | |
273 | } | |
274 | div.body h3, div.body h4, div.body h5 { | |
275 | margin-bottom: 0.5em; | |
276 | margin-top: 1.5em; | |
277 | } | |
278 | .class, .enumeration, .function, .struct, .typedef, .union { | |
279 | border-bottom: solid thin #999999; | |
280 | margin-bottom: 0; | |
281 | margin-top: 2em; | |
282 | } | |
283 | .description { | |
284 | margin-top: 0.5em; | |
285 | } | |
286 | code, p.code, pre, ul.code li { | |
287 | font-family: monaco, courier, monospace; | |
288 | font-size: 90%; | |
289 | } | |
290 | ul.code, ul.contents, ul.subcontents { | |
291 | list-style-type: none; | |
292 | margin: 0; | |
293 | padding-left: 0; | |
294 | } | |
295 | ul.code li { | |
296 | margin: 0; | |
297 | } | |
298 | ul.contents > li { | |
299 | margin-top: 1em; | |
300 | } | |
301 | ul.contents li ul.code, ul.contents li ul.subcontents { | |
302 | padding-left: 2em; | |
303 | } | |
304 | div.body dl { | |
305 | margin-left: 0; | |
306 | margin-top: 0; | |
307 | } | |
308 | div.body dt { | |
309 | font-style: italic; | |
310 | margin-left: 0; | |
311 | margin-top: 0; | |
312 | } | |
313 | div.body dd { | |
314 | margin-bottom: 0.5em; | |
315 | } | |
316 | ||
317 | /* This is just for the HTML files generated with the framedhelp target */ | |
318 | div.contents { | |
319 | background: #e8e8e8; | |
320 | border: solid thin black; | |
321 | padding: 10px; | |
322 | } | |
323 | div.contents h1 { | |
324 | font-size: 110%; | |
325 | } | |
326 | div.contents h2 { | |
327 | font-size: 100%; | |
328 | } | |
329 | div.contents ul.contents { | |
330 | font-size: 80%; | |
331 | } | |
332 | div.contents ul.subcontents li { | |
333 | margin-left: 1em; | |
334 | text-indent: -1em; | |
335 | } | |
336 | --></style> | |
337 | </head> | |
338 | <body> | |
339 | <div class='body'> | |
178cb736 MS |
340 | <!-- |
341 | "$Id: api-array.header 8087 2008-10-27 21:37:05Z mike $" | |
342 | ||
343 | MIME API header for CUPS. | |
344 | ||
345 | Copyright 2009 by Apple Inc. | |
346 | ||
347 | These coded instructions, statements, and computer programs are the | |
348 | property of Apple Inc. and are protected by Federal copyright | |
349 | law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
350 | which should have been included with this file. If this file is | |
351 | file is missing or damaged, see the license at "http://www.cups.org/". | |
352 | --> | |
353 | ||
354 | <h1 class='title'>MIME API</h1> | |
355 | ||
356 | <div class='summary'><table summary='General Information'> | |
357 | <thead> | |
358 | <tr> | |
359 | <th>Header</th> | |
360 | <th>cups/mime.h</th> | |
361 | </tr> | |
362 | </thead> | |
363 | <tbody> | |
364 | <tr> | |
365 | <th>Library</th> | |
366 | <td>-lcupsmime</td> | |
367 | </tr> | |
368 | <tr> | |
369 | <th>See Also</th> | |
370 | <td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a></td> | |
371 | </tr> | |
372 | </tbody> | |
373 | </table></div> | |
f11a948a MS |
374 | <h2 class="title">Contents</h2> |
375 | <ul class="contents"> | |
178cb736 MS |
376 | <ul class="subcontents"> |
377 | <li><a href="#OVERVIEW">Overview</a></li> | |
f11a948a MS |
378 | <li><a href="#FUNCTIONS">Functions</a><ul class="code"> |
379 | <li><a href="#mimeAddFilter" title="Add a filter to the current MIME database.">mimeAddFilter</a></li> | |
380 | <li><a href="#mimeAddType" title="Add a MIME type to a database.">mimeAddType</a></li> | |
381 | <li><a href="#mimeAddTypeRule" title="Add a detection rule for a file type.">mimeAddTypeRule</a></li> | |
382 | <li><a href="#mimeDelete" title="Delete (free) a MIME database.">mimeDelete</a></li> | |
383 | <li><a href="#mimeDeleteFilter" title="Delete a filter from the MIME database.">mimeDeleteFilter</a></li> | |
384 | <li><a href="#mimeDeleteType" title="Delete a type from the MIME database.">mimeDeleteType</a></li> | |
385 | <li><a href="#mimeFileType" title="Determine the type of a file.">mimeFileType</a></li> | |
386 | <li><a href="#mimeFilter" title="Find the fastest way to convert from one type to another.">mimeFilter</a></li> | |
387 | <li><a href="#mimeFilterLookup" title="Lookup a filter...">mimeFilterLookup</a></li> | |
388 | <li><a href="#mimeFirstFilter" title="Get the first filter in the MIME database.">mimeFirstFilter</a></li> | |
389 | <li><a href="#mimeFirstType" title="Get the first type in the MIME database.">mimeFirstType</a></li> | |
390 | <li><a href="#mimeLoad" title="Create a new MIME database from disk.">mimeLoad</a></li> | |
391 | <li><a href="#mimeLoadFilters" title="Load filter definitions from disk.">mimeLoadFilters</a></li> | |
392 | <li><a href="#mimeLoadTypes" title="Load type definitions from disk.">mimeLoadTypes</a></li> | |
393 | <li><a href="#mimeNextFilter" title="Get the next filter in the MIME database.">mimeNextFilter</a></li> | |
394 | <li><a href="#mimeNextType" title="Get the next type in the MIME database.">mimeNextType</a></li> | |
395 | <li><a href="#mimeNumFilters" title="MIME database">mimeNumFilters</a></li> | |
396 | <li><a href="#mimeNumTypes" title="MIME database">mimeNumTypes</a></li> | |
397 | <li><a href="#mimeType" title="Lookup a file type.">mimeType</a></li> | |
398 | </ul></li> | |
399 | <li><a href="#TYPES">Data Types</a><ul class="code"> | |
400 | <li><a href="#mime_filter_t" title="MIME Conversion Filter Data">mime_filter_t</a></li> | |
401 | <li><a href="#mime_magic_t" title="MIME Magic Data">mime_magic_t</a></li> | |
402 | <li><a href="#mime_op_t" title="Types/structures...">mime_op_t</a></li> | |
403 | <li><a href="#mime_t" title="MIME Database">mime_t</a></li> | |
404 | <li><a href="#mime_type_t" title="MIME Type Data">mime_type_t</a></li> | |
405 | </ul></li> | |
178cb736 MS |
406 | <!-- |
407 | "$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $" | |
408 | ||
409 | MIME API introduction for CUPS. | |
410 | ||
411 | Copyright 2009 by Apple Inc. | |
412 | ||
413 | These coded instructions, statements, and computer programs are the | |
414 | property of Apple Inc. and are protected by Federal copyright | |
415 | law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
416 | which should have been included with this file. If this file is | |
417 | file is missing or damaged, see the license at "http://www.cups.org/". | |
418 | --> | |
419 | ||
420 | <h2 class='title'><a name='OVERVIEW'>Overview</a></h2> | |
421 | ||
422 | <p>The MIME API provides file typing and conversion services for CUPS.</p> | |
f11a948a MS |
423 | <h2 class="title"><a name="FUNCTIONS">Functions</a></h2> |
424 | <h3 class="function"><a name="mimeAddFilter">mimeAddFilter</a></h3> | |
425 | <p class="description">Add a filter to the current MIME database.</p> | |
426 | <p class="code"> | |
427 | <a href="#mime_filter_t">mime_filter_t</a> *mimeAddFilter (<br> | |
428 | <a href="#mime_t">mime_t</a> *mime,<br> | |
429 | <a href="#mime_type_t">mime_type_t</a> *src,<br> | |
430 | <a href="#mime_type_t">mime_type_t</a> *dst,<br> | |
431 | int cost,<br> | |
432 | const char *filter<br> | |
433 | );</p> | |
434 | <h4 class="parameters">Parameters</h4> | |
435 | <dl> | |
436 | <dt>mime</dt> | |
437 | <dd class="description">MIME database</dd> | |
438 | <dt>src</dt> | |
439 | <dd class="description">Source type</dd> | |
440 | <dt>dst</dt> | |
441 | <dd class="description">Destination type</dd> | |
442 | <dt>cost</dt> | |
443 | <dd class="description">Relative time/resource cost</dd> | |
444 | <dt>filter</dt> | |
445 | <dd class="description">Filter program to run</dd> | |
446 | </dl> | |
447 | <h4 class="returnvalue">Return Value</h4> | |
448 | <p class="description">New filter</p> | |
449 | <h3 class="function"><a name="mimeAddType">mimeAddType</a></h3> | |
450 | <p class="description">Add a MIME type to a database.</p> | |
451 | <p class="code"> | |
452 | <a href="#mime_type_t">mime_type_t</a> *mimeAddType (<br> | |
453 | <a href="#mime_t">mime_t</a> *mime,<br> | |
454 | const char *super,<br> | |
455 | const char *type<br> | |
456 | );</p> | |
457 | <h4 class="parameters">Parameters</h4> | |
458 | <dl> | |
459 | <dt>mime</dt> | |
460 | <dd class="description">MIME database</dd> | |
461 | <dt>super</dt> | |
462 | <dd class="description">Super-type name</dd> | |
463 | <dt>type</dt> | |
464 | <dd class="description">Type name</dd> | |
465 | </dl> | |
466 | <h4 class="returnvalue">Return Value</h4> | |
467 | <p class="description">New (or existing) MIME type</p> | |
468 | <h3 class="function"><a name="mimeAddTypeRule">mimeAddTypeRule</a></h3> | |
469 | <p class="description">Add a detection rule for a file type.</p> | |
470 | <p class="code"> | |
471 | int mimeAddTypeRule (<br> | |
472 | <a href="#mime_type_t">mime_type_t</a> *mt,<br> | |
473 | const char *rule<br> | |
474 | );</p> | |
475 | <h4 class="parameters">Parameters</h4> | |
476 | <dl> | |
477 | <dt>mt</dt> | |
478 | <dd class="description">Type to add to</dd> | |
479 | <dt>rule</dt> | |
480 | <dd class="description">Rule to add</dd> | |
481 | </dl> | |
482 | <h4 class="returnvalue">Return Value</h4> | |
483 | <p class="description">0 on success, -1 on failure</p> | |
484 | <h3 class="function"><a name="mimeDelete">mimeDelete</a></h3> | |
485 | <p class="description">Delete (free) a MIME database.</p> | |
486 | <p class="code"> | |
487 | void mimeDelete (<br> | |
488 | <a href="#mime_t">mime_t</a> *mime<br> | |
489 | );</p> | |
490 | <h4 class="parameters">Parameters</h4> | |
491 | <dl> | |
492 | <dt>mime</dt> | |
493 | <dd class="description">MIME database</dd> | |
494 | </dl> | |
495 | <h3 class="function"><a name="mimeDeleteFilter">mimeDeleteFilter</a></h3> | |
496 | <p class="description">Delete a filter from the MIME database.</p> | |
497 | <p class="code"> | |
498 | void mimeDeleteFilter (<br> | |
499 | <a href="#mime_t">mime_t</a> *mime,<br> | |
500 | <a href="#mime_filter_t">mime_filter_t</a> *filter<br> | |
501 | );</p> | |
502 | <h4 class="parameters">Parameters</h4> | |
503 | <dl> | |
504 | <dt>mime</dt> | |
505 | <dd class="description">MIME database</dd> | |
506 | <dt>filter</dt> | |
507 | <dd class="description">Filter</dd> | |
508 | </dl> | |
509 | <h3 class="function"><a name="mimeDeleteType">mimeDeleteType</a></h3> | |
510 | <p class="description">Delete a type from the MIME database.</p> | |
511 | <p class="code"> | |
512 | void mimeDeleteType (<br> | |
513 | <a href="#mime_t">mime_t</a> *mime,<br> | |
514 | <a href="#mime_type_t">mime_type_t</a> *mt<br> | |
515 | );</p> | |
516 | <h4 class="parameters">Parameters</h4> | |
517 | <dl> | |
518 | <dt>mime</dt> | |
519 | <dd class="description">MIME database</dd> | |
520 | <dt>mt</dt> | |
521 | <dd class="description">Type</dd> | |
522 | </dl> | |
523 | <h3 class="function"><a name="mimeFileType">mimeFileType</a></h3> | |
524 | <p class="description">Determine the type of a file.</p> | |
525 | <p class="code"> | |
526 | <a href="#mime_type_t">mime_type_t</a> *mimeFileType (<br> | |
527 | <a href="#mime_t">mime_t</a> *mime,<br> | |
528 | const char *pathname,<br> | |
529 | const char *filename,<br> | |
530 | int *compression<br> | |
531 | );</p> | |
532 | <h4 class="parameters">Parameters</h4> | |
533 | <dl> | |
534 | <dt>mime</dt> | |
535 | <dd class="description">MIME database</dd> | |
536 | <dt>pathname</dt> | |
537 | <dd class="description">Name of file to check on disk</dd> | |
538 | <dt>filename</dt> | |
539 | <dd class="description">Original filename or NULL</dd> | |
540 | <dt>compression</dt> | |
541 | <dd class="description">Is the file compressed?</dd> | |
542 | </dl> | |
543 | <h4 class="returnvalue">Return Value</h4> | |
544 | <p class="description">Type of file</p> | |
545 | <h3 class="function"><a name="mimeFilter">mimeFilter</a></h3> | |
546 | <p class="description">Find the fastest way to convert from one type to another.</p> | |
547 | <p class="code"> | |
548 | cups_array_t *mimeFilter (<br> | |
549 | <a href="#mime_t">mime_t</a> *mime,<br> | |
550 | <a href="#mime_type_t">mime_type_t</a> *src,<br> | |
551 | <a href="#mime_type_t">mime_type_t</a> *dst,<br> | |
552 | int *cost<br> | |
553 | );</p> | |
554 | <h4 class="parameters">Parameters</h4> | |
555 | <dl> | |
556 | <dt>mime</dt> | |
557 | <dd class="description">MIME database</dd> | |
558 | <dt>src</dt> | |
559 | <dd class="description">Source file type</dd> | |
560 | <dt>dst</dt> | |
561 | <dd class="description">Destination file type</dd> | |
562 | <dt>cost</dt> | |
563 | <dd class="description">Cost of filters</dd> | |
564 | </dl> | |
565 | <h4 class="returnvalue">Return Value</h4> | |
566 | <p class="description">Array of filters to run</p> | |
567 | <h3 class="function"><a name="mimeFilterLookup">mimeFilterLookup</a></h3> | |
568 | <p class="description">Lookup a filter...</p> | |
569 | <p class="code"> | |
570 | <a href="#mime_filter_t">mime_filter_t</a> *mimeFilterLookup (<br> | |
571 | <a href="#mime_t">mime_t</a> *mime,<br> | |
572 | <a href="#mime_type_t">mime_type_t</a> *src,<br> | |
573 | <a href="#mime_type_t">mime_type_t</a> *dst<br> | |
574 | );</p> | |
575 | <h4 class="parameters">Parameters</h4> | |
576 | <dl> | |
577 | <dt>mime</dt> | |
578 | <dd class="description">MIME database</dd> | |
579 | <dt>src</dt> | |
580 | <dd class="description">Source type</dd> | |
581 | <dt>dst</dt> | |
582 | <dd class="description">Destination type</dd> | |
583 | </dl> | |
584 | <h4 class="returnvalue">Return Value</h4> | |
585 | <p class="description">Filter for src->dst</p> | |
586 | <h3 class="function"><a name="mimeFirstFilter">mimeFirstFilter</a></h3> | |
587 | <p class="description">Get the first filter in the MIME database.</p> | |
588 | <p class="code"> | |
589 | <a href="#mime_filter_t">mime_filter_t</a> *mimeFirstFilter (<br> | |
590 | <a href="#mime_t">mime_t</a> *mime<br> | |
591 | );</p> | |
592 | <h4 class="parameters">Parameters</h4> | |
593 | <dl> | |
594 | <dt>mime</dt> | |
595 | <dd class="description">MIME database</dd> | |
596 | </dl> | |
597 | <h4 class="returnvalue">Return Value</h4> | |
598 | <p class="description">Filter or NULL</p> | |
599 | <h3 class="function"><a name="mimeFirstType">mimeFirstType</a></h3> | |
600 | <p class="description">Get the first type in the MIME database.</p> | |
601 | <p class="code"> | |
602 | <a href="#mime_type_t">mime_type_t</a> *mimeFirstType (<br> | |
603 | <a href="#mime_t">mime_t</a> *mime<br> | |
604 | );</p> | |
605 | <h4 class="parameters">Parameters</h4> | |
606 | <dl> | |
607 | <dt>mime</dt> | |
608 | <dd class="description">MIME database</dd> | |
609 | </dl> | |
610 | <h4 class="returnvalue">Return Value</h4> | |
611 | <p class="description">Type or NULL</p> | |
612 | <h3 class="function"><a name="mimeLoad">mimeLoad</a></h3> | |
613 | <p class="description">Create a new MIME database from disk.</p> | |
614 | <p class="code"> | |
615 | <a href="#mime_t">mime_t</a> *mimeLoad (<br> | |
616 | const char *pathname,<br> | |
617 | const char *filterpath<br> | |
618 | );</p> | |
619 | <h4 class="parameters">Parameters</h4> | |
620 | <dl> | |
621 | <dt>pathname</dt> | |
622 | <dd class="description">Directory to load</dd> | |
623 | <dt>filterpath</dt> | |
624 | <dd class="description">Directory to load</dd> | |
625 | </dl> | |
626 | <h4 class="returnvalue">Return Value</h4> | |
627 | <p class="description">New MIME database</p> | |
628 | <h4 class="discussion">Discussion</h4> | |
629 | <p class="discussion">This function uses <a href="#mimeLoadFilters"><code>mimeLoadFilters</code></a> and <a href="#mimeLoadTypes"><code>mimeLoadTypes</code></a> to | |
630 | create a MIME database from a single directory.</p> | |
631 | <h3 class="function"><a name="mimeLoadFilters">mimeLoadFilters</a></h3> | |
632 | <p class="description">Load filter definitions from disk.</p> | |
633 | <p class="code"> | |
634 | <a href="#mime_t">mime_t</a> *mimeLoadFilters (<br> | |
635 | <a href="#mime_t">mime_t</a> *mime,<br> | |
636 | const char *pathname,<br> | |
637 | const char *filterpath<br> | |
638 | );</p> | |
639 | <h4 class="parameters">Parameters</h4> | |
640 | <dl> | |
641 | <dt>mime</dt> | |
642 | <dd class="description">MIME database</dd> | |
643 | <dt>pathname</dt> | |
644 | <dd class="description">Directory to load from</dd> | |
645 | <dt>filterpath</dt> | |
646 | <dd class="description">Default filter program directory</dd> | |
647 | </dl> | |
648 | <h4 class="returnvalue">Return Value</h4> | |
649 | <p class="description">MIME database</p> | |
650 | <h4 class="discussion">Discussion</h4> | |
651 | <p class="discussion">This function loads all of the .convs files from the specified directory. | |
652 | Use <a href="#mimeLoadTypes"><code>mimeLoadTypes</code></a> to load all types before you load the filters.</p> | |
653 | <h3 class="function"><a name="mimeLoadTypes">mimeLoadTypes</a></h3> | |
654 | <p class="description">Load type definitions from disk.</p> | |
655 | <p class="code"> | |
656 | <a href="#mime_t">mime_t</a> *mimeLoadTypes (<br> | |
657 | <a href="#mime_t">mime_t</a> *mime,<br> | |
658 | const char *pathname<br> | |
659 | );</p> | |
660 | <h4 class="parameters">Parameters</h4> | |
661 | <dl> | |
662 | <dt>mime</dt> | |
663 | <dd class="description">MIME database or <code>NULL</code> to create a new one</dd> | |
664 | <dt>pathname</dt> | |
665 | <dd class="description">Directory to load from</dd> | |
666 | </dl> | |
667 | <h4 class="returnvalue">Return Value</h4> | |
668 | <p class="description">MIME database</p> | |
669 | <h4 class="discussion">Discussion</h4> | |
670 | <p class="discussion">This function loads all of the .types files from the specified directory. | |
671 | Use <a href="#mimeLoadFilters"><code>mimeLoadFilters</code></a> to load all filters after you load the types.</p> | |
672 | <h3 class="function"><a name="mimeNextFilter">mimeNextFilter</a></h3> | |
673 | <p class="description">Get the next filter in the MIME database.</p> | |
674 | <p class="code"> | |
675 | <a href="#mime_filter_t">mime_filter_t</a> *mimeNextFilter (<br> | |
676 | <a href="#mime_t">mime_t</a> *mime<br> | |
677 | );</p> | |
678 | <h4 class="parameters">Parameters</h4> | |
679 | <dl> | |
680 | <dt>mime</dt> | |
681 | <dd class="description">MIME database</dd> | |
682 | </dl> | |
683 | <h4 class="returnvalue">Return Value</h4> | |
684 | <p class="description">Filter or NULL</p> | |
685 | <h3 class="function"><a name="mimeNextType">mimeNextType</a></h3> | |
686 | <p class="description">Get the next type in the MIME database.</p> | |
687 | <p class="code"> | |
688 | <a href="#mime_type_t">mime_type_t</a> *mimeNextType (<br> | |
689 | <a href="#mime_t">mime_t</a> *mime<br> | |
690 | );</p> | |
691 | <h4 class="parameters">Parameters</h4> | |
692 | <dl> | |
693 | <dt>mime</dt> | |
694 | <dd class="description">MIME database</dd> | |
695 | </dl> | |
696 | <h4 class="returnvalue">Return Value</h4> | |
697 | <p class="description">Type or NULL</p> | |
698 | <h3 class="function"><a name="mimeNumFilters">mimeNumFilters</a></h3> | |
699 | <p class="description">MIME database</p> | |
700 | <p class="code"> | |
701 | int mimeNumFilters (<br> | |
702 | <a href="#mime_t">mime_t</a> *mime<br> | |
703 | );</p> | |
704 | <h4 class="parameters">Parameters</h4> | |
705 | <dl> | |
706 | <dt>mime</dt> | |
707 | <dd class="description">MIME database</dd> | |
708 | </dl> | |
709 | <h4 class="returnvalue">Return Value</h4> | |
710 | <p class="description">Get the number of filters in a MIME database.</p> | |
711 | <h3 class="function"><a name="mimeNumTypes">mimeNumTypes</a></h3> | |
712 | <p class="description">MIME database</p> | |
713 | <p class="code"> | |
714 | int mimeNumTypes (<br> | |
715 | <a href="#mime_t">mime_t</a> *mime<br> | |
716 | );</p> | |
717 | <h4 class="parameters">Parameters</h4> | |
718 | <dl> | |
719 | <dt>mime</dt> | |
720 | <dd class="description">MIME database</dd> | |
721 | </dl> | |
722 | <h4 class="returnvalue">Return Value</h4> | |
723 | <p class="description">Get the number of types in a MIME database.</p> | |
724 | <h3 class="function"><a name="mimeType">mimeType</a></h3> | |
725 | <p class="description">Lookup a file type.</p> | |
726 | <p class="code"> | |
727 | <a href="#mime_type_t">mime_type_t</a> *mimeType (<br> | |
728 | <a href="#mime_t">mime_t</a> *mime,<br> | |
729 | const char *super,<br> | |
730 | const char *type<br> | |
731 | );</p> | |
732 | <h4 class="parameters">Parameters</h4> | |
733 | <dl> | |
734 | <dt>mime</dt> | |
735 | <dd class="description">MIME database</dd> | |
736 | <dt>super</dt> | |
737 | <dd class="description">Super-type name</dd> | |
738 | <dt>type</dt> | |
739 | <dd class="description">Type name</dd> | |
740 | </dl> | |
741 | <h4 class="returnvalue">Return Value</h4> | |
742 | <p class="description">Matching file type definition</p> | |
743 | <h2 class="title"><a name="TYPES">Data Types</a></h2> | |
744 | <h3 class="typedef"><a name="mime_filter_t">mime_filter_t</a></h3> | |
745 | <p class="description">MIME Conversion Filter Data</p> | |
746 | <p class="code"> | |
747 | typedef struct _mime_filter_s mime_filter_t; | |
748 | </p> | |
749 | <h3 class="typedef"><a name="mime_magic_t">mime_magic_t</a></h3> | |
750 | <p class="description">MIME Magic Data</p> | |
751 | <p class="code"> | |
752 | typedef struct _mime_magic_s mime_magic_t; | |
753 | </p> | |
754 | <h3 class="typedef"><a name="mime_op_t">mime_op_t</a></h3> | |
755 | <p class="description">Types/structures...</p> | |
756 | <p class="code"> | |
757 | typedef enum mime_op_t; | |
758 | </p> | |
759 | <h3 class="typedef"><a name="mime_t">mime_t</a></h3> | |
760 | <p class="description">MIME Database</p> | |
761 | <p class="code"> | |
762 | typedef struct _mime_s mime_t; | |
763 | </p> | |
764 | <h3 class="typedef"><a name="mime_type_t">mime_type_t</a></h3> | |
765 | <p class="description">MIME Type Data</p> | |
766 | <p class="code"> | |
767 | typedef struct _mime_type_s mime_type_t; | |
768 | </p> | |
769 | </div> | |
770 | </body> | |
771 | </html> |