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