import less(1)
[unleashed/tickless.git] / share / man / man3gen / strccpy.3gen
blobb8bd605fa82319ab8cbbf767af816ef7ad2a7d29
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH STRCCPY 3GEN "Dec 29, 1996"
7 .SH NAME
8 strccpy, streadd, strcadd, strecpy \- copy strings, compressing or expanding
9 escape codes
10 .SH SYNOPSIS
11 .LP
12 .nf
13 cc [ \fIflag\fR ... ] \fIfile\fR ... \fB-lgen\fR [ \fIlibrary\fR ... ]
14 #include <libgen.h>
16 \fBchar *\fR\fBstrccpy\fR(\fBchar *\fR\fIoutput\fR, \fBconst char *\fR\fIinput\fR);
17 .fi
19 .LP
20 .nf
21 \fBchar *\fR\fBstrcadd\fR(\fBchar *\fR\fIoutput\fR, \fBconst char *\fR\fIinput\fR);
22 .fi
24 .LP
25 .nf
26 \fBchar *\fR\fBstrecpy\fR(\fBchar *\fR\fIoutput\fR, \fBconst char *\fR\fIinput\fR, \fBconst char *\fR\fIexceptions\fR);
27 .fi
29 .LP
30 .nf
31 \fBchar *\fR\fBstreadd\fR(\fBchar *\fR\fIoutput\fR, \fBconst char *\fR\fIinput\fR, \fBconst char *\fR\fIexceptions\fR);
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
37 \fBstrccpy()\fR copies the \fIinput\fR string, up to a null byte, to the
38 \fIoutput\fR string, compressing the C-language escape sequences (for example,
39 \fB\en\fR, \fB\e001\fR) to the equivalent character.  A null byte is appended
40 to the output. The \fIoutput\fR argument must point to a space big enough to
41 accommodate the result. If it is as big as the space pointed to by \fIinput\fR
42 it is guaranteed to be big enough. \fBstrccpy()\fR returns the \fIoutput\fR
43 argument.
44 .sp
45 .LP
46 \fBstrcadd()\fR is identical to \fBstrccpy()\fR, except that it returns the
47 pointer to the null byte that terminates the output.
48 .sp
49 .LP
50 \fBstrecpy()\fR copies the \fIinput\fR string, up to a null byte, to the
51 \fIoutput\fR string, expanding non-graphic characters to their equivalent
52 C-language escape sequences (for example, \fB\en\fR, \fB\e001\fR).  The
53 \fIoutput\fR argument must point to a space big enough to accommodate the
54 result; four times the  space pointed to by \fIinput\fR is guaranteed to be big
55 enough (each character could become \fB\e\fR and 3 digits). Characters in the
56 \fIexceptions\fR string are not expanded.  The \fIexceptions\fR argument may be
57 zero, meaning all non-graphic characters are expanded. \fBstrecpy()\fR returns
58 the \fIoutput\fR argument.
59 .sp
60 .LP
61 \fBstreadd()\fR is identical to \fBstrecpy()\fR, except that it returns the
62 pointer to the null byte that terminates the output.
63 .SH EXAMPLES
64 .LP
65 \fBExample 1 \fRExample of expanding and compressing escape codes.
66 .sp
67 .in +2
68 .nf
69 /* expand all but newline and tab */
70 strecpy( output, input, "\en\et" );
72 /* concatenate and compress several strings */
73 cp = strcadd( output, input1 );
74 cp = strcadd( cp, input2 );
75 cp = strcadd( cp, input3 );
76 .fi
77 .in -2
79 .SH ATTRIBUTES
80 .sp
81 .LP
82 See \fBattributes\fR(5) for descriptions of the following attributes:
83 .sp
85 .sp
86 .TS
87 box;
88 c | c
89 l | l .
90 ATTRIBUTE TYPE  ATTRIBUTE VALUE
92 MT-Level        MT-Safe
93 .TE
95 .SH SEE ALSO
96 .sp
97 .LP
98 \fBstring\fR(3C), \fBstrfind\fR(3GEN), \fBattributes\fR(5)