Blame man/mime.types.man

Packit 2fc92b
.\"
Packit 2fc92b
.\" mime.types man page for CUPS.
Packit 2fc92b
.\"
Packit 2fc92b
.\" Copyright 2007-2014 by Apple Inc.
Packit 2fc92b
.\" Copyright 1997-2006 by Easy Software Products.
Packit 2fc92b
.\"
Packit 2fc92b
.\" These coded instructions, statements, and computer programs are the
Packit 2fc92b
.\" property of Apple Inc. and are protected by Federal copyright
Packit 2fc92b
.\" law.  Distribution and use rights are outlined in the file "LICENSE.txt"
Packit 2fc92b
.\" which should have been included with this file.  If this file is
Packit 2fc92b
.\" file is missing or damaged, see the license at "http://www.cups.org/".
Packit 2fc92b
.\"
Packit 2fc92b
.TH mime.types 5 "CUPS" "12 June 2014" "Apple Inc."
Packit 2fc92b
.SH NAME
Packit 2fc92b
mime.types \- mime type description file for cups
Packit 2fc92b
.SH DESCRIPTION
Packit 2fc92b
The \fBmime.types\fR file defines the recognized file types.
Packit 2fc92b
.LP
Packit 2fc92b
Additional file types are specified in files with the extension \fI.types\fR in the CUPS configuration directory.
Packit 2fc92b
.LP
Packit 2fc92b
Each line in the \fBmime.types\fR file is a comment, blank, or rule line.
Packit 2fc92b
Comment lines start with the # character.
Packit 2fc92b
Rule lines start with the MIME media type and are optionally followed by a series of file recognition rules:
Packit 2fc92b
.nf
Packit 2fc92b
Packit 2fc92b
    \fImime/type \fR[ \fIrule \fR... \fIrule \fR]
Packit 2fc92b
Packit 2fc92b
.fi
Packit 2fc92b
Rules can be extended over multiple lines using the backslash character (\\):
Packit 2fc92b
.nf
Packit 2fc92b
Packit 2fc92b
    \fImime/type \fR[ \fIreally-really-really-long-rule \fR... \fB\\
Packit 2fc92b
      \fIrule \fR]
Packit 2fc92b
Packit 2fc92b
.fi
Packit 2fc92b
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.
Packit 2fc92b
See the "TYPE MATCHING AND PRIORITY" section for more information.
Packit 2fc92b
.LP
Packit 2fc92b
The rules may be grouped using parenthesis, joined using "+" for a logical AND, joined using "," or whitespace for a logical OR, and negated using "!".
Packit 2fc92b
.SS RULES
Packit 2fc92b
Rules take two forms - a filename extension by itself and functions with test
Packit 2fc92b
values inside parenthesis.
Packit 2fc92b
The following functions are available:
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBmatch("\fIpattern\fB")\fR
Packit 2fc92b
True if the filename matches the given shell wildcard \fIpattern\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBascii(\fIoffset\fB,\fIlength\fB)\fR
Packit 2fc92b
True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126).
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBprintable(\fIoffset\fB,\fIlength\fB)\fR
Packit 2fc92b
True if the \fIlength\fR bytes starting at \fIoffset\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBpriority(\fInumber\fB)\fR
Packit 2fc92b
Specifies the relative priority of this MIME media type.
Packit 2fc92b
The default priority is 100.
Packit 2fc92b
Larger values have higher priority while smaller values have lower priority.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBstring(\fIoffset\fB,"\fIstring\fB")\fR
Packit 2fc92b
True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBistring(\fIoffset\fB,"\fIstring\fB")\fR
Packit 2fc92b
True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBchar(\fIoffset\fB,\fIvalue\fB)\fR
Packit 2fc92b
True if the byte at \fIoffset\fR is identical to \fIvalue\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBshort(\fIoffset\fB,\fIvalue\fB)\fR
Packit 2fc92b
True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBint(\fIoffset\fB,\fIvalue\fB)\fR
Packit 2fc92b
True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBlocale("\fIstring\fB")\fR
Packit 2fc92b
True if current locale matches \fIstring\fR.
Packit 2fc92b
.TP 5
Packit 2fc92b
\fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR
Packit 2fc92b
True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR.
Packit 2fc92b
.SS STRING CONSTANTS
Packit 2fc92b
String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings.
Packit 2fc92b
.SS TYPE MATCHING AND PRIORITY
Packit 2fc92b
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.
Packit 2fc92b
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.
Packit 2fc92b
If the types have the same priority, the type names are sorted alphanumerically in ascending order and the first type is chosen.
Packit 2fc92b
.LP
Packit 2fc92b
For example, if two types "text/bar" and "text/foo" are defined as matching the
Packit 2fc92b
extension "doc", normally the type "text/bar" will be chosen since its name is
Packit 2fc92b
alphanumerically smaller than "text/foo".
Packit 2fc92b
However, if "text/foo" also defines a higher priority than "text/bar", "text/foo" will be chosen instead.
Packit 2fc92b
.SH FILES
Packit 2fc92b
\fI/etc/cups\fR - Typical CUPS configuration directory.
Packit 2fc92b
.SH EXAMPLES
Packit 2fc92b
Define two MIME media types for raster data, with one being a subset with higher priority:
Packit 2fc92b
.nf
Packit 2fc92b
Packit 2fc92b
    application/vnd.cups\-raster  string(0,"RaSt") string(0,"tSaR") \\
Packit 2fc92b
                                  string(0,"RaS2") string(0,"2SaR") \\
Packit 2fc92b
                                  string(0,"RaS3") string(0,"3SaR")
Packit 2fc92b
Packit 2fc92b
    image/pwg-raster              string(0,"RaS2") + \\
Packit 2fc92b
                                  string(4,PwgRaster<00>) priority(150)
Packit 2fc92b
.fi
Packit 2fc92b
.SH SEE ALSO
Packit 2fc92b
.BR cups-files.conf (5),
Packit 2fc92b
.BR cupsd.conf (5),
Packit 2fc92b
.BR cupsd (8),
Packit 2fc92b
.BR cupsfilter (8),
Packit 2fc92b
.BR mime.convs (5),
Packit 2fc92b
CUPS Online Help (http://localhost:631/help)
Packit 2fc92b
.SH COPYRIGHT
Packit 2fc92b
Copyright \[co] 2007-2017 by Apple Inc.