]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/man-mime.types.html
More man page 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>
23<pre>
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:
c277f98c
MS
36<p style="margin-left: 5.0em; text-indent: -5.0em">match("pattern")
37<br>
38<br>
39Pattern match on filename
40<p style="margin-left: 5.0em; text-indent: -5.0em">ascii(offset,length)
41<br>
42<br>
43True 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>
47True 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>
51Specifies the relative priority of this MIME type. The default priority is 100.
94436c5a 52Larger 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>
56True if bytes are identical to string
57<p style="margin-left: 5.0em; text-indent: -5.0em">istring(offset,"string")
58<br>
59<br>
60True 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>
64True if byte is identical
65<p style="margin-left: 5.0em; text-indent: -5.0em">short(offset,value)
66<br>
67<br>
68True if 16-bit integer is identical
69<p style="margin-left: 5.0em; text-indent: -5.0em">int(offset,value)
70<br>
71<br>
72True if 32-bit integer is identical
73<p style="margin-left: 5.0em; text-indent: -5.0em">locale("string")
74<br>
75<br>
76True if current locale matches string
77<p style="margin-left: 5.0em; text-indent: -5.0em">contains(offset,range,"string")
78<br>
79<br>
80True if the range contains the string
94436c5a
MS
81<h2 class="title"><a name="STRING_CONSTANTS">String Constants</a></h2>
82String constants can be specified inside quotes ("") for strings
83containing whitespace and angle brackets (&lt;>) for hexadecimal
84strings.
85<h2 class="title"><a name="TYPE_MATCHING_AND_PRIORITY">Type Matching And Priority</a></h2>
86When CUPS needs to determine the MIME type of a given file, it checks every
87MIME type defined in the .types files. When two types have the same matching
88rules, the type chosen will depend on the type name and priority, with higher-
89priority types being used over lower-priority ones. If the types have the same
90priority, the type names are sorted alphanumerically in ascending order and the
91first type is chosen.
92<p>For example, if two types "text/bar" and "text/foo" are defined as matching the
93extension "doc", normally the type "text/bar" will be chosen since its name is
94alphanumerically smaller than "text/foo". However, if "text/foo" also defines a
95higher 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>
102Copyright 2007-2013 by Apple Inc.
103
104</body>
105</html>