STREVAL(3)
okay so welcome to STREVAL(3), the long integer arithmetic expression evaluator page โ yes bestie, we're doing math in C and it's giving "calculator but make it a library function" ๐งฎโจ
๐ธ NAME ๐ธ
streval โ long integer arithmetic expression evaluator
โจ SYNOPSIS โจ
long streval(char* s, char** e, long (*conv)(char* cs, char** ce))
๐ฆ DESCRIPTION ๐ฆ
ok so streval evaluates the long integer arithmetic expression that lives in the nul-terminated string s, and it returns the result. main character behavior, honestly ๐
If e is not 0, then *e gets set to point at the first unknown character in the expression. like it snitches on where things got weird ๐
If conv is not 0, then it gets called when an unknown token is encountered in s. cs points to the beginning of that unknown token. the return value is the long integer value of the unknown token, and ce must be set to point to the first character after the unknown token. no cap, that's the contract ๐ซถ
If an expression syntax error is encountered, then conv is called with cs set to 0 and *ce pointing to the error message text. yes bestie, that's the error-handling pipeline ๐ญ
In addition to the normal C expressions and integer constant styles, numbers in any base b <= 2 <=36 may be represented as b#nnnn, where the extra digits in nnnn are taken from [A-Z]. iconic base-flexing moment, honestly ๐
๐ SEE ALSO ๐
That's the whole page, bestie โ STREVAL(3) from the Library Functions Manual ๐ (the original footer doesn't give a date, so no fake date energy here ๐ซถ)
๐ฆ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 ยท CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 ยท CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 ยท CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 ยท CPL-1.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms