From: Ian Darwin Date: Wed, 3 Oct 1990 17:56:18 +0000 (+0000) Subject: Revisions for masking operators. X-Git-Tag: FILE3_27~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bb3d2ae311ac6d19432df9cb8c6a096ab47eef6;p=file Revisions for masking operators. --- diff --git a/doc/magic.man b/doc/magic.man index 91c956bb..44cb08fa 100644 --- a/doc/magic.man +++ b/doc/magic.man @@ -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 $