Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: typerules man page error: operators only for



> Can I rephase and expand on the above? - I think you are saying :
>   1. 'x' always matches anything; and can be thought of as a wildcard
>      character. 

x is a monadic operator, which only applies to numeric field types and
causes anything to be accepted  (this is the way it is actually parsed,
but an alternative interpretation is that it is a wildcard numeric
value with an implied = operator - but it wouldn't actually work with
an explicit equals, as the x would fail the call to strtol to collect
the value).

>   2. numeric types can be matched with various operators =, >, >=, etc.

Yes.  x is one of those operators.

>      When no operator is specified '=' is assumed.

Yes.

>   3. for string datatypes, anything in the match field is taken literally.

In particular, x is taken literally.  The comparison value is delimited on
the right by a tab or the end of the line, and on the left, starts at the
first non-whitespace character after the word string.

4.  ascii requires a value with the same rules as string, but ignores that
    value.

(There is one other type, "addr", but this doesn't seem of much use.  It
matches if the offset exists in the file and the value in the rule
matches the offset (not the value at the offset).)

Let's try wording that:

Numeric fields may be compared against a numeric value using one of
several operators.  There is one special operator 'x', which must not
have a value field, and causes all values to be accepted, subject to
the field actually existing in the file.  If no operator is present,
an = operator is assumed.

String fields (type 'string') have a value, but no operator (the test
is always for equality).  Leading white space is stripped from the value
and it is terminated by a tab character or the end of the line.

The special type, 'ascii', requires an offset and value, but the value
is ignored and, although the offset must not be beyond the end of the
file, it is otherwise ignored.  It causes the beginning of the file to
be checked to ensure that it only contains printable and whitespace
characters, according to the current locale (N.B. Hylafax may not operate
correctly when any locale except 'C' is used; only ASCII characters can
be considered printable in that locale).

SEE ALSO
locale, isprint, isspace



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services