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