xref: /titanic_50/usr/src/lib/libast/common/man/chr.3 (revision e58a33b62cd4c9a6815fd752ce58b5f389289da1)
.fp 5 CW .. .nr ;G \\n(.f .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" \\*(;G .. .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" ..

0

..

..

CHR 3
NAME
chr - character constant conversion routines
SYNOPSIS
.EX #include <ast.h> int chresc(const char* s, char** e); int chrtoi(const char* s);
DESCRIPTION
.L 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. 0 is returned and e is not modified when the end of s is reached.

.L 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, but at least its defined in one place.

The following \e escape sequences are recognized:

\e ooo The character represented by the octal code ooo .

\ex xx The character represented by the hex code xx .

.L \ea Alert (bell).

.L \eb Backspace.

.L \ef Formfeed.

.L \en Newline.

.L \er Carriage return.

.L \et Horizontal tab.

.L \ev Vertical tab.

.L \eE ESC (escape).

.L \e\e Backslash.

Other characters following \e are undefined (although for backwards compatibility they translate to themselves).

"SEE ALSO"
str(3)