]> git.ipfire.org Git - thirdparty/cups.git/blob - man/mime.types.man
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / man / mime.types.man
1 .\"
2 .\" mime.types man page for CUPS.
3 .\"
4 .\" Copyright 2007-2014 by Apple Inc.
5 .\" Copyright 1997-2006 by Easy Software Products.
6 .\"
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/".
12 .\"
13 .TH mime.types 5 "CUPS" "12 June 2014" "Apple Inc."
14 .SH NAME
15 mime.types \- mime type description file for cups
16 .SH DESCRIPTION
17 The \fBmime.types\fR file defines the recognized file types.
18 .LP
19 Additional file types are specified in files with the extension \fI.types\fR in the CUPS configuration directory.
20 .LP
21 Each line in the \fBmime.types\fR file is a comment, blank, or rule line.
22 Comment lines start with the # character.
23 Rule lines start with the MIME media type and are optionally followed by a series of file recognition rules:
24 .nf
25
26 \fImime/type \fR[ \fIrule \fR... \fIrule \fR]
27
28 .fi
29 Rules 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
35 .fi
36 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.
37 See the "TYPE MATCHING AND PRIORITY" section for more information.
38 .LP
39 The 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
41 Rules take two forms - a filename extension by itself and functions with test
42 values inside parenthesis.
43 The following functions are available:
44 .TP 5
45 \fBmatch("\fIpattern\fB")\fR
46 True if the filename matches the given shell wildcard \fIpattern\fR.
47 .TP 5
48 \fBascii(\fIoffset\fB,\fIlength\fB)\fR
49 True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126).
50 .TP 5
51 \fBprintable(\fIoffset\fB,\fIlength\fB)\fR
52 True if the \fIlength\fR bytes starting at \fIoffset\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
53 .TP 5
54 \fBpriority(\fInumber\fB)\fR
55 Specifies the relative priority of this MIME media type.
56 The default priority is 100.
57 Larger values have higher priority while smaller values have lower priority.
58 .TP 5
59 \fBstring(\fIoffset\fB,"\fIstring\fB")\fR
60 True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR.
61 .TP 5
62 \fBistring(\fIoffset\fB,"\fIstring\fB")\fR
63 True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case.
64 .TP 5
65 \fBchar(\fIoffset\fB,\fIvalue\fB)\fR
66 True if the byte at \fIoffset\fR is identical to \fIvalue\fR.
67 .TP 5
68 \fBshort(\fIoffset\fB,\fIvalue\fB)\fR
69 True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
70 .TP 5
71 \fBint(\fIoffset\fB,\fIvalue\fB)\fR
72 True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
73 .TP 5
74 \fBlocale("\fIstring\fB")\fR
75 True if current locale matches \fIstring\fR.
76 .TP 5
77 \fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR
78 True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR.
79 .SS STRING CONSTANTS
80 String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings.
81 .SS TYPE MATCHING AND PRIORITY
82 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.
83 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.
84 If the types have the same priority, the type names are sorted alphanumerically in ascending order and the first type is chosen.
85 .LP
86 For example, if two types "text/bar" and "text/foo" are defined as matching the
87 extension "doc", normally the type "text/bar" will be chosen since its name is
88 alphanumerically smaller than "text/foo".
89 However, 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
93 Define 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
103 .SH SEE ALSO
104 .BR cups-files.conf (5),
105 .BR cupsd.conf (5),
106 .BR cupsd (8),
107 .BR cupsfilter (8),
108 .BR mime.convs (5),
109 CUPS Online Help (http://localhost:631/help)
110 .SH COPYRIGHT
111 Copyright \[co] 2007-2015 by Apple Inc.