Blame src/lib/libast/man/astsa.3

Packit Service a8c26c
.fp 5 CW
Packit Service a8c26c
.de Af
Packit Service a8c26c
.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
Packit Service a8c26c
.if !?\\$4?? .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
Packit Service a8c26c
..
Packit Service a8c26c
.de aF
Packit Service a8c26c
.ie ?\\$3?? .ft \\$1
Packit Service a8c26c
.el \{\
Packit Service a8c26c
.ds ;G \&
Packit Service a8c26c
.nr ;G \\n(.f
Packit Service a8c26c
.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
Packit Service a8c26c
\\*(;G
Packit Service a8c26c
.ft \\n(;G \}
Packit Service a8c26c
..
Packit Service a8c26c
.de L
Packit Service a8c26c
.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
Packit Service a8c26c
..
Packit Service a8c26c
.de LR
Packit Service a8c26c
.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
Packit Service a8c26c
..
Packit Service a8c26c
.de RL
Packit Service a8c26c
.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
Packit Service a8c26c
..
Packit Service a8c26c
.de EX		\" start example
Packit Service a8c26c
.ta 1i 2i 3i 4i 5i 6i
Packit Service a8c26c
.PP
Packit Service a8c26c
.PD 0
Packit Service a8c26c
.ft 5
Packit Service a8c26c
.nf
Packit Service a8c26c
..
Packit Service a8c26c
.de EE		\" end example
Packit Service a8c26c
.fi
Packit Service a8c26c
.ft
Packit Service a8c26c
.PD
Packit Service a8c26c
.PP
Packit Service a8c26c
..
Packit Service a8c26c
.de Tp
Packit Service a8c26c
.fl
Packit Service a8c26c
.ne 3
Packit Service a8c26c
.TP
Packit Service a8c26c
..
Packit Service a8c26c
.de Ss
Packit Service a8c26c
.fl
Packit Service a8c26c
.ne 3
Packit Service a8c26c
.SS "\\$1"
Packit Service a8c26c
..
Packit Service a8c26c
.ta 1.0i 2.0i 3.0i 4.0i 5.0i
Packit Service a8c26c
.TH ASTSA 3
Packit Service a8c26c
.SH NAME
Packit Service a8c26c
astsa \- standalone libast support
Packit Service a8c26c
.SH SYNOPSIS
Packit Service a8c26c
.EX
Packit Service a8c26c
#include <ast.h>
Packit Service a8c26c
#include <ccode.h>
Packit Service a8c26c
#include <error.h>
Packit Service a8c26c
#include <option.h>
Packit Service a8c26c
#include <stk.h>
Packit Service a8c26c
.EE
Packit Service a8c26c
.SH DESCRIPTION
Packit Service a8c26c
.B astsa
Packit Service a8c26c
is a standalone subset of
Packit Service a8c26c
.BR ast (3)
Packit Service a8c26c
that requires only
Packit Service a8c26c
.BR cdt (3)
Packit Service a8c26c
and
Packit Service a8c26c
.BR sfio (3).
Packit Service a8c26c
.PP
Packit Service a8c26c
.B <ast.h>
Packit Service a8c26c
includes
Packit Service a8c26c
.BR <ast_common.h> ,
Packit Service a8c26c
.B <stdarg.h>
Packit Service a8c26c
or
Packit Service a8c26c
.BR <varargs.h> ,
Packit Service a8c26c
.BR <sfio.h> ,
Packit Service a8c26c
.BR <limits.h> ,
Packit Service a8c26c
and
Packit Service a8c26c
.B <limits.h>
Packit Service a8c26c
and
Packit Service a8c26c
.B <unistd.h>
Packit Service a8c26c
if supported by the local system.
Packit Service a8c26c
.PP
Packit Service a8c26c
The macros and functions provided by
Packit Service a8c26c
.B <ast.h>
Packit Service a8c26c
are described below.
Packit Service a8c26c
The other headers are described in
Packit Service a8c26c
.BR ccode (3),
Packit Service a8c26c
.BR error (3),
Packit Service a8c26c
.BR optget (3),
Packit Service a8c26c
and
Packit Service a8c26c
.BR stk (3).
Packit Service a8c26c
.SH MACROS
Packit Service a8c26c
.Ss "size_t elementsof(\fIx\fP)"
Packit Service a8c26c
Evaluates to the number of elements in the array variable
Packit Service a8c26c
.IR x .
Packit Service a8c26c
.Ss "\fItype\fP* newof(void* old, \fItype\fP, size_t \fIelements\fP, size_t \fIextra\fP)"
Packit Service a8c26c
Equivalent to (\fItype\fP*)realloc((char*)\fIold\fP,sizeof(\fItype\fP)*\fIelements\fP+\fIextra\fP)
Packit Service a8c26c
if \fIold\fP!=0 and
Packit Service a8c26c
(\fItype\fP*)calloc(1,sizeof(\fItype\fP)*\fIelements\fP+\fIextra\fP)
Packit Service a8c26c
otherwise.
Packit Service a8c26c
.Ss "\fItype\fP* oldof(void* old, \fItype\fP, size_t \fIelements\fP, size_t \fIextra\fP)"
Packit Service a8c26c
Equivalent to (\fItype\fP*)realloc((char*)\fIold\fP,sizeof(\fItype\fP)*\fIelements\fP+\fIextra\fP)
Packit Service a8c26c
if \fIold\fP!=0 and
Packit Service a8c26c
(\fItype\fP*)malloc(1,sizeof(\fItype\fP)*\fIelements\fP+\fIextra\fP)
Packit Service a8c26c
otherwise.
Packit Service a8c26c
.Ss "size_t roundof(\fIx\fP,\fIy\fP)"
Packit Service a8c26c
Evaluates to \fIx\fP rounded up to the next power of 2 boundary \fIy\fP.
Packit Service a8c26c
.Ss "int ssizeof(\fIx\fP)"
Packit Service a8c26c
Equivalent to (int)sizeof(\fIx\fP).
Packit Service a8c26c
.Ss "int streq(\fIa\fP,\fIb\fP)"
Packit Service a8c26c
Equivalent to (*(\fIa\fP)==*(\fIb\fP)&&strcmp(\fIa\fP,\fIb\fP)==0).
Packit Service a8c26c
.Ss "int strneq(\fIa\fP,\fIb\fP,\fIn\fP)"
Packit Service a8c26c
Equivalent to (*(\fIa\fP)==*(\fIb\fP)&&strncmp(\fIa\fP,\fIb\fP,\fIn\fP)==0).
Packit Service a8c26c
.SH FUNCTIONS
Packit Service a8c26c
.Ss "void astwinsize(int \fIfd\fP, int* \fIplines\fP, int* \fIpcolumns\fP)"
Packit Service a8c26c
If \fIplines\fP!=0 then *\fIplines\fP is set to the number of lines on the
Packit Service a8c26c
tty device corresponding to \fIfd\fP.
Packit Service a8c26c
If \fIpcolumns\fP!=0 then *\fIpcolumns\fP is set to the number of columns
Packit Service a8c26c
on the tty device corresponding to \fIfd\fP.
Packit Service a8c26c
The default if \fIfd\fP is not a terminal device, or if \fIfd\fP queries fail,
Packit Service a8c26c
is 24 lines and 80 columns.
Packit Service a8c26c
.Ss "char* fmterror(int \fIerrno\fP)"
Packit Service a8c26c
Returns the error message text corresponding to the
Packit Service a8c26c
.BR errno (3)
Packit Service a8c26c
\fIerrno\fP.
Packit Service a8c26c
.Ss "char* strerror(int \fIerrno\fP)"
Packit Service a8c26c
Equivalent to fmterror(\fIerrno\fP).
Packit Service a8c26c
.Ss "int strgrpmatch(const char* \fIstring\fP, const char* \fIpattern\fP, int* \fIsub\fP, int \fInsub\fP, int \fIflags\fP)"
Packit Service a8c26c
Matches the null terminated \fIstring\fP against the null terminated
Packit Service a8c26c
.BR ksh (1)
Packit Service a8c26c
augmented \fIpattern\fP.
Packit Service a8c26c
If \fIsub\fP!=0 then \fIsub\fP[2*\fIi\fP] is set to the start offset and \fIsub\fP[2*\fIi\fP+1] is set
Packit Service a8c26c
to the end offset of the \fIi\fP-th parenthesized subexpression.
Packit Service a8c26c
\fInsub\fP is 1/2 the number of elements in \fIsub\fP.
Packit Service a8c26c
\fIflags\fP controls the matching:
Packit Service a8c26c
.Tp
Packit Service a8c26c
\f5STR_MAXIMAL\fP:
Packit Service a8c26c
Maximal match.
Packit Service a8c26c
The default is minimal (first) match.
Packit Service a8c26c
.Tp
Packit Service a8c26c
\f5STR_LEFT\fP:
Packit Service a8c26c
Implicit left anchor.
Packit Service a8c26c
.Tp
Packit Service a8c26c
\f5STR_RIGHT\fP:
Packit Service a8c26c
Implicit right anchor.
Packit Service a8c26c
.Tp
Packit Service a8c26c
\f5STR_ICASE\fP:
Packit Service a8c26c
Ignore case.
Packit Service a8c26c
.Tp
Packit Service a8c26c
\f5STR_GROUP\fP:
Packit Service a8c26c
(|&) inside [@|*|+{n,m}](...) only.
Packit Service a8c26c
.Ss "int strmatch(const char* \fIstring\fP, const char* \fIpattern\fP, int* \fIsub\fP, int \fInsub\fP, int \fIflags\fP)"
Packit Service a8c26c
Equivalent to strgrpmatch(\fIstring\fP,\fIpattern\fP,0,0,STR_MAXIMAL|STR_LEFT|STR_RIGHT).
Packit Service a8c26c
.SH "SEE ALSO"
Packit Service a8c26c
.BR ast (3),
Packit Service a8c26c
.BR ccode (3),
Packit Service a8c26c
.BR cdt (3),
Packit Service a8c26c
.BR error (3),
Packit Service a8c26c
.BR malloc (3),
Packit Service a8c26c
.BR option (3),
Packit Service a8c26c
.BR sfio (3),
Packit Service a8c26c
.BR stk (3)