'\"macro stdmacro
.if n .pH g3g.strccpy @(#)strccpy	40.7 of 10/27/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} strccpy 3G "" "\&"
.if \nX=1 .ds x} strccpy 3G ""
.if \nX=2 .ds x} strccpy 3G "" "\&"
.if \nX=3 .ds x} strccpy "" "" "\&"
.TH \*(x}
.SH "NAME"
\f4strccpy\f1: \f4streadd\f1, \f4strcadd\f1, \f4strecpy\f1 \- copy strings, compressing
or expanding escape codes
.SH "SYNOPSIS"
\f4cc\f1
[\f2flag\fP \|.\|.\|.] \f2file\fP \|.\|.\|.
\f4\-lgen\f1
[\f2library\fP \|.\|.\|.]
.PP
\f4#include <libgen.h>\f1
.PP
\f4char \(**strccpy (char \(**output, const char \(**input);\f1
.PP
\f4char \(**strcadd (char \(**output, const char \(**input);\f1
.PP
.nf
\f4char \(**strecpy (char \(**output, const char \(**input, const char
    \(**exceptions);\f1
.PP
\f4char \(**streadd (char \(**output, const char \(**input, const char
    \(**exceptions);\f1
.fi
.SH DESCRIPTION
\f4strccpy\fP
copies the
.I input
string, up to a null byte, to the
.I output
string,
compressing the C-language escape sequences (for example, \f4\en\fP, \f4\e001\fP)
to the equivalent character.  A null byte is appended to the output.
The
.I output
argument must point to a space big enough to accommodate the result.
If it is as big as the space pointed to by
.I input
it is guaranteed to be big enough.
\f4strccpy\fP
returns the
.I output
argument.
.PP
\f4strcadd\fP
is identical to \f4strccpy\fP,
except that it returns the pointer to the null byte
that terminates the output.
.PP
\f4strecpy\fP
copies the
.I input
string, up to a null byte, to the
.I output
string, expanding non-graphic characters
to their equivalent C-language escape
sequences (for example, \f4\en\fP, \f4\e001\fP).  The
.I output
argument must point to a space big enough
to accommodate the result; four times the 
space pointed to by
.I input
is guaranteed to be big enough (each character could become \f4\e\fP and 3 digits).
Characters in the
.I exceptions
string are not expanded.  The
.I exceptions
argument may be zero, meaning all non-graphic characters are expanded.
\f4strecpy\fP
returns the 
.I output 
argument
.PP
\f4streadd\fP
is identical to \f4strecpy\fP, except that it returns the pointer
to the null byte that terminates the output.
.SH EXAMPLES
.ft 4
.nf
/\(** expand all but newline and tab \(**/
strecpy( output, input, "\en\et" );
.sp 0.5
/\(** concatenate and compress several strings \(**/
cp = strcadd( output, input1 );
cp = strcadd( cp, input2 );
cp = strcadd( cp, input3 );
.fi
.ft 1
.SH "SEE ALSO"
\f4string\fP(3C), \f4str\fP(3G).
