]> git.ipfire.org Git - thirdparty/cups.git/blame - man/mime.types.man
Import CUPS v2.0b1
[thirdparty/cups.git] / man / mime.types.man
CommitLineData
ef416fc2 1.\"
1a18c85c 2.\" "$Id: mime.types.man 11924 2014-06-12 19:10:33Z msweet $"
ef416fc2 3.\"
1a18c85c 4.\" mime.types man page for CUPS.
ef416fc2 5.\"
1a18c85c
MS
6.\" Copyright 2007-2014 by Apple Inc.
7.\" Copyright 1997-2006 by Easy Software Products.
ef416fc2 8.\"
1a18c85c
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.\"
1a18c85c 15.TH mime.types 5 "CUPS" "12 June 2014" "Apple Inc."
ef416fc2 16.SH NAME
17mime.types \- mime type description file for cups
18.SH DESCRIPTION
1a18c85c 19The \fBmime.types\fR file defines the recognized file types.
ef416fc2 20.LP
1a18c85c 21Additional file types are specified in files with the extension \fI.types\fR in the CUPS configuration directory.
ef416fc2 22.LP
1a18c85c
MS
23Each line in the \fBmime.types\fR file is a comment, blank, or rule line.
24Comment lines start with the # character.
25Rule lines start with the MIME media type and are optionally followed by a series of file recognition rules:
ef416fc2 26.nf
27
1a18c85c
MS
28 \fImime/type \fR[ \fIrule \fR... \fIrule \fR]
29
30.fi
31Rules 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
1a18c85c
MS
38MIME media types specified by the \fImime/type\fR field are case-insensitive and are sorted in ascending alphanumeric order for the purposes of matching.
39See the "TYPE MATCHING AND PRIORITY" section for more information.
68b10830 40.LP
1a18c85c
MS
41The 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 43Rules take two forms - a filename extension by itself and functions with test
1a18c85c
MS
44values inside parenthesis.
45The following functions are available:
ef416fc2 46.TP 5
1a18c85c
MS
47\fBmatch("\fIpattern\fB")\fR
48True if the filename matches the given shell wildcard \fIpattern\fR.
ef416fc2 49.TP 5
1a18c85c
MS
50\fBascii(\fIoffset\fB,\fIlength\fB)\fR
51True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126).
ef416fc2 52.TP 5
1a18c85c
MS
53\fBprintable(\fIoffset\fB,\fIlength\fB)\fR
54True 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
1a18c85c
MS
56\fBpriority(\fInumber\fB)\fR
57Specifies the relative priority of this MIME media type.
58The default priority is 100.
dd1abb6b
MS
59Larger values have higher priority while smaller values have lower priority.
60.TP 5
1a18c85c
MS
61\fBstring(\fIoffset\fB,"\fIstring\fB")\fR
62True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR.
ef416fc2 63.TP 5
1a18c85c
MS
64\fBistring(\fIoffset\fB,"\fIstring\fB")\fR
65True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case.
ef416fc2 66.TP 5
1a18c85c
MS
67\fBchar(\fIoffset\fB,\fIvalue\fB)\fR
68True if the byte at \fIoffset\fR is identical to \fIvalue\fR.
ef416fc2 69.TP 5
1a18c85c
MS
70\fBshort(\fIoffset\fB,\fIvalue\fB)\fR
71True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
ef416fc2 72.TP 5
1a18c85c
MS
73\fBint(\fIoffset\fB,\fIvalue\fB)\fR
74True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
ef416fc2 75.TP 5
1a18c85c
MS
76\fBlocale("\fIstring\fB")\fR
77True if current locale matches \fIstring\fR.
ef416fc2 78.TP 5
1a18c85c
MS
79\fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR
80True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR.
81.SS STRING CONSTANTS
82String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings.
83.SS TYPE MATCHING AND PRIORITY
84When 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.
85When 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.
86If 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
88For example, if two types "text/bar" and "text/foo" are defined as matching the
89extension "doc", normally the type "text/bar" will be chosen since its name is
1a18c85c
MS
90alphanumerically smaller than "text/foo".
91However, 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
95Define 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
1a18c85c
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),
111CUPS Online Help (http://localhost:631/help)
ef416fc2 112.SH COPYRIGHT
1a18c85c 113Copyright \[co] 2007-2014 by Apple Inc.
ef416fc2 114.\"
1a18c85c 115.\" End of "$Id: mime.types.man 11924 2014-06-12 19:10:33Z msweet $".
ef416fc2 116.\"