Big OpenVMS patch: - nanohttp.c parser.[ch] tree.[ch] xmlIO.[ch] xmllint.c

Big OpenVMS patch:
- nanohttp.c parser.[ch] tree.[ch] xmlIO.[ch] xmllint.c xpath.c
  parserInternals.h vms/build_libxml.com vms/config.vms Makefile.am:
  integrated a set of OpenVMS changes from Howard Taylor
  <Howard.Taylor@pacoast.com>
Daniel
This commit is contained in:
Daniel Veillard 2000-11-25 09:54:49 +00:00
parent 58770e762e
commit ce6e98d693
18 changed files with 365 additions and 9 deletions

View File

@ -1,3 +1,10 @@
Sat Nov 25 10:41:37 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* nanohttp.c parser.[ch] tree.[ch] xmlIO.[ch] xmllint.c xpath.c
parserInternals.h vms/build_libxml.com vms/config.vms Makefile.am:
integrated a set of OpenVMS changes from Howard Taylor
<Howard.Taylor@pacoast.com>
Sat Nov 25 01:21:01 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.[ch] xmlIO.c: added xmlDocDumpMemoryEnc() from John Kroll

View File

@ -384,7 +384,8 @@ confexec_DATA = xmlConf.sh
EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec libxml.m4 \
example/Makefile.am example/gjobread.c example/gjobs.xml \
$(man_MANS) libxml-2.0.pc.in xmlversion.h.in \
win32/README.MSDev win32/Makefile.mingw win32/libxml2/libxml2.dsp
win32/README.MSDev win32/Makefile.mingw win32/libxml2/libxml2.dsp \
vms/build_libxml.com vms/config.vms
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxml-2.0.pc

View File

@ -306,7 +306,12 @@ LIBXML_DLL_IMPORT extern xmlSAXHandler sgmlDefaultSAXHandler;
* entity substitution default behaviour.
*/
#ifdef VMS
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultVal;
#define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal
#else
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue;
#endif
LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;

View File

@ -4,6 +4,10 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - truncated declaration of xmlParseElementChildrenContentDecl
* for VMS
*
*/
#ifndef __XML_PARSER_INTERNALS_H__
@ -204,8 +208,14 @@ int xmlParseAttributeType (xmlParserCtxtPtr ctxt,
void xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
xmlElementContentPtr xmlParseElementMixedContentDecl
(xmlParserCtxtPtr ctxt);
#ifdef VMS
xmlElementContentPtr xmlParseElementChildrenContentD
(xmlParserCtxtPtr ctxt);
#define xmlParseElementChildrenContentDecl xmlParseElementChildrenContentD
#else
xmlElementContentPtr xmlParseElementChildrenContentDecl
(xmlParserCtxtPtr ctxt);
#endif
int xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
xmlChar *name,
xmlElementContentPtr *result);

View File

