CHR(3)
π NAME π
chr β character constant conversion routines. Also hii bestie, this is the CHR(3) page, and we're about to make character constants make sense, periodt. π
β¨ SYNOPSIS β¨
#include <ast.h>
int chresc(const char* s, char** e);
int chrtoi(const char* s);
πΈ DESCRIPTION πΈ
Okay so chresc converts and returns the next character constant in the 0-terminated string s. If e is not 0, then *e is set to point to the next character in s on return. When the end of s is reached, 0 is returned and e is not modified. π«Ά
chrtoi converts the 0-terminated string s to an int and returns the value. The characters in s are converted in order from the left and shifted into the int value until up to the number of characters in an int is reached. This operation is inherently machine-dependent β highkey not universal β but at least it's defined in one place, which is a slay. β¨
The following \ escape sequences are recognized:
\oooβ the character represented by the octal codeooo.\xxxβ the character represented by the hex codexx.\aβ alert (bell).\bβ backspace.\fβ formfeed.\nβ newline.\rβ carriage return.\tβ horizontal tab.\vβ vertical tab.\Eβ ESC (escape).\\β backslash.
π¨ important vibe check: other characters following \ are undefined (although for backwards compatibility they translate to themselves). So likeβ¦ don't build your whole personality on that, bestie. π
π¦ SEE ALSO π¦
str(3) β go read it, iykyk. π
β¨ okay that's the page! CHR(3) from the Library Functions Manual, and there's no date on this footer β iconic minimal behavior, ngl. catch you in the next manpage π
π«Άπ
π¦ 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