1strccpy(3GEN)      String Pattern-Matching Library Functions     strccpy(3GEN)
2
3
4

NAME

6       strccpy,  streadd,  strcadd,  strecpy  -  copy  strings, compressing or
7       expanding escape codes
8

SYNOPSIS

10       cc [ flag ... ] file ... -lgen [ library ... ]
11       #include <libgen.h>
12
13       char *strccpy(char *output, const char *input);
14
15
16       char *strcadd(char *output, const char *input);
17
18
19       char *strecpy(char *output, const char *input, const char *exceptions);
20
21
22       char *streadd(char *output, const char *input, const char *exceptions);
23
24

DESCRIPTION

26       strccpy() copies the input string, up to a null  byte,  to  the  output
27       string,  compressing  the C-language escape sequences (for example, \n,
28       \001) to the equivalent character.  A null byte is appended to the out‐
29       put.  The  output argument must point to a space big enough to accommo‐
30       date the result. If it is as big as the space pointed to by input it is
31       guaranteed to be big enough. strccpy() returns the output argument.
32
33
34       strcadd() is identical to strccpy(), except that it returns the pointer
35       to the null byte that terminates the output.
36
37
38       strecpy() copies the input string, up to a null  byte,  to  the  output
39       string, expanding non-graphic characters to their equivalent C-language
40       escape sequences (for example, \n, \001).   The  output  argument  must
41       point  to  a space big enough to accommodate the result; four times the
42       space pointed to by input is guaranteed to be big enough (each  charac‐
43       ter  could  become \ and 3 digits). Characters in the exceptions string
44       are not expanded.  The exceptions argument may  be  zero,  meaning  all
45       non-graphic characters are expanded. strecpy() returns the output argu‐
46       ment.
47
48
49       streadd() is identical to strecpy(), except that it returns the pointer
50       to the null byte that terminates the output.
51

EXAMPLES

53       Example 1 Example of expanding and compressing escape codes.
54
55         /* expand all but newline and tab */
56         strecpy( output, input, "\n\t" );
57
58         /* concatenate and compress several strings */
59         cp = strcadd( output, input1 );
60         cp = strcadd( cp, input2 );
61         cp = strcadd( cp, input3 );
62
63

ATTRIBUTES

65       See attributes(5) for descriptions of the following attributes:
66
67
68
69
70       ┌─────────────────────────────┬─────────────────────────────┐
71       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
72       ├─────────────────────────────┼─────────────────────────────┤
73       │MT-Level                     │MT-Safe                      │
74       └─────────────────────────────┴─────────────────────────────┘
75

SEE ALSO

77       string(3C), strfind(3GEN), attributes(5)
78

NOTES

80       When  compiling  multi-thread applications, the _REENTRANT flag must be
81       defined on the compile line.  This flag should only be used  in  multi-
82       thread applications.
83
84
85
86SunOS 5.11                        29 Dec 1996                    strccpy(3GEN)
Impressum