/*
 * Copyright (C) 2008 The Trustees of Columbia University in the City of New York. 
 * All rights reserved.
 *
 * See the file LICENSE included in this distribution for details.
 */

#include "sysutils.h"

#ifdef WIN32

int strcasecmp(const char* s1, const char* s2) {
  return _stricmp(s1, s2);
}

#endif


char *strtok_i(char *strToken, const char *strDelimit, char **context ) {

#ifdef WIN32
	//return NULL;
	return strtok_s(strToken, strDelimit, context);
#endif

#ifdef _LINUX_
	return strtok_r(strToken, strDelimit, context);
#endif

}


#ifdef WIN32
static char* optarg;
static int iS = 1;
char getopt(int argc, char** argv, char* options) {
	char c = 1;

	//for(iS; iS<argc; iS+=2) {
		c=argv[iS][1];
		optarg=argv[iS+1];
		
		//printf("%c %s\n", c, optarg);
	//}

	iS+=2;

	if(iS >= argc)
		return -1;

	return c;
}
#endif
