STREVAL(3)

๐Ÿ“ฆ version 93vu, in opensuse-leap 16.0

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