[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src/missing _string.cpp,1.4,1.5 string.h,1.6,1.7
Chris Apers
chrilith at users.sourceforge.net
Tue May 25 06:39:19 CEST 2004
Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2650
Modified Files:
_string.cpp string.h
Log Message:
Cleanup, new strspn function
Index: _string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing/_string.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- _string.cpp 6 Jan 2004 12:45:25 -0000 1.4
+++ _string.cpp 25 May 2004 13:38:36 -0000 1.5
@@ -21,7 +21,7 @@
*/
#include "string.h"
-///////////////////////////////////////////////////////////////////////////////
+
void *memchr(const void *s, int c, UInt32 n) {
UInt32 chr;
for(chr = 0; chr < n;chr++,((UInt8 *)s)++)
@@ -29,9 +29,20 @@
return (void *)s;
return NULL;
-}
-///////////////////////////////////////////////////////////////////////////////
-Char *StrTokNext;
+}
+
+UInt32 strspn(const char *s1, const char *s2) {
+ UInt32 chr = 0;
+
+ while ( chr < strlen(s1) &&
+ strchr(s2, s1[chr]) )
+ chr++;
+
+ return chr;
+}
+
+static Char *StrTokNext = NULL;
+
Char *strtok(Char *str, const Char *sep) {
Char *position = NULL,
*found,
@@ -73,7 +84,7 @@
return str;
}
-///////////////////////////////////////////////////////////////////////////////
+
Char *strpbrk(const Char *s1, const Char *s2) {
Char *found;
UInt32 n;
@@ -86,7 +97,7 @@
return NULL;
}
-///////////////////////////////////////////////////////////////////////////////
+
Char *strrchr(const Char *s, int c) {
UInt32 chr;
UInt32 n = StrLen(s);
@@ -97,7 +108,7 @@
return NULL;
}
-///////////////////////////////////////////////////////////////////////////////
+
Char *strdup(const Char *s1) {
Char* buf = (Char *)MemPtrNew(StrLen(s1)+1);
@@ -106,7 +117,3 @@
return buf;
}
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////
Index: string.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/missing/string.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- string.h 6 Jan 2004 12:45:25 -0000 1.6
+++ string.h 25 May 2004 13:38:36 -0000 1.7
@@ -38,10 +38,11 @@
#define strncmp StrNCompare
#define strstr StrStr
-void *memchr(const void *s, int c, UInt32 n);
-Char *strtok(Char *str, const Char *sep);
-Char *strrchr(const Char *s, int c);
-Char *strdup(const Char *strSource);
-Char *strpbrk(const Char *s1, const Char *s2);
+void *memchr (const void *s, int c, UInt32 n);
+Char *strtok (Char *str, const Char *sep);
+Char *strrchr (const Char *s, int c);
+Char *strdup (const Char *strSource);
+Char *strpbrk (const Char *s1, const Char *s2);
+UInt32 strspn (const char *s1, const char *s2);
#define StrTok strtok
\ No newline at end of file
More information about the Scummvm-git-logs
mailing list