@ -5,6 +5,9 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - added redefinition of xmlBufferWriteChar for VMS
*
*/
#ifndef __XML_TREE_H__
@ -609,8 +612,14 @@ int xmlRemoveNode (xmlNodePtr node); /* TODO */
/*
* Internal, don't use
*/
#ifdef VMS
void xmlBufferWriteXmlCHAR (xmlBufferPtr buf,
const xmlChar *string);
#define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR
#else
void xmlBufferWriteCHAR (xmlBufferPtr buf,
const xmlChar *string);
#endif
void xmlBufferWriteChar (xmlBufferPtr buf,
const char *string);
void xmlBufferWriteQuotedString(xmlBufferPtr buf,

View File

@ -4,6 +4,8 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 15 Nov 2000 ht - modified for VMS
*/
#ifndef __XML_IO_H__
@ -75,9 +77,17 @@ void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr
xmlAllocParserInputBuffer (xmlCharEncoding enc);
#ifdef VMS
xmlParserInputBufferPtr
xmlParserInputBufferCreateFname (const char *URI,
xmlCharEncoding enc);
#define xmlParserInputBufferCreateFilename xmlParserInputBufferCreateFname
#else
xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename (const char *URI,
xmlCharEncoding enc);
#endif
xmlParserInputBufferPtr
xmlParserInputBufferCreateFile (FILE *file,
xmlCharEncoding enc);

View File

@ -61,6 +61,12 @@
#include <strings.h>
#endif
#ifdef VMS
#include <stropts>
#define SOCKLEN_T unsigned int
#define SOCKET int
#endif
#include <libxml/xmlmemory.h>
#include <libxml/parser.h> /* for xmlStr(n)casecmp() */
#include <libxml/nanohttp.h>
@ -662,7 +668,7 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
#if defined(VMS)
{
int enable = 1;
status = IOCTL(s, FIONBIO, &enable);
status = ioctl(s, FIONBIO, &enable);
}
#else /* VMS */
if ((status = fcntl(s, F_GETFL, 0)) != -1) {

View File

@ -28,6 +28,9 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - truncated definitions of xmlSubstituteEntitiesDefaultValue
* and xmlDoValidityCheckingDefaultValue for VMS
*/
#ifdef WIN32
@ -80,8 +83,15 @@
*/
int xmlGetWarningsDefaultValue = 1;
int xmlParserDebugEntities = 0;
#ifdef VMS
int xmlSubstituteEntitiesDefaultVal = 0;
#define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal
int xmlDoValidityCheckingDefaultVal = 0;
#define xmlDoValidityCheckingDefaultValue xmlDoValidityCheckingDefaultVal
#else
int xmlSubstituteEntitiesDefaultValue = 0;
int xmlDoValidityCheckingDefaultValue = 0;
#endif
int xmlPedanticParserDefaultValue = 0;
int xmlKeepBlanksDefaultValue = 1;
@ -3882,7 +3892,12 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt) {
* hierarchy.
*/
xmlElementContentPtr
xmlParseElementChildrenContentDecl(xmlParserCtxtPtr ctxt) {
#ifdef VMS
xmlParseElementChildrenContentD
#else
xmlParseElementChildrenContentDecl
#endif
(xmlParserCtxtPtr ctxt) {
xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
xmlChar *elem;
xmlChar type = 0;

View File

@ -306,7 +306,12 @@ LIBXML_DLL_IMPORT extern xmlSAXHandler sgmlDefaultSAXHandler;
* entity substitution default behaviour.
*/
#ifdef VMS
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultVal;
#define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal
#else
LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue;
#endif
LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;

View File

@ -4,6 +4,10 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - truncated declaration of xmlParseElementChildrenContentDecl
* for VMS
*
*/
#ifndef __XML_PARSER_INTERNALS_H__
@ -204,8 +208,14 @@ int xmlParseAttributeType (xmlParserCtxtPtr ctxt,
void xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
xmlElementContentPtr xmlParseElementMixedContentDecl
(xmlParserCtxtPtr ctxt);
#ifdef VMS
xmlElementContentPtr xmlParseElementChildrenContentD
(xmlParserCtxtPtr ctxt);
#define xmlParseElementChildrenContentDecl xmlParseElementChildrenContentD
#else
xmlElementContentPtr xmlParseElementChildrenContentDecl
(xmlParserCtxtPtr ctxt);
#endif
int xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
xmlChar *name,
xmlElementContentPtr *result);

14
tree.c
View File

@ -4,6 +4,11 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - Changed the name of function xmlBufferWriteChar under VMS
* as it was similar to xmlBufferWriteCHAR when compiling without case
* sensitivity.
*
*/
#ifdef WIN32
@ -4623,11 +4628,16 @@ xmlBufferCCat(xmlBufferPtr buf, const char *str) {
* @buf: the XML buffer
* @string: the string to add
*
* routine which manage and grows an output buffer. This one add
* routine which manages and grows an output buffer. This one adds
* xmlChars at the end of the buffer.
*/
void
xmlBufferWriteCHAR(xmlBufferPtr buf, const xmlChar *string) {
#ifdef VMS
xmlBufferWriteXmlCHAR
#else
xmlBufferWriteCHAR
#endif
(xmlBufferPtr buf, const xmlChar *string) {
xmlBufferCat(buf, string);
}

9
tree.h
View File

@ -5,6 +5,9 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - added redefinition of xmlBufferWriteChar for VMS
*
*/
#ifndef __XML_TREE_H__
@ -609,8 +612,14 @@ int xmlRemoveNode (xmlNodePtr node); /* TODO */
/*
* Internal, don't use
*/
#ifdef VMS
void xmlBufferWriteXmlCHAR (xmlBufferPtr buf,
const xmlChar *string);
#define xmlBufferWriteCHAR xmlBufferWriteXmlCHAR
#else
void xmlBufferWriteCHAR (xmlBufferPtr buf,
const xmlChar *string);
#endif
void xmlBufferWriteChar (xmlBufferPtr buf,
const char *string);
void xmlBufferWriteQuotedString(xmlBufferPtr buf,

60
vms/build_libxml.com Executable file
View File

@ -0,0 +1,60 @@
$! BUILD_LIBXML.COM
$!
$! Build the LIBXML object library
$!
$! Ensure the logical name LIBXML is defined to point to the LIBXML source
$! directory. This procedure creates an object library LIBXML.OLB in the LIBXML
$! directory. After the library is built, you can link LIBXML routines into
$! your code with the command $ LINK your_modules,LIBXML:LIBXML.OLB/LIBRARY
$!
$!
$!------------------------------------------------------------------------------
$ cc_command = "CC/DEBUG/NOOPT"
$ lib_command = "LIBRARY/REPLACE LIBXML.OLB"
$!
$ exit_status = 1
$ saved_default = f$environment("default")
$ on error then goto ERROR_OUT
$ set def libxml
$ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG]
$ if f$search("LIBXML.OLB").eqs."" then library/create LIBXML.OLB
$!
$ call COMPILE DEBUGXML.C
$ call COMPILE ENCODING.C
$ call COMPILE ENTITIES.C
$ call COMPILE ERROR.C
$ call COMPILE HTMLPARSER.C
$ call COMPILE HTMLTREE.C
$ call COMPILE NANOFTP.C
$ call COMPILE NANOHTTP.C
$ call COMPILE PARSER.C
$ call COMPILE SAX.C
$ call COMPILE TREE.C
$ call COMPILE URI.C
$ call COMPILE VALID.C
$ call COMPILE XLINK.C
$ call COMPILE XMLIO.C
$ call COMPILE XMLLINT.C
$ call COMPILE XMLMEMORY.C
$ call COMPILE XPATH.C
$!
$EXIT_OUT:
$ set def 'saved_default
$ exit 'exit_status
$!
$
$ERROR_OUT:
$ exit_status = $status
$ write sys$output 'f$message(exit_status)'
$ goto EXIT_OUT
$!
$COMPILE: subroutine
$ on warning then goto EXIT_COMPILE
$ source_file = p1
$ name = f$element(0,".",source_file)
$ object_file = f$fao("[.debug]!AS.OBJ",name)
$ cc_command /object='object_file 'source_file'
$ lib_command 'object_file'
$EXIT_COMPILE:
$ exit $status
$endsubroutine

148
vms/config.vms Executable file
View File

@ -0,0 +1,148 @@
/* config.h */
#define VMS 1
/* Define if you have the strftime function. */
#define HAVE_STRFTIME 1
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
#undef PACKAGE
#undef VERSION
#undef HAVE_LIBZ
#undef HAVE_LIBM
#undef HAVE_ISINF
#undef HAVE_ISNAN
#undef HAVE_LIBHISTORY
#undef HAVE_LIBREADLINE
/* Define if you have the class function. */
#undef HAVE_CLASS
/* Define if you have the finite function. */
#undef HAVE_FINITE
/* Define if you have the fp_class function. */
#define HAVE_FP_CLASS 1
/* Define if you have the fpclass function. */
#undef HAVE_FPCLASS
/* Define if you have the isnand function. */
#undef HAVE_ISNAND
/* Define if you have the localtime function. */
#define HAVE_LOCALTIME 1
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strftime function. */
#define HAVE_STRFTIME 1
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define if you have the <ctype.h> header file. */
#define HAVE_CTYPE_H 1
/* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <float.h> header file. */
#define HAVE_FLOAT_H 1
/* Define if you have the <fp_class.h> header file. */
#define HAVE_FP_CLASS_H 1
/* Define if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <math.h> header file. */
#define HAVE_MATH_H 1
/* Define if you have the <nan.h> header file. */
#undef HAVE_NAN_H
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define if you have the inet library (-linet). */
#undef HAVE_LIBINET
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION

28
xmlIO.c
View File

@ -4,6 +4,8 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - for VMS, truncated name of long functions to under 32 char
*/
#ifdef WIN32
@ -42,6 +44,11 @@
#include <libxml/nanoftp.h>
#include <libxml/xmlerror.h>
#ifdef VMS
#define xmlRegisterDefaultInputCallbacks xmlRegisterDefInputCallbacks
#define xmlRegisterDefaultOutputCallbacks xmlRegisterDefOutputCallbacks
#endif
/* #define VERBOSE_FAILURE */
/* #define DEBUG_EXTERNAL_ENTITIES */
/* #define DEBUG_INPUT */
@ -655,7 +662,12 @@ xmlRegisterOutputCallbacks(xmlOutputMatchCallback match,
* Registers the default compiled-in I/O handlers.
*/
void
xmlRegisterDefaultInputCallbacks(void) {
#ifdef VMS
xmlRegisterDefInputCallbacks
#else
xmlRegisterDefaultInputCallbacks
#endif
(void) {
if (xmlInputCallbackInitialized)
return;
@ -684,7 +696,12 @@ xmlRegisterDefaultInputCallbacks(void) {
* Registers the default compiled-in I/O handlers.
*/
void
xmlRegisterDefaultOutputCallbacks(void) {
#ifdef VMS
xmlRegisterDefOutputCallbacks
#else
xmlRegisterDefaultOutputCallbacks
#endif
(void) {
if (xmlOutputCallbackInitialized)
return;
@ -873,7 +890,12 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) {
* Returns the new parser input or NULL
*/
xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
#ifdef VMS
xmlParserInputBufferCreateFname
#else
xmlParserInputBufferCreateFilename
#endif
(const char *URI, xmlCharEncoding enc) {
xmlParserInputBufferPtr ret;
int i;
void *context = NULL;

10
xmlIO.h
View File

@ -4,6 +4,8 @@
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*
* 15 Nov 2000 ht - modified for VMS
*/
#ifndef __XML_IO_H__
@ -75,9 +77,17 @@ void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr
xmlAllocParserInputBuffer (xmlCharEncoding enc);
#ifdef VMS
xmlParserInputBufferPtr
xmlParserInputBufferCreateFname (const char *URI,
xmlCharEncoding enc);
#define xmlParserInputBufferCreateFilename xmlParserInputBufferCreateFname
#else
xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename (const char *URI,
xmlCharEncoding enc);
#endif
xmlParserInputBufferPtr
xmlParserInputBufferCreateFile (FILE *file,
xmlCharEncoding enc);

View File

@ -88,7 +88,13 @@ static char *encoding = NULL;
static int xinclude = 0;
#endif
#ifdef VMS
extern int xmlDoValidityCheckingDefaultVal;
#define xmlDoValidityCheckingDefaultValue xmlDoValidityCheckingDefaultVal
#else
extern int xmlDoValidityCheckingDefaultValue;
#endif
extern int xmlGetWarningsDefaultValue;
/************************************************************************

15
xpath.c
View File

@ -11,6 +11,9 @@
* See COPYRIGHT for the status of this software
*
* Author: Daniel.Veillard@w3.org
*
* 14 Nov 2000 ht - truncated declaration of xmlXPathEvalRelativeLocationPath
* for VMS
*/
#ifdef WIN32
@ -3983,7 +3986,12 @@ xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs) {
void xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt);
void xmlXPathEvalPredicate(xmlXPathParserContextPtr ctxt);
void xmlXPathEvalLocationPath(xmlXPathParserContextPtr ctxt);
#ifdef VMS
void xmlXPathEvalRelLocationPath(xmlXPathParserContextPtr ctxt);
#define xmlXPathEvalRelativeLocationPath xmlXPathEvalRelLocationPath
#else
void xmlXPathEvalRelativeLocationPath(xmlXPathParserContextPtr ctxt);
#endif
/**
* xmlXPathParseNCName:
@ -5439,7 +5447,12 @@ eval_predicates:
*
*/
void
xmlXPathEvalRelativeLocationPath(xmlXPathParserContextPtr ctxt) {
#ifdef VMS
xmlXPathEvalRelLocationPath
#else
xmlXPathEvalRelativeLocationPath
#endif
(xmlXPathParserContextPtr ctxt) {
SKIP_BLANKS;
if ((CUR == '/') && (NXT(1) == '/')) {
SKIP(2);