]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/man-mime.types.html
More updates.
[thirdparty/cups.git] / doc / help / man-mime.types.html
1 <!DOCTYPE HTML>
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 class="man">
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:
36 <dl class="man">
37 <dt>match("pattern")
38 <dd style="margin-left: 5.0em"><br>
39 Pattern match on filename
40 <dt>ascii(offset,length)
41 <dd style="margin-left: 5.0em"><br>
42 True if bytes are valid printable ASCII (CR, NL, TAB, BS, 32-126)
43 <dt>printable(offset,length)
44 <dd style="margin-left: 5.0em"><br>
45 True if bytes are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254)
46 <dt>priority(number)
47 <dd style="margin-left: 5.0em"><br>
48 Specifies the relative priority of this MIME type. The default priority is 100.
49 Larger values have higher priority while smaller values have lower priority.
50 <dt>string(offset,"string")
51 <dd style="margin-left: 5.0em"><br>
52 True if bytes are identical to string
53 <dt>istring(offset,"string")
54 <dd style="margin-left: 5.0em"><br>
55 True if a case-insensitive comparison of the bytes is identical
56 <dt>char(offset,value)
57 <dd style="margin-left: 5.0em"><br>
58 True if byte is identical
59 <dt>short(offset,value)
60 <dd style="margin-left: 5.0em"><br>
61 True if 16-bit integer is identical
62 <dt>int(offset,value)
63 <dd style="margin-left: 5.0em"><br>
64 True if 32-bit integer is identical
65 <dt>locale("string")
66 <dd style="margin-left: 5.0em"><br>
67 True if current locale matches string
68 <dt>contains(offset,range,"string")
69 <dd style="margin-left: 5.0em"><br>
70 True if the range contains the string
71 </dl>
72 <h2 class="title"><a name="STRING_CONSTANTS">String Constants</a></h2>
73 String constants can be specified inside quotes ("") for strings
74 containing whitespace and angle brackets (&lt;>) for hexadecimal
75 strings.
76 <h2 class="title"><a name="TYPE_MATCHING_AND_PRIORITY">Type Matching And Priority</a></h2>
77 When CUPS needs to determine the MIME type of a given file, it checks every
78 MIME type defined in the .types files. When two types have the same matching
79 rules, the type chosen will depend on the type name and priority, with higher-
80 priority types being used over lower-priority ones. If the types have the same
81 priority, the type names are sorted alphanumerically in ascending order and the
82 first type is chosen.
83 <p>For example, if two types "text/bar" and "text/foo" are defined as matching the
84 extension "doc", normally the type "text/bar" will be chosen since its name is
85 alphanumerically smaller than "text/foo". However, if "text/foo" also defines a
86 higher priority than "text/bar", "text/foo" will be chosen instead.
87 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
88 <i>classes.conf(5)</i>, <i>cupsd(8)</i>, <i>cupsd.conf(5)</i>,
89 <i>mime.convs(5)</i>, <i>printers.conf(5)</i>,
90 <br>
91 <a href="http://localhost:631/help">http://localhost:631/help</a>
92 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
93 Copyright 2007-2013 by Apple Inc.
94
95 </body>
96 </html>