00001 #ifndef __STRCMP_H_
00002 #define __STRCMP_H_
00003
00004 #include <nlibc.h>
00005 #include <string/stringexpand.h>
00006
00035 #ifndef __HAS_MAIN
00036 extern int strcmp(const char *s1, const char *s2);
00037 #else
00038 #if !defined(__cflow_processed) || defined(_uses_strcmp_strcmp_h)
00039 int strcmp(const char *s1, const char *s2) {
00040 int l1 = strlen(s1);
00041 int l2 = strlen(s2);
00042 int *a1 = (int *)stringexpand(s1, l1);
00043 int *a2 = (int *)stringexpand(s2, l2);
00044
00045 while (*a1 == *a2++)
00046 if (*a1++ == 0)
00047 return (0);
00048 return (*a1 - *(--a2));
00049 }
00050 #endif // _uses_strcmp
00051 #endif // Has Main
00052
00053
00054 #endif // __STRCMP_H_