~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/string.doc

Removed references to strmov and strnmov

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
  bmove(dst, src, len) moves exactly "len" bytes from the source "src"
11
11
  to the destination "dst".  It does not check for NUL characters as
12
 
  strncpy() and strnmov() do.
 
12
  strncpy() and stpncpy() do.
13
13
 
14
14
  bmove_upp(dst, src, len) moves exactly "len" bytes from the source
15
15
 "src-len" to the destination "dst-len" counting downwards.
51
51
  enough  room  in  the  space s points to; strcat has no way to tell.
52
52
  Note that strcat has to search for the end of s, so if you are doing
53
53
  a lot of concatenating it may be better to use strmov, e.g.
54
 
        strmov(strmov(strmov(strmov(s,a),b),c),d)
 
54
        stpcpy(stpcpy(stpcpy(stpcpy(s,a),b),c),d)
55
55
    rather than
56
56
        strcat(strcat(strcat(strcpy(s,a),b),c),d).
57
57
    strcat returns the old value of s.
81
81
  dst and appends a closing NUL to dst.
82
82
  strmake() returns pointer to closing null;
83
83
 
84
 
  strmov(dst, src) moves all the  characters  of  src  (including  the
 
84
  stpcpy(dst, src) moves all the  characters  of  src  (including  the
85
85
  closing NUL) to dst, and returns a pointer to the new closing NUL in
86
86
  dst.   The similar UNIX routine strcpy returns the old value of dst,
87
 
  which I have never found useful.  strmov(strmov(dst,a),b) moves a//b
 
87
  which I have never found useful.  stpcpy(stpcpy(dst,a),b) moves a//b
88
88
  into dst, which seems useful.
89
89
 
90
 
  strnmov(dst,src,length) moves length characters, or until end, of src to
 
90
  stpncpy(dst,src,length) moves length characters, or until end, of src to
91
91
  dst and appends a closing NUL to dst if src is shorter than length.
92
92
  The result is a pointer to the first NUL in dst, or is dst+n if dst was
93
93
  truncated.
111
111
 to dst.  If there aren't that many characters, a NUL character will
112
112
 be added to the end of dst to terminate it properly.  This gives the
113
113
 same effect as calling strxcpy(buff, src1, ..., srcn, NullS) with a
114
 
 large enough buffer, and then calling strnmov(dst, buff, len).
115
 
 It is just like strnmov except that it concatenates multiple sources.
 
114
 large enough buffer, and then calling stpncpy(dst, buff, len).
 
115
 It is just like stpncpy except that it concatenates multiple sources.
116
116
 Beware: the last argument should be the null character pointer.
117
117
 Take VERY great care not to omit it!  Also be careful to use NullS
118
118
 and NOT to use 0, as on some machines 0 is not the same size as a
119
119
 character pointer, or not the same bit pattern as NullS.
120
120
 
121
 
 Note: strxnmov is like strnmov in that it always moves EXACTLY len
 
121
 Note: strxnmov is like stpncpy in that it always moves EXACTLY len
122
122
 characters; dst will be padded on the right with NUL characters as
123
123
 needed.  strxncpy does the same.  strxncat, like strncat, does NOT.
124
124