da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ie \\$3 .ft \\$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nr ;G \\n(.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft \\n(;G \}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EX \" start example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ta 1i 2i 3i 4i 5i 6i
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EE \" end example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.TH STROPT 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstropt \- table driven option expression evaluator
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH SYNOPSIS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "#include <namval.h>"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "int stropt(char* s, struct namval* tab,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L " int (*fun)(void* a, struct namval* p, int n, char* v),"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L " void* a)"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH DESCRIPTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinparses option expressions in the nul-terminated string
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinusing the option names in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis an array of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.B "struct namval"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinname value pairs:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinchar* name;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe last entry must be followed by a sentinel with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAn option expression contains 0 or more of [\fBno\fP]\fIname\fP[=\fIvalue\fP]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinseparate by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmust be one of the option names in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis an optional value, and
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis for Boolean options.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinEach option is passed to
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor processing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpointer that is passed from the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincall but is otherwise not interpreted.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpoints to the option name value pair from
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulknerpreceded the option
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpoints to the beginning of the option
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis not found in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis called with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpointing to an internal
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I p\->name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpointing to the unknown option and
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I p\->value
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinof the sentinel entry in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns non-zero then this value is returned and no further
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinoptions are processed.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns 0 after processing all options.