From: Michael R Sweet
match("pattern")
-True if the filename matches the given shell wildcard pattern.
+
match("PATTERN")
+True if the filename matches the given shell wildcard PATTERN.
ascii(offset,length)
-True if the length bytes starting at offset are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+
ascii(OFFSET,LENGTH)
+True if the LENGTH bytes starting at OFFSET are valid printable ASCII (CR, NL, TAB, BS, 32-126).
+LENGTH cannot exceed 8192 bytes.
printable(offset,length)
-True if the length bytes starting at offset are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+
printable(OFFSET,LENGTH)
+True if the LENGTH bytes starting at OFFSET are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
+LENGTH cannot exceed 8192 bytes.
priority(number)
+
priority(NUMBER)
Specifies the relative priority of this MIME media type.
The default priority is 100.
Larger values have higher priority while smaller values have lower priority.
string(offset,"string")
-True if the bytes starting at offset are identical to string.
+
string(OFFSET,"STRING")
+True if the bytes starting at OFFSET are identical to STRING.
istring(offset,"string")
-True if the bytes starting at offset match string without respect to case.
+
istring(OFFSET,"STRING")
+True if the bytes starting at OFFSET match STRING without respect to case.
char(offset,value)
-True if the byte at offset is identical to value.
+
char(OFFSET,VALUE)
+True if the byte at OFFSET is identical to VALUE.
short(offset,value)
-True if the 16-bit big-endian integer at offset is identical to value.
+
short(OFFSET,VALUE)
+True if the 16-bit big-endian integer at OFFSET is identical to VALUE.
int(offset,value)
-True if the 32-bit big-endian integer at offset is identical to value.
+
int(OFFSET,VALUE)
+True if the 32-bit big-endian integer at OFFSET is identical to VALUE.
locale("string")
-True if current locale matches string.
+
locale("STRING")
+True if current locale matches STRING.
contains(offset,range,"string")
-True if the bytes starting at offset for range bytes contains string.
+
contains(OFFSET,LENGTH,"STRING")
+True if the bytes starting at OFFSET for LENGTH bytes contains STRING.
+LENGTH cannot exceed 8192 bytes.
String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings. diff --git a/man/mime.types.5 b/man/mime.types.5 index 18b6447f6e..c3eda80ed6 100644 --- a/man/mime.types.5 +++ b/man/mime.types.5 @@ -8,7 +8,7 @@ .\" Licensed under Apache License v2.0. See the file "LICENSE" for more .\" information. .\" -.TH mime.types 5 "CUPS" "2021-02-28" "OpenPrinting" +.TH mime.types 5 "CUPS" "2024-04-18" "OpenPrinting" .SH NAME mime.types \- mime type description file for cups .SH DESCRIPTION @@ -40,40 +40,43 @@ Rules take two forms - a filename extension by itself and functions with test values inside parenthesis. The following functions are available: .TP 5 -\fBmatch("\fIpattern\fB")\fR -True if the filename matches the given shell wildcard \fIpattern\fR. +\fBmatch("\fIPATTERN\fB")\fR +True if the filename matches the given shell wildcard \fIPATTERN\fR. .TP 5 -\fBascii(\fIoffset\fB,\fIlength\fB)\fR -True if the \fIlength\fR bytes starting at \fIoffset\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126). +\fBascii(\fIOFFSET\fB,\fILENGTH\fB)\fR +True if the \fILENGTH\fR bytes starting at \fIOFFSET\fR are valid printable ASCII (CR, NL, TAB, BS, 32-126). +\fILENGTH\fR cannot exceed 8192 bytes. .TP 5 -\fBprintable(\fIoffset\fB,\fIlength\fB)\fR -True if the \fIlength\fR bytes starting at \fIoffset\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254). +\fBprintable(\fIOFFSET\fB,\fILENGTH\fB)\fR +True if the \fILENGTH\fR bytes starting at \fIOFFSET\fR are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254). +\fILENGTH\fR cannot exceed 8192 bytes. .TP 5 -\fBpriority(\fInumber\fB)\fR +\fBpriority(\fINUMBER\fB)\fR Specifies the relative priority of this MIME media type. The default priority is 100. Larger values have higher priority while smaller values have lower priority. .TP 5 -\fBstring(\fIoffset\fB,"\fIstring\fB")\fR -True if the bytes starting at \fIoffset\fR are identical to \fIstring\fR. +\fBstring(\fIOFFSET\fB,"\fISTRING\fB")\fR +True if the bytes starting at \fIOFFSET\fR are identical to \fISTRING\fR. .TP 5 -\fBistring(\fIoffset\fB,"\fIstring\fB")\fR -True if the bytes starting at \fIoffset\fR match \fIstring\fR without respect to case. +\fBistring(\fIOFFSET\fB,"\fISTRING\fB")\fR +True if the bytes starting at \fIOFFSET\fR match \fISTRING\fR without respect to case. .TP 5 -\fBchar(\fIoffset\fB,\fIvalue\fB)\fR -True if the byte at \fIoffset\fR is identical to \fIvalue\fR. +\fBchar(\fIOFFSET\fB,\fIVALUE\fB)\fR +True if the byte at \fIOFFSET\fR is identical to \fIVALUE\fR. .TP 5 -\fBshort(\fIoffset\fB,\fIvalue\fB)\fR -True if the 16-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR. +\fBshort(\fIOFFSET\fB,\fIVALUE\fB)\fR +True if the 16-bit big-endian integer at \fIOFFSET\fR is identical to \fIVALUE\fR. .TP 5 -\fBint(\fIoffset\fB,\fIvalue\fB)\fR -True if the 32-bit big-endian integer at \fIoffset\fR is identical to \fIvalue\fR. +\fBint(\fIOFFSET\fB,\fIVALUE\fB)\fR +True if the 32-bit big-endian integer at \fIOFFSET\fR is identical to \fIVALUE\fR. .TP 5 -\fBlocale("\fIstring\fB")\fR -True if current locale matches \fIstring\fR. +\fBlocale("\fISTRING\fB")\fR +True if current locale matches \fISTRING\fR. .TP 5 -\fBcontains(\fIoffset\fB,\fIrange\fB,"\fIstring\fB")\fR -True if the bytes starting at \fIoffset\fR for \fIrange\fR bytes contains \fIstring\fR. +\fBcontains(\fIOFFSET\fB,\fILENGTH\fB,"\fISTRING\fB")\fR +True if the bytes starting at \fIOFFSET\fR for \fILENGTH\fR bytes contains \fISTRING\fR. +\fILENGTH\fR cannot exceed 8192 bytes. .SS STRING CONSTANTS String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings. .SS TYPE MATCHING AND PRIORITY diff --git a/scheduler/mime.h b/scheduler/mime.h index 7bb33f3cba..92e563909f 100644 --- a/scheduler/mime.h +++ b/scheduler/mime.h @@ -29,7 +29,7 @@ extern "C" { # define MIME_MAX_TYPE IPP_MAX_NAME // Maximum size of type name # define MIME_MAX_FILTER 256 // Maximum size of filter pathname -# define MIME_MAX_BUFFER 4096 // Maximum size of file buffer +# define MIME_MAX_BUFFER 8192 // Maximum size of file buffer //