Chameleon

Chameleon Commit Details

Date:2011-05-22 10:14:03 (8 years 5 months ago)
Author:Evan Lojewski
Commit:865
Parents: 864
Message:Update libsa to follow std c lib prototypes
Changes:
M/trunk/i386/libsa/libsa.h
M/trunk/i386/libsa/string.c

File differences

trunk/i386/libsa/libsa.h
3535
3636
3737
38
38
3939
4040
4141
4242
43
43
4444
4545
4646
4747
48
48
4949
5050
5151
5252
53
53
5454
5555
5656
5757
58
58
5959
6060
6161
6262
63
63
6464
6565
6666
6767
68
68
6969
7070
7171
7272
7373
74
74
7575
7676
7777
......
8989
9090
9191
92
92
9393
9494
9595
/*
* ctype stuff (aserebln)
*/
static inline int isupper(char c)
static inline int isupper(int c)
{
return (c >= 'A' && c <= 'Z');
}
static inline int islower(char c)
static inline int islower(int c)
{
return (c >= 'a' && c <= 'z');
}
static inline int isalpha(char c)
static inline int isalpha(int c)
{
return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}
static inline int isascii(char c)
static inline int isascii(int c)
{
return ( (c >= 0x20) && (c < 0x7f) );
}
static inline int isspace(char c)
static inline int isspace(int c)
{
return (c == ' ' || c == '\t' || c == '\n' || c == '\12');
}
static inline int isdigit(char c)
static inline int isdigit(int c)
{
return (c >= '0' && c <= '9');
}
static inline int isxdigit(char c)
static inline int isxdigit(int c)
{
return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'));
}
//Azi: TODO - add more ponctuation characters as needed; at least these two, i need for PartNo.
static inline int ispunct(char c)
static inline int ispunct(int c)
{
return (c == '.' || c == '-');
}
extern void * memset(void * dst, int c, size_t n);
extern void * memcpy(void * dst, const void * src, size_t len);
extern int memcmp(const void * p1, const void * p2, int len);
extern int memcmp(const void * p1, const void * p2, size_t len);
extern int strcmp(const char * s1, const char * s2);
extern int strncmp(const char * s1, const char * s2, size_t n);
extern char * strcpy(char * s1, const char * s2);
trunk/i386/libsa/string.c
119119
120120
121121
122
122
123123
124124
125125
/* NOTE: Moved from ntfs.c */
int
memcmp(const void *p1, const void *p2, int len)
memcmp(const void *p1, const void *p2, size_t len)
{
while (len--) {
if (*(const char*)(p1++) != *(const char*)(p2++))

Archive Download the corresponding diff file

Revision: 865