]> granicus.if.org Git - file/commitdiff
Revisions for masking operators.
authorIan Darwin <ian@darwinsys.com>
Wed, 3 Oct 1990 17:56:18 +0000 (17:56 +0000)
committerIan Darwin <ian@darwinsys.com>
Wed, 3 Oct 1990 17:56:18 +0000 (17:56 +0000)
doc/magic.man

index 91c956bb12be002532f0f4f049cbfd8abc8f5575..44cb08faa6c842e665318df6f51887757bf63818 100644 (file)
@@ -35,6 +35,28 @@ A four-byte value (on most systems).
 .IP string
 A string of bytes.
 .RE
+.IP
+The types
+.BR byte ,
+.BR short ,
+and
+.B long
+may optionally be followed by a mask
+specifier of the form
+.BI & number\fR.
+If a mask specifier is given, the value is
+.SM AND\s0'ed
+with the
+.I number
+before any comparisons are done.  The
+.I number
+is specified in C form; for instance,
+.B 13
+is decimal,
+.B 013
+is octal, and
+.B 0x13
+is hexadecimal.
 .IP test
 The value to be compared with the value from the file.  If the type is
 numeric, this value
@@ -52,24 +74,21 @@ value,
 .BR > ,
 to specify that the value from the file must be greater than the specified
 value,
-or
 .BR & ,
-to specify that the value is to be AND'ed with the
-numeric value before any comparisons are done.
-Numeric values are specified in C form; e.g.
-.B 13
-is decimal,
-.B 013
-is octal, and
-.B 0x13
-is hexadecimal.
+to specify that all the bits in the specified
+value must be set in the value from the file,
+.BR ^ ,
+to specify that at least one of the bits in
+the specified value must not be set in the
+value from the file, or
+.B x
 to specify that any value will match.  If the character
 is omitted, it is assumed to be
 .BR = .
 .IP
 For string values, the byte string from the
 file must match the specified byte string. 
-The operators =, < and > (but not &) can be applied to strings.
+The operators =, < and > (but not &, ^, or x) can be applied to strings.
 The length used for matching is that of the string argument
 in the magic file.
 .IP message
@@ -122,4 +141,4 @@ at the beginning of the line.
 .\" the changes I posted to the S5R2 version.
 .\"
 .\" Modified for Ian Darwin's version of the file command.
-.\" @(#)$Header: /home/glen/git/file/cvs/file/doc/magic.man,v 1.5 1987/11/06 20:54:31 ian Exp $
+.\" @(#)$Header: /home/glen/git/file/cvs/file/doc/magic.man,v 1.6 1990/10/03 17:56:18 ian Exp $