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