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