ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/strings.C
(Generate patch)

Comparing rxvt-unicode/src/strings.C (file contents):
Revision 1.6 by pcg, Thu Apr 8 20:31:45 2004 UTC vs.
Revision 1.8 by root, Sun Aug 15 04:54:21 2004 UTC

21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *----------------------------------------------------------------------*/ 22 *----------------------------------------------------------------------*/
23 23
24#include "../config.h" /* NECESSARY */ 24#include "../config.h" /* NECESSARY */
25#include "rxvt.h" /* NECESSARY */ 25#include "rxvt.h" /* NECESSARY */
26#include "strings.intpro" /* PROTOS for internal routines */
27 26
28#ifndef NO_STRINGS 27#ifndef NO_STRINGS
29/*----------------------------------------------------------------------*/ 28/*----------------------------------------------------------------------*/
30/* 29/*
31 * a replacement for strcasecmp () to avoid linking an entire library. 30 * a replacement for strcasecmp () to avoid linking an entire library.
132} 131}
133 132
134char * 133char *
135strdup (const char *s) 134strdup (const char *s)
136{ 135{
137 size_t len = STRLEN (s) + 1; 136 size_t len = strlen (s) + 1;
138 char *c; 137 char *c;
139 138
140 if ((c = malloc (len)) != NULL) 139 if ((c = malloc (len)) != NULL)
141 MEMCPY (c, s, len); 140 memcpy (c, s, len);
142 return c; 141 return c;
143} 142}
144 143
145char * 144char *
146index (const char *s, int c) 145index (const char *s, int c)
147{ 146{
148 return STRCHR (s, c); 147 return strchr (s, c);
149} 148}
150 149
151char * 150char *
152strchr (const char *s, int c) 151strchr (const char *s, int c)
153{ 152{
168} 167}
169 168
170char * 169char *
171rindex (const char *s, int c) 170rindex (const char *s, int c)
172{ 171{
173 return STRRCHR (s, c); 172 return strrchr (s, c);
174} 173}
175 174
176char * 175char *
177strrchr (const char *s, int c) 176strrchr (const char *s, int c)
178{ 177{
190 189
191void * 190void *
192memcpy (void *s1, const void *s2, size_t len) 191memcpy (void *s1, const void *s2, size_t len)
193{ 192{
194 /* has extra stack and time but less code space */ 193 /* has extra stack and time but less code space */
195 return MEMMOVE (s1, s2, len); 194 return memmove (s1, s2, len);
196} 195}
197 196
198/*--------------------------------------------------------------------------* 197/*--------------------------------------------------------------------------*
199 * Possibly faster memmove () by Geoff Wing <mason@primenet.com.au> 198 * Possibly faster memmove () by Geoff Wing <mason@primenet.com.au>
200 *--------------------------------------------------------------------------*/ 199 *--------------------------------------------------------------------------*/
255 *--------------------------------------------------------------------------*/ 254 *--------------------------------------------------------------------------*/
256 255
257void 256void
258bzero (void *b, size_t len) 257bzero (void *b, size_t len)
259{ 258{
260 MEMSET (b, 0, len); 259 memset (b, 0, len);
261} 260}
262 261
263void * 262void *
264memset (void *p, int c1, size_t len) 263memset (void *p, int c1, size_t len)
265{ 264{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines