Commit 92ad2104 authored by Daniel Veillard's avatar Daniel Veillard

Spring cleanup ...: - configure.in Makefile.am config.h.in

Spring cleanup ...:
- configure.in Makefile.am config.h.in xmlversion.h.in: detect if
  we need string functions
- trio.[ch] strio.[ch]: embedded the Trio-0.23 string functions
  to be able to use them where needed. Applied some changes
  to reduce name linking pollution and compile in only what's
  needed.
- HTMLtree.c debugXML.c entities.c error.c nanoftp.c valid.c
  xlink.c xmlversion.h.in xpath.c: got rid of the #ifdef
  for the string manipulation functions
- xmlmemory.[ch]: removed DEBUG_MEMORY_FREED and added it automatically
  to the free() function of xmlmemory.c
- entities.c HTMLtree.c parserInternals.c tree.c uri.c valid.c
  xinclude.c xmlIO.c xpath.c xpointer.c: removed the MEM_CLEANUP
  usage.
Daniel
parent 2be30641
Tue Mar 27 14:32:06 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* configure.in Makefile.am config.h.in xmlversion.h.in: detect if
we need string functions
* trio.[ch] strio.[ch]: embedded the Trio-0.23 string functions
to be able to use them where needed. Applied some changes
to reduce name linking pollution and compile in only what's
needed.
* HTMLtree.c debugXML.c entities.c error.c nanoftp.c valid.c
xlink.c xmlversion.h.in xpath.c: got rid of the #ifdef
for the string manipulation functions
* xmlmemory.[ch]: removed DEBUG_MEMORY_FREED and added it automatically
to the free() function of xmlmemory.c
* entities.c HTMLtree.c parserInternals.c tree.c uri.c valid.c
xinclude.c xmlIO.c xpath.c xpointer.c: removed the MEM_CLEANUP
usage.
Tue Mar 27 02:30:23 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* error.c: applied the context output patch of the error
......
......@@ -177,12 +177,8 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
return(-1);
if (encoding != NULL) {
#ifdef HAVE_SNPRINTF
snprintf(newcontent, sizeof(newcontent), "text/html; charset=%s",
encoding);
#else
sprintf(newcontent, "text/html; charset=%s", encoding);
#endif
newcontent[sizeof(newcontent) - 1] = 0;
}
......@@ -663,7 +659,6 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
htmlDocContentDump(buf, cur);
*mem = buf->content;
*size = buf->use;
MEM_CLEANUP(buf, sizeof(xmlBuffer));
xmlFree(buf);
}
......
......@@ -15,29 +15,11 @@ libxml2_la_LIBADD = @Z_LIBS@ -lm
libxml2_la_LDFLAGS = -version-info @LIBXML_VERSION_INFO@
libxml2_la_SOURCES = \
SAX.c \
entities.c \
encoding.c \
error.c \
parserInternals.c \
parser.c \
tree.c \
hash.c \
list.c \
xmlIO.c \
xmlmemory.c \
uri.c \
valid.c \
xlink.c \
HTMLparser.c \
HTMLtree.c \
debugXML.c \
xpath.c \
xpointer.c \
xinclude.c \
nanohttp.c \
nanoftp.c
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
xpointer.c xinclude.c nanohttp.c nanoftp.c \
trio.c strio.c
DEPS = $(top_builddir)/libxml2.la
LDADDS = $(top_builddir)/libxml2.la @Z_LIBS@ -lm
......@@ -428,7 +410,8 @@ EXTRA_DIST = xml2Conf.sh.in libxml.spec.in libxml.spec libxml.m4 \
$(man_MANS) libxml-2.0.pc.in xmlversion.h.in \
win32/README.MSDev win32/Makefile.mingw \
win32/libxml2/libxml2.dsp win32/libxml2/libxml2_so.dsp \
win32/libxml2/libxml2_a.dsp vms/build_libxml.com vms/config.vms
win32/libxml2/libxml2_a.dsp vms/build_libxml.com vms/config.vms \
trio.h strio.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxml-2.0.pc
......
......@@ -31,15 +31,27 @@
/* Define if you have the fpclass function. */
#undef HAVE_FPCLASS
/* Define if you have the fprintf function. */
#undef HAVE_FPRINTF
/* Define if you have the isnand function. */
#undef HAVE_ISNAND
/* Define if you have the localtime function. */
#undef HAVE_LOCALTIME
/* Define if you have the printf function. */
#undef HAVE_PRINTF
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the sprintf function. */
#undef HAVE_SPRINTF
/* Define if you have the sscanf function. */
#undef HAVE_SSCANF
/* Define if you have the stat function. */
#undef HAVE_STAT
......@@ -55,9 +67,15 @@
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the vfprintf function. */
#undef HAVE_VFPRINTF
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the vsprintf function. */
#undef HAVE_VSPRINTF
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
......
......@@ -100,11 +100,15 @@ AC_SUBST(CORBA_CFLAGS)
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(strdup strndup strerror snprintf vsnprintf)
AC_CHECK_FUNCS(strdup strndup strerror)
AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
AC_CHECK_FUNCS(strftime localtime)
AC_CHECK_FUNCS(stat _stat)
dnl Checking the standard string functions availability
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
NEED_TRIO=1)
dnl Checks for inet libraries:
AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
......@@ -240,6 +244,19 @@ dnl fi
CFLAGS="-Wall -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline "
dnl -Wcast-qual -ansi
fi
dnl
dnl Check for trio string functions
dnl
if test "${NEED_TRIO}" = "1" ; then
echo Adding trio library for string functions
WITH_TRIO=1
else
WITH_TRIO=0
fi
AC_SUBST(WITH_TRIO)
dnl
dnl Aloow to disable various pieces
dnl
......
......@@ -1512,18 +1512,10 @@ xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer, xmlNodePtr node
next = cur->parent;
}
if (occur == 0)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "%c%s%s", sep, name, buffer);
#else
sprintf(buf, "%c%s%s", sep, name, buffer);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "%c%s[%d]%s",
sep, name, occur, buffer);
#else
sprintf(buf, "%c%s[%d]%s", sep, name, occur, buffer);
#endif
buf[sizeof(buf) - 1] = 0;
/*
* This test prevents buffer overflow, because this routine
......@@ -1593,11 +1585,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
if (ctxt->node == (xmlNodePtr) ctxt->doc)
sprintf(prompt, "%s > ", "/");
else if (ctxt->node->name)
#ifdef HAVE_SNPRINTF
snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name);
#else
sprintf(prompt, "%s > ", ctxt->node->name);
#endif
else
sprintf(prompt, "? > ");
prompt[sizeof(prompt) - 1] = 0;
......
......@@ -67,7 +67,6 @@ static void xmlFreeEntity(xmlEntityPtr entity) {
xmlFree((char *) entity->content);
if (entity->orig != NULL)
xmlFree((char *) entity->orig);
MEM_CLEANUP(entity, sizeof(xmlEntity));
xmlFree(entity);
}
......@@ -521,11 +520,7 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
} else if ((sizeof(xmlChar) == 1) && (*cur >= 0x80)) {
char buf[10], *ptr;
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......@@ -533,11 +528,7 @@ xmlEncodeEntities(xmlDocPtr doc, const xmlChar *input) {
} else if (IS_CHAR(*cur)) {
char buf[10], *ptr;
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......@@ -679,11 +670,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
xmlGenericError(xmlGenericErrorContext,
"xmlEncodeEntitiesReentrant : input not UTF-8\n");
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......@@ -714,11 +701,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
xmlGenericError(xmlGenericErrorContext,
"xmlEncodeEntitiesReentrant : char out of range\n");
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......@@ -728,11 +711,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
/*
* We could do multiple things here. Just save as a char ref
*/
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#x%X;", val);
#else
sprintf(buf, "&#x%X;", val);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......@@ -742,11 +721,7 @@ xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
} else if (IS_CHAR(*cur)) {
char buf[10], *ptr;
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "&#%d;", *cur);
#else
sprintf(buf, "&#%d;", *cur);
#endif
buf[sizeof(buf) - 1] = 0;
ptr = buf;
while (*ptr != 0) *out++ = *ptr++;
......
......@@ -163,21 +163,17 @@ xmlGetVarStr(const char * msg, va_list args) {
int chars, left;
char *str, *larger;
str = (char *) xmlMalloc(100);
str = (char *) xmlMalloc(150);
if (str == NULL)
return(NULL);
size = 100;
size = 150;
length = 0;
while (1) {
left = size - length;
/* Try to print in the allocated space. */
#ifdef HAVE_VSNPRINTF
chars = vsnprintf(str + length, left, msg, args);
#else
chars = vsprintf(str + length, msg, args);
#endif
/* If that worked, we're done. */
if ((chars > -1) && (chars < left ))
break;
......
......@@ -26,6 +26,7 @@
#ifdef DEBUG_MEMORY_LOCATION
#define MEM_LIST /* keep a list of all the allocated memory blocks */
#define DEBUG_MEMORY_FREED
#endif
#ifdef DEBUG_MEMORY_FREED
......
......@@ -23,6 +23,15 @@ extern void xmlCheckVersion(int version);
#define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@"
#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@);
/*
* Whether the trio support need to be configured in
*/
#if @WITH_TRIO@
#define WITH_TRIO
#else
#define WITHOUT_TRIO
#endif
/*
* Whether the FTP support is configured in
*/
......
......@@ -761,11 +761,7 @@ xmlNanoFTPSendUser(void *ctx) {
if (ctxt->user == NULL)
sprintf(buf, "USER anonymous\r\n");
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "USER %s\r\n", ctxt->user);
#else
sprintf(buf, "USER %s\r\n", ctxt->user);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -788,17 +784,9 @@ xmlNanoFTPSendPasswd(void *ctx) {
int res;
if (ctxt->passwd == NULL)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n", hostname);
#else
sprintf(buf, "PASS libxml@%s\r\n", hostname);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS %s\r\n", ctxt->passwd);
#else
sprintf(buf, "PASS %s\r\n", ctxt->passwd);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -947,11 +935,7 @@ xmlNanoFTPConnect(void *ctx) {
/*
* We need proxy auth
*/
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "USER %s\r\n", proxyUser);
#else
sprintf(buf, "USER %s\r\n", proxyUser);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -970,18 +954,10 @@ xmlNanoFTPConnect(void *ctx) {
break;
case 3:
if (proxyPasswd != NULL)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS %s\r\n", proxyPasswd);
#else
sprintf(buf, "PASS %s\r\n", proxyPasswd);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n",
hostname);
#else
sprintf(buf, "PASS libxml@%s\r\n", hostname);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1021,11 +997,7 @@ xmlNanoFTPConnect(void *ctx) {
/* we will try in seqence */
case 1:
/* Using SITE command */
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "SITE %s\r\n", ctxt->hostname);
#else
sprintf(buf, "SITE %s\r\n", ctxt->hostname);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1051,20 +1023,11 @@ xmlNanoFTPConnect(void *ctx) {
case 2:
/* USER user@host command */
if (ctxt->user == NULL)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "USER anonymous@%s\r\n",
ctxt->hostname);
#else
sprintf(buf, "USER anonymous@%s\r\n", ctxt->hostname);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "USER %s@%s\r\n",
ctxt->user, ctxt->hostname);
#else
sprintf(buf, "USER %s@%s\r\n",
ctxt->user, ctxt->hostname);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1083,17 +1046,9 @@ xmlNanoFTPConnect(void *ctx) {
return(0);
}
if (ctxt->passwd == NULL)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS libxml@%s\r\n", hostname);
#else
sprintf(buf, "PASS libxml@%s\r\n", hostname);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PASS %s\r\n", ctxt->passwd);
#else
sprintf(buf, "PASS %s\r\n", ctxt->passwd);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1231,11 +1186,7 @@ xmlNanoFTPCwd(void *ctx, char *directory) {
* 250
* 500, 501, 502, 421, 530, 550
*/
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "CWD %s\r\n", directory);
#else
sprintf(buf, "CWD %s\r\n", directory);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1349,15 +1300,9 @@ xmlNanoFTPGetConnection(void *ctx) {
}
adp = (unsigned char *) &dataAddr.sin_addr;
portp = (unsigned char *) &dataAddr.sin_port;
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "PORT %d,%d,%d,%d,%d,%d\r\n",
adp[0] & 0xff, adp[1] & 0xff, adp[2] & 0xff, adp[3] & 0xff,
portp[0] & 0xff, portp[1] & 0xff);
#else
sprintf(buf, "PORT %d,%d,%d,%d,%d,%d\r\n",
adp[0] & 0xff, adp[1] & 0xff, adp[2] & 0xff, adp[3] & 0xff,
portp[0] & 0xff, portp[1] & 0xff);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......@@ -1590,11 +1535,7 @@ xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData,
ctxt->dataFd = xmlNanoFTPGetConnection(ctxt);
if (ctxt->dataFd == -1)
return(-1);
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "LIST -L %s\r\n", filename);
#else
sprintf(buf, "LIST -L %s\r\n", filename);
#endif
}
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
......@@ -1706,17 +1647,9 @@ xmlNanoFTPGetSocket(void *ctx, const char *filename) {
return(-res);
}
if (filename == NULL)
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "RETR %s\r\n", ctxt->path);
#else
sprintf(buf, "RETR %s\r\n", ctxt->path);
#endif
else
#ifdef HAVE_SNPRINTF
snprintf(buf, sizeof(buf), "RETR %s\r\n", filename);
#else
sprintf(buf, "RETR %s\r\n", filename);
#endif
buf[sizeof(buf) - 1] = 0;
len = strlen(buf);
#ifdef DEBUG_FTP
......
......@@ -1877,7 +1877,6 @@ xmlFreeInputStream(xmlParserInputPtr input) {
input->free((xmlChar *) input->base);
if (input->buf != NULL)
xmlFreeParserInputBuffer(input->buf);
MEM_CLEANUP(input, sizeof(xmlParserInput));
xmlFree(input);
}
......
/*************************************************************************
*
* $Id$
*
* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
/* DV for libxml */
#include "xmlversion.h"
#ifdef WITH_TRIO
/* FIXME
* StrToLongDouble
*/
static const char rcsid[] = "@(#)$Id$";
#if defined(unix) || defined(__xlC__)
# define PLATFORM_UNIX
#elif defined(WIN32) || defined(_WIN32)
# define PLATFORM_WIN32
#elif defined(AMIGA) && defined(__GNUC__)
# define PLATFORM_UNIX
#endif
#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
# define TRIO_C99
#endif
#include "strio.h"
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#include <time.h>
#include <math.h>
#ifndef DEBUG
# define NDEBUG
#endif
#include <assert.h>
#ifndef NULL
# define NULL 0
#endif
#define NIL ((char)0)
#ifndef FALSE
# define FALSE (1 == 0)
# define TRUE (! FALSE)
#endif
#define VALID(x) (NULL != (x))
#define INVALID(x) (NULL == (x))
#if defined(PLATFORM_UNIX)
# define USE_STRCASECMP
# define USE_STRNCASECMP
# define USE_STRERROR
#elif defined(PLATFORM_WIN32)
# define USE_STRCMPI
#endif
/*************************************************************************
* StrAppendMax
*/
char *StrAppendMax(char *target, size_t max, const char *source)
{
assert(VALID(target));
assert(VALID(source));
assert(max > 0);
max -= StrLength(target) + 1;
return (max > 0) ? strncat(target, source, max) : target;
}
/*************************************************************************
* StrCopyMax
*/
char *StrCopyMax(char *target, size_t max, const char *source)
{
assert(VALID(target));
assert(VALID(source));
assert(max > 0); /* Includes != 0 */
target = strncpy(target, source, max - 1);
target[max - 1] = (char)0;
return target;
}
/*************************************************************************
* StrDuplicate
*/
char *StrDuplicate(const char *source)
{
char *target;
assert(VALID(source));
target = (char *)malloc(StrLength(source) + 1);
if (target)
{
StrCopy(target, source);
}
return target;
}
/*************************************************************************
* StrDuplicateMax
*/
char *StrDuplicateMax(const char *source, size_t max)
{
char *target;
size_t len;
assert(VALID(source));
assert(max > 0);
/* Make room for string plus a terminating zero */
len = StrLength(source) + 1;
if (len > max)
{
len = max;
}
target = (char *)malloc(len);
if (target)
{
StrCopyMax(target, len, source);
}
return target;
}
/*************************************************************************
* StrEqual
*/
int StrEqual(const char *first, const char *second)
{
assert(VALID(first));
assert(VALID(second));
if (VALID(first) && VALID(second))
{
#if defined(USE_STRCASECMP)
return (0 == strcasecmp(first, second));
#elif defined(USE_STRCMPI)
return (0 == strcmpi(first, second));
#else
while ((*first != NIL) && (*second != NIL))
{
if (toupper(*first) != toupper(*second))
{
break;
}
first++;
second++;
}
return ((*first == NIL) && (*second == NIL));
#endif
}
return FALSE;
}
/*************************************************************************
* StrEqualCase
*/
int StrEqualCase(const char *first, const char *second)
{
assert(VALID(first));
assert(VALID(second));
if (VALID(first) && VALID(second))
{
return (0 == strcmp(first, second));
}
return FALSE;
}
/*************************************************************************
* StrEqualCaseMax
*/
int StrEqualCaseMax(const char *first, size_t max, const char *second)
{
assert(VALID(first));
assert(VALID(second));
if (VALID(first) && VALID(second))
{
return (0 == strncmp(first, second, max));
}
return FALSE;
}
/*************************************************************************
* StrEqualMax
*/
int StrEqualMax(const char *first, size_t max, const char *second)
{