1 .TH STRING 3 "$Revision: 1.8 $"
4 strcpy, strncpy, strcat, strncat, strcmp, strncmp,
5 strlen, strindex, strrindex, strzero, str2bts,
7 btscpy, btscat, btscmp, btszero, bts2str \- operations on and
8 conversions between strings and row of bytes
11 .B #include <ack_string.h>
13 .B char *strcpy(s1, s2)
16 .B char *strncpy(s1, s2, n)
19 .B char *strcat(s1, s2)
22 .B char *strncat(s1, s2, n)
28 .B int strncmp(s1, s2, n)
34 .B char *strindex(s, c)
37 .B char *strrindex(s, c)
43 .B char *str2bts(s, b, pn)
47 .B char *long2str(l, base)
51 .B long str2long(s, base)
55 .B char *btscpy(b1, b2, n)
59 .B char *btscat(b1, n1, b2, n2)
63 .B int btscmp(b1, n1, b2, n2)
67 .B char *btszero(b, n)
71 .B char *bts2str(b, n, s)
78 functions operate on null-terminated strings.
81 functions operate on variable-length rows of bytes,
82 regardless of null bytes.
83 Neither of these functions check for overflow of any receiving area.
90 stopping after the null character has been moved.
95 truncating or null-padding
97 the target may not be null-terminated if the length
107 appends a copy of string
115 Both return a pointer to the null-terminated result
119 compares its arguments and returns an integer
120 greater than, equal to, or less than 0, if
122 is lexicographically greater than, equal to, or
127 makes the same comparison but checks at most
132 returns the number of characters before the null-character.
137 returns a pointer to the first (last)
138 occurrence of character
155 consecutive bytes, the first of which is pointed by
157 into a null-terminated string, starting at
159 Printable characters are copied and non-printable characters are transformed
160 into sequences of printable characters, representing those characters.
161 Also, back-slashes and double quotes are escaped with a back-slash.
162 The transformation agrees with the representation of non-printable
163 characters in C strings.
165 E.g., the row of 2 bytes
169 is turned into the string consisting of the following characters
171 \&'\e' '0' '0' '0' '\e' 'n' '\e0'
173 The latter string could be represented in C as "\e\e000\e\en".
178 into a sequence of bytes pointed by
180 It has the inverse effect to
182 The length of the resulting byte sequence is returned in
189 return a pointer to the result.
192 converts a long value
194 into a null-terminated string according to
196 which indicates the base to use.
197 This base may be any of 2..16.
198 A negative base (in the range -16..-2) indicates that the long must be
200 A pointer to the string is returned.
202 returns the value that is represented in
210 bytes from the string of bytes
231 compares row of bytes
239 and returns an integer greater than, equal to, or less than 0, if
241 is lexicographically greater then, equal to, or less than
248 null bytes in the string
253 ~em/modules/lib/libstring.a
255 string(3), bstring(3), atof(3)
257 No checks for overflow or illegal parameters.