[MOAB-dev] Changing the options format in iMesh

Jason Kraftcheck kraftche at cae.wisc.edu
Mon Nov 15 13:18:58 CST 2010


On 11/15/2010 01:08 PM, James Porter wrote:
> While we're on this subject, is it ok to use strncasecmp()? I have a
> feeling this won't work in Windows, where it's (I think) _strnicmp().
> Maybe a macro would be sufficient?
>

There may be issues on platforms other than windows.  strncasecmp is a 
BSD function that was included in POSIX'01.  It's probably better to 
just write our own, as the function is so trivial:

#include <ctype.h>
int compare_no_case( const char* str1, const char* str2 ) {
   for (; *str1 && toupper(*str1) == toupper(*str2); ++str1, ++str2);
   return toupper(*str2) - toupper(*str1);
}



More information about the moab-dev mailing list