1.fp 5 CW
2.de Af
3.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
5..
6.de aF
7.ie \\$3 .ft \\$1
8.el \{\
9.ds ;G \&
10.nr ;G \\n(.f
11.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
12\\*(;G
13.ft \\n(;G \}
14..
15.de L
16.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
17..
18.de LR
19.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
20..
21.de RL
22.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
23..
24.de EX		\" start example
25.ta 1i 2i 3i 4i 5i 6i
26.PP
27.RS 
28.PD 0
29.ft 5
30.nf
31..
32.de EE		\" end example
33.fi
34.ft
35.PD
36.RE
37.PP
38..
39.TH STREVAL 3
40.SH NAME
41streval \- long integer arithmetic expression evaluator
42.SH SYNOPSIS
43.L "long streval(char* s, char** e, long (*conv)(char* cs, char** ce))"
44.SH DESCRIPTION
45.I streval
46evaluates the long integer arithmetic expression in the nul-terminated string
47.I s
48and returns the result.
49If
50.I e
51is not 0 then
52.I *e
53is set to point to the first unknown character in the expression.
54.PP
55If
56.I conv
57is not 0 then it is called when an unknown token is encountered in
58.IR s .
59.I cs
60points to the beginning of the unknown token.
61The return value is the long integer value of the unknown token and
62.I ce
63must be set to point to the first character after the unknown token.
64If an expression syntax error is encountered the
65.I conv
66is called with
67.I cs
68set to 0 and
69.I *ce
70pointing to the error message text.
71.PP
72In addition to the normal C expressions and integer constant styles,
73numbers in any base
74.I b
75<= 2 <=36
76may be represented as
77.IR b # nnnn ,
78where the extra digits in
79.I nnnn
80are taken from
81.BR [A-Z] .
82.SH "SEE ALSO"
83strtol(3)
84