Changeset 589 for libcaca/trunk/kernel/kernel.c
- Timestamp:
- Mar 10, 2006, 6:56:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/kernel/kernel.c
r578 r589 24 24 #ifdef __KERNEL__ 25 25 26 #define IS_DIGIT(x) (x>='0' && x<='9') 27 #define IS_ALPHA(x) (x>='A' && x<='z') 28 #define IS_UPPER(x) (x>='A' && x<='Z') 29 #define IS_LOWER(x) (x>='a' && x<='z') 30 #define UPPER(x) (IS_LOWER(x)?(x+('a'-'A')):x) 31 #define LOWER(x) (IS_UPPER(x)?(x-('a'-'A')):x) 32 26 33 /* Our memory mapping */ 27 34 static uint32_t *freemem = (uint32_t*) 0x00200000; … … 131 138 int strcasecmp(const char *s1, const char *s2) 132 139 { 133 /* FIXME */ 134 return -1; 140 while((*s1++) && (*s2++)) { 141 char c1 = UPPER(*s1); 142 char c2 = UPPER(*s2); 143 if((*s1)>(*s2)) 144 return (*s1)>(*s2); 145 if((*s1)<(*s2)) 146 return (*s1)<(*s2); 147 } 148 if((*s1==0) && (*s2==0)) 149 return 0; 150 151 return 1; /* FIXME */ 135 152 } 136 153
Note: See TracChangeset
for help on using the changeset viewer.