]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | .\" |
e4e5666b | 2 | .\" "$Id$" |
ef416fc2 | 3 | .\" |
27e0d6f8 | 4 | .\" mime.types man page for CUPS. |
ef416fc2 | 5 | .\" |
27e0d6f8 MS |
6 | .\" Copyright 2007-2014 by Apple Inc. |
7 | .\" Copyright 1997-2006 by Easy Software Products. | |
ef416fc2 | 8 | .\" |
27e0d6f8 MS |
9 | .\" These coded instructions, statements, and computer programs are the |
10 | .\" property of Apple Inc. and are protected by Federal copyright | |
11 | .\" law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | .\" which should have been included with this file. If this file is | |
13 | .\" file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 14 | .\" |
27e0d6f8 | 15 | .TH mime.types 5 "CUPS" "12 June 2014" "Apple Inc." |
ef416fc2 | 16 | .SH NAME |
17 | mime.types \- mime type description file for cups | |
18 | .SH DESCRIPTION | |
27e0d6f8 | 19 | The \fBmime.types\fR file defines the recognized file types. |
ef416fc2 | 20 | .LP |
27e0d6f8 | 21 | Additional file types are specified in files with the extension \fI.types\fR in the CUPS configuration directory. |
ef416fc2 | 22 | .LP |
27e0d6f8 MS |
23 | Each line in the \fBmime.types\fR file is a comment, blank, or rule line. |
24 | Comment lines start with the # character. | |
25 | Rule lines start with the MIME media type and are optionally followed by a series of file recognition rules: | |
ef416fc2 | 26 | .nf |
27 | ||
27e0d6f8 MS |
28 | \fImime/type \fR[ \fIrule \fR... \fIrule \fR] |
29 | ||
30 | .fi | |
31 | Rules can be extended over multiple lines using the backslash character (\\): | |
32 | .nf | |
33 | ||
34 | \fImime/type \fR[ \fIreally-really-really-long-rule \fR... \fB\\ | |
35 | \fIrule \fR] | |
36 | ||
ef416fc2 | 37 | .fi |
27e0d6f8 MS |
38 | MIME media types specified by the \fImime/type\fR field are case-insensitive and are sorted in ascending alphanumeric order for the purposes of matching. |
39 | See the "TYPE MATCHING AND PRIORITY" section for more information. | |
68b10830 | 40 | .LP |
27e0d6f8 MS |
41 | The rules may be grouped using parenthesis, joined using "+" for a logical AND, joined using "," or whitespace for a logical OR, and negated using "!". |
42 | .SS RULES | |
ef416fc2 | 43 | Rules take two forms - a filename extension by itself and functions with test |
27e0d6f8 MS |
44 | values inside parenthesis. |
45 | The following functions are available: | |
ef416fc2 | 46 | .TP 5 |
27e0d6f8 MS |
47 | \fBmatch("\fIpattern\fB")\fR |
48 | True if the filename matches the given shell wildcard \fIpattern\fR. | |
ef416fc2 | 49 | .TP 5 |
27e0d6f8 MS |
50 | \fBascii(\fIoffset\fB,\fIlength\fB)\fR |
51 | True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126). | |
ef416fc2 | 52 | .TP 5 |
27e0d6f8 MS |
53 | \fBprintable(\fIoffset\fB,\fIlength\fB)\fR |
54 | True if the \fIlength\fR bytes starting at \fIoffset\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254). | |
ef416fc2 | 55 | .TP 5 |
27e0d6f8 MS |
56 | \fBpriority(\fInumber\fB)\fR |
57 | Specifies the relative priority of this MIME media type. | |
58 | The default priority is 100. | |
dd1abb6b MS |
59 | Larger values have higher priority while smaller values have lower priority. |
60 | .TP 5 | |
27e0d6f8 MS |
61 | \fBstring(\fIoffset\fB,"\fIstring\fB")\fR |
62 | True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR. | |
ef416fc2 | 63 | .TP 5 |
27e0d6f8 MS |
64 | \fBistring(\fIoffset\fB,"\fIstring\fB")\fR |
65 | True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case. | |
ef416fc2 | 66 | .TP 5 |
27e0d6f8 MS |
67 | \fBchar(\fIoffset\fB,\fIvalue\fB)\fR |
68 | True if the byte at \fIoffset\fR is identical to \fIvalue\fR. | |
ef416fc2 | 69 | .TP 5 |
27e0d6f8 MS |
70 | \fBshort(\fIoffset\fB,\fIvalue\fB)\fR |
71 | True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR. | |
ef416fc2 | 72 | .TP 5 |
27e0d6f8 MS |
73 | \fBint(\fIoffset\fB,\fIvalue\fB)\fR |
74 | True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR. | |
ef416fc2 | 75 | .TP 5 |
27e0d6f8 MS |
76 | \fBlocale("\fIstring\fB")\fR |
77 | True if current locale matches \fIstring\fR. | |
ef416fc2 | 78 | .TP 5 |
27e0d6f8 MS |
79 | \fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR |
80 | True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR. | |
81 | .SS STRING CONSTANTS | |
82 | String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings. | |
83 | .SS TYPE MATCHING AND PRIORITY | |
84 | When CUPS needs to determine the MIME media type of a given file, it checks every MIME media type defined in the \fI.types\fR files. | |
85 | When two or more types match a given file, the type chosen will depend on the type name and priority, with higher-priority types being used over lower-priority ones. | |
86 | If the types have the same priority, the type names are sorted alphanumerically in ascending order and the first type is chosen. | |
68b10830 MS |
87 | .LP |
88 | For example, if two types "text/bar" and "text/foo" are defined as matching the | |
89 | extension "doc", normally the type "text/bar" will be chosen since its name is | |
27e0d6f8 MS |
90 | alphanumerically smaller than "text/foo". |
91 | However, if "text/foo" also defines a higher priority than "text/bar", "text/foo" will be chosen instead. | |
92 | .SH FILES | |
93 | \fI/etc/cups\fR - Typical CUPS configuration directory. | |
94 | .SH EXAMPLES | |
95 | Define two MIME media types for raster data, with one being a subset with higher priority: | |
96 | .nf | |
97 | ||
98 | application/vnd.cups\-raster string(0,"RaSt") string(0,"tSaR") \\ | |
99 | string(0,"RaS2") string(0,"2SaR") \\ | |
100 | string(0,"RaS3") string(0,"3SaR") | |
101 | ||
102 | image/pwg-raster string(0,"RaS2") + \\ | |
103 | string(4,PwgRaster<00>) priority(150) | |
104 | .fi | |
ef416fc2 | 105 | .SH SEE ALSO |
27e0d6f8 MS |
106 | .BR cups-files.conf (5), |
107 | .BR cupsd.conf (5), | |
108 | .BR cupsd (8), | |
109 | .BR cupsfilter (8), | |
110 | .BR mime.convs (5), | |
111 | CUPS Online Help (http://localhost:631/help) | |
ef416fc2 | 112 | .SH COPYRIGHT |
27e0d6f8 | 113 | Copyright \[co] 2007-2014 by Apple Inc. |
ef416fc2 | 114 | .\" |
e4e5666b | 115 | .\" End of "$Id$". |
ef416fc2 | 116 | .\" |