~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to strings/string.doc

  • Committer: Brian Aker
  • Date: 2008-07-14 22:40:46 UTC
  • Revision ID: brian@tangent.org-20080714224046-x183907w9wp1txwv
Removed sql_manager. Ever heard of just setting up the OS to sync when you
want it to?

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 stpncpy() do.
 
12
  strncpy() and strnmov() 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
 
        stpcpy(stpcpy(stpcpy(stpcpy(s,a),b),c),d)
 
54
        strmov(strmov(strmov(strmov(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.
60
60
  strcend(s, c) returns a pointer to the  first  place  in  s   where  c
61
61
  occurs,  or a pointer to the end-null of s if c does not occur in s.
62
62
 
 
63
  strcont(str, set) if str contanies any character in the string set.
 
64
  The result is the position of the first found character in str, or NullS
 
65
  if there isn't anything found.
 
66
 
63
67
  strend(s) returns a character pointer to the NUL which ends s.  That
64
68
  is,  strend(s)-s  ==  strlen(s). This is useful for adding things at
65
69
  the end of strings.  It is redundant, because  strchr(s,'\0')  could
77
81
  dst and appends a closing NUL to dst.
78
82
  strmake() returns pointer to closing null;
79
83
 
80
 
  stpcpy(dst, src) moves all the  characters  of  src  (including  the
 
84
  strmov(dst, src) moves all the  characters  of  src  (including  the
81
85
  closing NUL) to dst, and returns a pointer to the new closing NUL in
82
86
  dst.   The similar UNIX routine strcpy returns the old value of dst,
83
 
  which I have never found useful.  stpcpy(stpcpy(dst,a),b) moves a//b
 
87
  which I have never found useful.  strmov(strmov(dst,a),b) moves a//b
84
88
  into dst, which seems useful.
85
89
 
86
 
  stpncpy(dst,src,length) moves length characters, or until end, of src to
 
90
  strnmov(dst,src,length) moves length characters, or until end, of src to
87
91
  dst and appends a closing NUL to dst if src is shorter than length.
88
92
  The result is a pointer to the first NUL in dst, or is dst+n if dst was
89
93
  truncated.
107
111
 to dst.  If there aren't that many characters, a NUL character will
108
112
 be added to the end of dst to terminate it properly.  This gives the
109
113
 same effect as calling strxcpy(buff, src1, ..., srcn, NullS) with a
110
 
 large enough buffer, and then calling stpncpy(dst, buff, len).
111
 
 It is just like stpncpy except that it concatenates multiple sources.
 
114
 large enough buffer, and then calling strnmov(dst, buff, len).
 
115
 It is just like strnmov except that it concatenates multiple sources.
112
116
 Beware: the last argument should be the null character pointer.
113
117
 Take VERY great care not to omit it!  Also be careful to use NullS
114
118
 and NOT to use 0, as on some machines 0 is not the same size as a
115
119
 character pointer, or not the same bit pattern as NullS.
116
120
 
117
 
 Note: strxnmov is like stpncpy in that it always moves EXACTLY len
 
121
 Note: strxnmov is like strnmov in that it always moves EXACTLY len
118
122
 characters; dst will be padded on the right with NUL characters as
119
123
 needed.  strxncpy does the same.  strxncat, like strncat, does NOT.
120
124
 
127
131
 strlength(const string str)
128
132
 Return length of string with end-space:s not counted.
129
133
 
130
 
 void caseup _A((string str,uint32_t length));
131
 
 void casedn _A((string str,uint32_t length));
 
134
 void caseup _A((string str,uint length));
 
135
 void casedn _A((string str,uint length));
132
136
 void caseup_str _A((string str));
133
137
 void casedn_str _A((string str));
134
138
 Converts strings or part of string to upper or lower-case.
135
139
 
136
 
 void case_sort _A((string str,uint32_t length));
 
140
 void case_sort _A((string str,uint length));
137
141
 Converts string to a string with can be compared with strcmp() to
138
142
 get strings in rigth order.
139
143