diff --git a/src/util/Compilers/OS400SetDefs.cpp b/src/util/Compilers/OS400SetDefs.cpp new file mode 100644 index 0000000000000000000000000000000000000000..247b299123a64f67cf612efe36cfa4655cf1a28f --- /dev/null +++ b/src/util/Compilers/OS400SetDefs.cpp @@ -0,0 +1,83 @@ + +/* + * (C) Copyright IBM Corp. 1999 All rights reserved. + * + * US Government Users Restricted Rights Use, duplication or + * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. + * + * The program is provided "as is" without any warranty express or + * implied, including the warranty of non-infringement and the implied + * warranties of merchantibility and fitness for a particular purpose. + * IBM will not be liable for any damages suffered by you as a result + * of using the Program. In no event will IBM be liable for any + * special, indirect or consequential damages or lost profits even if + * IBM has been advised of the possibility of their occurrence. IBM + * will not be liable for any third party claims against you. + */ + +/** + * @version Revision: 35 1.3 src/com/ibm/xml/util/CSetDefs.cpp, xml4c2Utils, xml4c2 + */ + + +// --------------------------------------------------------------------------- +// Includes +// --------------------------------------------------------------------------- + +#include <sys/types.h> +#include <ctype.h> + int +strcasecmp (const char *string1,const char * string2) + { + char *s1, *s2; + int result; + + s1 = (char *)string1; + s2 = (char *)string2; + + while ((result = tolower (*s1) - tolower (*s2)) == 0) + { + if (*s1++ == '\0') + return 0; + s2++; + } + return (result); +} +int +strncasecmp (const char *string1,const char *string2,size_t count) +{ + register char *s1, *s2; + register int r; + register unsigned int rcount; + rcount = (unsigned int) count; + if (rcount > 0) + { + s1 = (char *)string1; + s2 = (char *)string2; + do + { + if ((r = tolower (*s1) - tolower (*s2)) != 0) + return r; + if (*s1++ == '\0') + break; + s2++; + } + while (--rcount != 0); + } + return (0); +} +/* des not appear as though the following is needed */ +#ifndef __OS400__ +int stricmp(const char* str1, const char* str2) +{ + return strcasecmp(str1, str2); +} + +int strnicmp(const char* str1, const char* str2, const unsigned int count) +{ + if (count == 0) + return 0; + + return strncasecmp( str1, str2, (size_t)count); +} +#endif diff --git a/src/util/Compilers/OS400SetDefs.hpp b/src/util/Compilers/OS400SetDefs.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ec01cf3a3d29741f1b30b616b21e69748649942d --- /dev/null +++ b/src/util/Compilers/OS400SetDefs.hpp @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 1999 All rights reserved. + * + * US Government Users Restricted Rights Use, duplication or + * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. + * + * The program is provided "as is" without any warranty express or + * implied, including the warranty of non-infringement and the implied + * warranties of merchantibility and fitness for a particular purpose. + * IBM will not be liable for any damages suffered by you as a result + * of using the Program. In no event will IBM be liable for any + * special, indirect or consequential damages or lost profits even if + * IBM has been advised of the possibility of their occurrence. IBM + * will not be liable for any third party claims against you. + */ + +/** + * @version Revision: 96 1.10 src/com/ibm/xml/util/CSetDefs.hpp, xml4c2Utils, xml4c2 + */ + +#ifndef OS400SETDEFS_H +#define OS400SETDEFS_H +#include <util/XML4CDefs.hpp> + +// --------------------------------------------------------------------------- +// Define these away for this platform +// --------------------------------------------------------------------------- +#define PLATFORM_EXPORT +#define PLATFORM_IMPORT + + +// --------------------------------------------------------------------------- +// Indicate that we do not support native bools +// --------------------------------------------------------------------------- +#define NO_NATIVE_BOOL + + +// --------------------------------------------------------------------------- +// Define our version of the XML character +// --------------------------------------------------------------------------- +typedef unsigned short XMLCh; +// --------------------------------------------------------------------------- +// Define unsigned 16 and 32 bits integers +// --------------------------------------------------------------------------- +typedef unsigned short XMLUInt16; +typedef unsigned int XMLUInt32; + + + +// --------------------------------------------------------------------------- +// Force on the XML4C2 debug token if it was on in the build environment +// --------------------------------------------------------------------------- +#if 0 +#define XML4C2_DEBUG +#endif + + +// --------------------------------------------------------------------------- +// Provide some common string ops that are different/notavail on CSet +// --------------------------------------------------------------------------- + +// --------------------------------------------------------------------------- +// The name of the DLL that is built by the CSet C++ version of the +// system. We append a previously defined token which holds the DLL +// versioning string. This is defined in XML4CDefs.hpp which is what this +// file is included into. +// --------------------------------------------------------------------------- +const char* const XML4C2_DLLName = "QXML4C"; +#endif