platform/posix.c
changeset 828 ee871d51510d
parent 818 e36f23f49042
child 832 adef86dfc331
equal deleted inserted replaced
827:53779f3e6781 828:ee871d51510d
   118         retval = getUserDirByUID();
   118         retval = getUserDirByUID();
   119     return(retval);
   119     return(retval);
   120 } /* __PHYSFS_platformGetUserDir */
   120 } /* __PHYSFS_platformGetUserDir */
   121 
   121 
   122 
   122 
   123 /* -ansi and -pedantic flags prevent use of strcasecmp() on Linux. */
       
   124 int __PHYSFS_platformStricmp(const char *x, const char *y)
       
   125 {
       
   126     int ux, uy;
       
   127 
       
   128     do
       
   129     {
       
   130         ux = toupper((int) *x);
       
   131         uy = toupper((int) *y);
       
   132         if (ux != uy)
       
   133             return((ux > uy) ? 1 : -1);
       
   134         x++;
       
   135         y++;
       
   136     } while ((ux) && (uy));
       
   137 
       
   138     return(0);
       
   139 } /* __PHYSFS_platformStricmp */
       
   140 
       
   141 
       
   142 int __PHYSFS_platformStrnicmp(const char *x, const char *y, PHYSFS_uint32 len)
       
   143 {
       
   144     int ux, uy;
       
   145 
       
   146     if (!len)
       
   147         return(0);
       
   148 
       
   149     do
       
   150     {
       
   151         ux = toupper((int) *x);
       
   152         uy = toupper((int) *y);
       
   153         if (ux != uy)
       
   154             return((ux > uy) ? 1 : -1);
       
   155         x++;
       
   156         y++;
       
   157         len--;
       
   158     } while ((ux) && (uy) && (len));
       
   159 
       
   160     return(0);
       
   161 } /* __PHYSFS_platformStrnicmp */
       
   162 
       
   163 
       
   164 #if (defined __PHYSFS_NO_SYMLINKS__)
   123 #if (defined __PHYSFS_NO_SYMLINKS__)
   165 #define doStat stat
   124 #define doStat stat
   166 #else
   125 #else
   167 #define doStat lstat
   126 #define doStat lstat
   168 #endif
   127 #endif