]>
Commit | Line | Data |
---|---|---|
c277f98c | 1 | <!DOCTYPE HTML> |
94436c5a MS |
2 | <html> |
3 | <!-- SECTION: Man Pages --> | |
4 | <head> | |
5 | <link rel="stylesheet" type="text/css" href="../cups-printable.css"> | |
6 | <title>mime.types(5)</title> | |
7 | </head> | |
8 | <body> | |
9 | <h1 class="title">mime.types(5)</h1> | |
10 | <h2 class="title"><a name="NAME">Name</a></h2> | |
11 | mime.types - mime type description file for cups | |
12 | <h2 class="title"><a name="DESCRIPTION">Description</a></h2> | |
13 | The <i>mime.types</i> file defines the recognized file types. | |
14 | <p>Additional file types can be added to <i>mime.types</i> or | |
15 | (preferably) in additional files in the CUPS configuration | |
16 | directory with the extension ".types". | |
17 | <p>Each line in the <i>mime.types</i> file is a comment, blank, or | |
18 | rule line. Comment lines start with the # character. Rule lines | |
19 | start with the MIME type name and are optionally followed by a | |
20 | series of file recognition rules that are used to automatically | |
21 | identify print and web files: | |
22 | <br> | |
23 | <pre> | |
24 | ||
25 | super/type rule [ ... ruleN] | |
26 | </pre> | |
27 | MIME type names are case-insensitive and are sorted in ascending alphanumeric | |
28 | order for the purposes of matching. See the "TYPE MATCHING AND PRIORITY" | |
29 | section for more information. | |
30 | <p>The rules may be grouped using parenthesis, joined using "+" for a | |
31 | logical AND and "," or whitespace for a logical OR, and negated using | |
32 | "!". | |
33 | <h2 class="title"><a name="RULES">Rules</a></h2> | |
34 | Rules take two forms - a filename extension by itself and functions with test | |
35 | values inside parenthesis. The following functions are available: | |
c277f98c MS |
36 | <p style="margin-left: 5.0em; text-indent: -5.0em">match("pattern") |
37 | <br> | |
38 | <br> | |
39 | Pattern match on filename | |
40 | <p style="margin-left: 5.0em; text-indent: -5.0em">ascii(offset,length) | |
41 | <br> | |
42 | <br> | |
43 | True if bytes are valid printable ASCII (CR, NL, TAB, BS, 32-126) | |
44 | <p style="margin-left: 5.0em; text-indent: -5.0em">printable(offset,length) | |
45 | <br> | |
46 | <br> | |
47 | True if bytes are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254) | |
48 | <p style="margin-left: 5.0em; text-indent: -5.0em">priority(number) | |
49 | <br> | |
50 | <br> | |
51 | Specifies the relative priority of this MIME type. The default priority is 100. | |
94436c5a | 52 | Larger values have higher priority while smaller values have lower priority. |
c277f98c MS |
53 | <p style="margin-left: 5.0em; text-indent: -5.0em">string(offset,"string") |
54 | <br> | |
55 | <br> | |
56 | True if bytes are identical to string | |
57 | <p style="margin-left: 5.0em; text-indent: -5.0em">istring(offset,"string") | |
58 | <br> | |
59 | <br> | |
60 | True if a case-insensitive comparison of the bytes is identical | |
61 | <p style="margin-left: 5.0em; text-indent: -5.0em">char(offset,value) | |
62 | <br> | |
63 | <br> | |
64 | True if byte is identical | |
65 | <p style="margin-left: 5.0em; text-indent: -5.0em">short(offset,value) | |
66 | <br> | |
67 | <br> | |
68 | True if 16-bit integer is identical | |
69 | <p style="margin-left: 5.0em; text-indent: -5.0em">int(offset,value) | |
70 | <br> | |
71 | <br> | |
72 | True if 32-bit integer is identical | |
73 | <p style="margin-left: 5.0em; text-indent: -5.0em">locale("string") | |
74 | <br> | |
75 | <br> | |
76 | True if current locale matches string | |
77 | <p style="margin-left: 5.0em; text-indent: -5.0em">contains(offset,range,"string") | |
78 | <br> | |
79 | <br> | |
80 | True if the range contains the string | |
94436c5a MS |
81 | <h2 class="title"><a name="STRING_CONSTANTS">String Constants</a></h2> |
82 | String constants can be specified inside quotes ("") for strings | |
83 | containing whitespace and angle brackets (<>) for hexadecimal | |
84 | strings. | |
85 | <h2 class="title"><a name="TYPE_MATCHING_AND_PRIORITY">Type Matching And Priority</a></h2> | |
86 | When CUPS needs to determine the MIME type of a given file, it checks every | |
87 | MIME type defined in the .types files. When two types have the same matching | |
88 | rules, the type chosen will depend on the type name and priority, with higher- | |
89 | priority types being used over lower-priority ones. If the types have the same | |
90 | priority, the type names are sorted alphanumerically in ascending order and the | |
91 | first type is chosen. | |
92 | <p>For example, if two types "text/bar" and "text/foo" are defined as matching the | |
93 | extension "doc", normally the type "text/bar" will be chosen since its name is | |
94 | alphanumerically smaller than "text/foo". However, if "text/foo" also defines a | |
95 | higher priority than "text/bar", "text/foo" will be chosen instead. | |
96 | <h2 class="title"><a name="SEE_ALSO">See Also</a></h2> | |
c277f98c MS |
97 | <i>classes.conf(5)</i>, <i>cupsd(8)</i>, <i>cupsd.conf(5)</i>, |
98 | <i>mime.convs(5)</i>, <i>printers.conf(5)</i>, | |
94436c5a | 99 | <br> |
c277f98c | 100 | <a href="http://localhost:631/help">http://localhost:631/help</a> |
94436c5a MS |
101 | <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2> |
102 | Copyright 2007-2013 by Apple Inc. | |
103 | ||
104 | </body> | |
105 | </html> |