diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-06-24 22:28:35 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-06-24 22:28:35 +0000 |
commit | 3950ffe2a485479f6561c27364d3d7df5a21d124 (patch) | |
tree | 468c6e14449d1b1e279222ec32f676b0311917d2 /src/lib/libast/man/chr.3 | |
download | ksh-3950ffe2a485479f6561c27364d3d7df5a21d124.tar.gz |
Imported Upstream version 93u+upstream
Diffstat (limited to 'src/lib/libast/man/chr.3')
-rw-r--r-- | src/lib/libast/man/chr.3 | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/src/lib/libast/man/chr.3 b/src/lib/libast/man/chr.3 new file mode 100644 index 0000000..8d57648 --- /dev/null +++ b/src/lib/libast/man/chr.3 @@ -0,0 +1,126 @@ +.fp 5 CW +.de Af +.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2 +.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" +.. +.de aF +.ie \\$3 .ft \\$1 +.el \{\ +.ds ;G \& +.nr ;G \\n(.f +.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" +\\*(;G +.ft \\n(;G \} +.. +.de L +.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de LR +.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de RL +.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" +.. +.de EX \" start example +.ta 1i 2i 3i 4i 5i 6i +.PP +.RS +.PD 0 +.ft 5 +.nf +.. +.de EE \" end example +.fi +.ft +.PD +.RE +.PP +.. +.TH CHR 3 +.SH NAME +chr \- character constant conversion routines +.SH SYNOPSIS +.EX +#include <ast.h> + +int chresc(const char* \fIs\fP, char** \fIe\fP); +int chrtoi(const char* \fIs\fP); +.EE +.SH DESCRIPTION +.L chresc +converts and returns the next character constant in the 0-terminated string +.IR s . +If +.I e +is not 0 then +.I *e +is set to point to the next character in +.I s +on return. +0 is returned and +.I e +is not modified when the end of +.I s +is reached. +.PP +.L chrtoi +converts the 0-terminated string +.I s +to an +.I int +and returns the value. +The characters in +.I s +are converted in order from the left and shifted into the +.I int +value until up to the number of characters in an +.I int +is reached. +This operation is inherently machine-dependent, +but at least its defined in one place. +.PP +The following +.B \e +escape sequences are recognized: +.TP +.RI \e ooo +The character represented by the octal code +.IR ooo . +.TP +.RI \ex xx +The character represented by the hex code +.IR xx . +.TP +.L \ea +Alert (bell). +.TP +.L \eb +Backspace. +.TP +.L \ef +Formfeed. +.TP +.L \en +Newline. +.TP +.L \er +Carriage return. +.TP +.L \et +Horizontal tab. +.TP +.L \ev +Vertical tab. +.TP +.L \eE +ESC (escape). +.TP +.L \e\e +Backslash. +.PP +Other characters following +.B \e +are undefined (although for backwards compatibility they +translate to themselves). +.SH "SEE ALSO" +str(3) |