1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

a few VMS updates from John A Fotheringham added

* vms/readme.vms vms/build_libxml.com nanoftp.c
  include/libxml/xmlversion.h.in: a few VMS updates from
  John A Fotheringham
* include/libxml/xmlIO.h xmlIO.c: added xmlCleanupInputCallbacks()
  and xmlCleanupOutputCallbacks() for the Perl binding people.
Daniel
This commit is contained in:
Daniel Veillard
2001-10-29 20:21:47 +00:00
parent 635ef72a94
commit acf7ff0a65
6 changed files with 271 additions and 60 deletions

View File

@ -1,3 +1,11 @@
Mon Oct 29 19:09:46 CET 2001 Daniel Veillard <daniel@veillard.com>
* vms/readme.vms vms/build_libxml.com nanoftp.c
include/libxml/xmlversion.h.in: a few VMS updates from
John A Fotheringham
* include/libxml/xmlIO.h xmlIO.c: added xmlCleanupInputCallbacks()
and xmlCleanupOutputCallbacks() for the Perl binding people.
Mon Oct 29 12:44:17 CET 2001 Daniel Veillard <daniel@veillard.com> Mon Oct 29 12:44:17 CET 2001 Daniel Veillard <daniel@veillard.com>
* parser.c globals.c DOCBparser.c HTMLparser.c error.c: * parser.c globals.c DOCBparser.c HTMLparser.c error.c:

View File

@ -77,6 +77,8 @@ struct _xmlOutputBuffer {
/* /*
* Interfaces for input * Interfaces for input
*/ */
void xmlCleanupInputCallbacks (void);
void xmlCleanupOutputCallbacks (void);
void xmlRegisterDefaultInputCallbacks (void); void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr xmlParserInputBufferPtr

View File

@ -50,6 +50,7 @@ extern void xmlCheckVersion(int version);
*/ */
#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@);
#ifndef VMS
#if @WITH_TRIO@ #if @WITH_TRIO@
/** /**
* WITH_TRIO: * WITH_TRIO:
@ -65,6 +66,9 @@ extern void xmlCheckVersion(int version);
*/ */
#define WITHOUT_TRIO #define WITHOUT_TRIO
#endif #endif
#else /* VMS */
#define WITH_TRIO 1
#endif /* VMS */
/** /**
* LIBXML_THREADS_ENABLED: * LIBXML_THREADS_ENABLED:

View File

@ -75,6 +75,9 @@
#define closesocket(s) close(s) #define closesocket(s) close(s)
#define SOCKET int #define SOCKET int
#endif #endif
#if defined(VMS) || defined(__VMS)
#define SOCKLEN_T unsigned int
#endif
#define FTP_COMMAND_OK 200 #define FTP_COMMAND_OK 200
#define FTP_SYNTAX_ERROR 500 #define FTP_SYNTAX_ERROR 500

View File

@ -1,60 +1,204 @@
$! BUILD_LIBXML.COM $! BUILD_LIBXML.COM
$! $!
$! Build the LIBXML object library $! Build the LIBXML object library
$! $!
$! Ensure the logical name LIBXML is defined to point to the LIBXML source $! 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. This procedure creates an object library LIBXML.OLB in the LIBXML
$! directory. After the library is built, you can link LIBXML routines into $! directory. After the library is built, you can link LIBXML routines into
$! your code with the command $ LINK your_modules,LIBXML:LIBXML.OLB/LIBRARY $! your code with the command $ LINK your_modules,LIBXML:LIBXML.OLB/LIBRARY
$! $!
$! $!- configuration -------------------------------------------------------------
$!------------------------------------------------------------------------------ $!
$ cc_command = "CC/DEBUG/NOOPT" $!- compile command. If p1="nowarn" suppress the expected warning types
$ lib_command = "LIBRARY/REPLACE LIBXML.OLB" $!
$! $ cc_command = "CC/DEBUG/NOOPT"
$ exit_status = 1 $ if p1.eqs."NOWARN" then -
$ saved_default = f$environment("default") cc_command = cc_command + "/WARN=DISABLE=(FLOATOVERFL,NOMAINUFLO)"
$ on error then goto ERROR_OUT $!
$ set def libxml $!- list of sources to be built into the LIBXML library. Compare this list
$ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG] $! to the definition of "libxml2_la_SOURCES" in the file MAKEFILE.
$ if f$search("LIBXML.OLB").eqs."" then library/create LIBXML.OLB $!
$! $ sources = "SAX.c entities.c encoding.c error.c parserInternals.c parser.c"
$ call COMPILE DEBUGXML.C $ sources = sources + " tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c valid.c"
$ call COMPILE ENCODING.C $ sources = sources + " xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c "
$ call COMPILE ENTITIES.C $ sources = sources + " xpointer.c xinclude.c nanohttp.c nanoftp.c "
$ call COMPILE ERROR.C $ sources = sources + " DOCBparser.c catalog.c globals.c threads.c"
$ call COMPILE HTMLPARSER.C $!
$ call COMPILE HTMLTREE.C $!- for VMS, we add in trio support
$ call COMPILE NANOFTP.C $!
$ call COMPILE NANOHTTP.C $ sources = sources + " trio.c strio.c"
$ call COMPILE PARSER.C $!
$ call COMPILE SAX.C $!- list of main modules to compile and link. Compare this list to the
$ call COMPILE TREE.C $! definition of bin_PROGRAMS in MAKEFILE.
$ call COMPILE URI.C $!
$ call COMPILE VALID.C $ bin_progs = "xmllint xmlcatalog"
$ call COMPILE XLINK.C $!
$ call COMPILE XMLIO.C $!- list of test modules to compile and link. Compare this list to the
$ call COMPILE XMLLINT.C $! definition of noinst_PROGRAMS in MAKEFILE.
$ call COMPILE XMLMEMORY.C $!
$ call COMPILE XPATH.C $ test_progs = "testSAX testHTML testXPath testURI testDocbook"
$! $!
$EXIT_OUT: $!- set up build logicals -----------------------------------------------------\
$ set def 'saved_default $!
$ exit 'exit_status $ if f$trnlnm("xml_srcdir").eqs.""
$! $ then
$ $ globfile = f$search("[...]globals.c")
$ERROR_OUT: $ if globfile.eqs.""
$ exit_status = $status $ then
$ write sys$output 'f$message(exit_status)' $ write sys$output "Can't locate globals.c. You need to define a XML_SRCDIR logical"
$ goto EXIT_OUT $ else
$! $ srcdir = f$element(0,"]",globfile)+ "]"
$COMPILE: subroutine $ define/process xml_srcdir "''srcdir'"
$ on warning then goto EXIT_COMPILE $ write sys$output "Defining xml_srcdir as ""''srcdir'"""
$ source_file = p1 $ endif
$ name = f$element(0,".",source_file) $ endif
$ object_file = f$fao("[.debug]!AS.OBJ",name) $!
$ cc_command /object='object_file 'source_file' $ if f$trnlnm("libxml").eqs.""
$ lib_command 'object_file' $ then
$EXIT_COMPILE: $ globfile = f$search("[...]globals.h")
$ exit $status $ if globfile.nes.""
$endsubroutine $ then
$ write sys$output "Can't locate globals.h. You need to define a LIBXML logical"
$ exit
$ else
$ includedir = f$element(0,"]",globfile)+ "]"
$ define/process libxml "''includedir'"
$ write sys$output "Defining libxml as ""''includedir'"""
$ endif
$ endif
$!
$!- set up error handling (such as it is) -------------------------------------
$!
$ exit_status = 1
$ saved_default = f$environment("default")
$ on error then goto ERROR_OUT
$ on control_y then goto ERROR_OUT
$!
$!- move to the source directory and create any necessary subdirs and the
$! object library
$!
$ set def xml_srcdir
$ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG]
$ if f$search("LIBXML.OLB").eqs."" then library/create LIBXML.OLB
$!
$ goto start_here
$ start_here: ! move this line to debug/rerun parts of this command file
$!
$!- compile modules into the library ------------------------------------------
$!
$ lib_command = "LIBRARY/REPLACE LIBXML.OLB"
$ link_command = ""
$!
$ write sys$output ""
$ write sys$output "Building modules into the LIBXML object library"
$ write sys$output ""
$!
$ s_no = 0
$ sources = f$edit(sources,"COMPRESS")
$!
$ source_loop:
$!
$ next_source = f$element (S_no," ",sources)
$ if next_source.nes."" .and. next_source.nes." "
$ then
$!
$ if next_source.eqs."xpath.c"
$ then
$ call build 'next_source' /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
$ else
$ call build 'next_source'
$ endif
$ s_no = s_no + 1
$ goto source_loop
$!
$ endif
$!
$!- now build self-test programs ----------------------------------------------
$!
$! these pograms are built as ordinary modules into LIBXML.OLB. Here they
$! are built a second time with /DEFINE=(STANDALONE) in which case a main()
$! is also compiled into the module
$
$ lib_command = ""
$ link_command = "LINK"
$!
$ write sys$output ""
$ write sys$output "Building STANDALONE self-test programs"
$ write sys$output ""
$!
$ call build NANOFTP.C /DEFINE=(STANDALONE)
$ call build NANOHTTP.C /DEFINE=(STANDALONE)
$ call build TRIONAN.C /DEFINE=(STANDALONE)/IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
$!
$!- now build main and test programs ------------------------------------------
$!
$!
$ lib_command = ""
$ link_command = "LINK"
$!
$ write sys$output ""
$ write sys$output "Building main programs and test programs"
$ write sys$output ""
$!
$ p_no = 0
$ all_progs = bin_progs + " " + test_progs
$ all_progs = f$edit(all_progs,"COMPRESS")
$!
$ prog_loop:
$!
$ next_prog = f$element (p_no," ",all_progs)
$ if next_prog.nes."" .and. next_prog.nes." "
$ then
$!
$ call build 'next_prog'.c /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
$ p_no = p_no + 1
$ goto prog_loop
$!
$ endif
$!
$!- Th-th-th-th-th-that's all folks! ------------------------------------------
$!
$ exit
$ goto exit_out
$!
$!
$EXIT_OUT:
$!
$ purge/nolog [.debug]
$ set def 'saved_default
$ exit 'exit_status
$!
$
$ERROR_OUT:
$ exit_status = $status
$ write sys$output "''f$message(exit_status)'"
$ goto EXIT_OUT
$!
$!- the BUILD subroutine. Compile then insert into library or link as required
$!
$BUILD: subroutine
$ on warning then goto EXIT_BUILD
$ source_file = p1
$ name = f$element(0,".",source_file)
$ object_file = f$fao("[.debug]!AS.OBJ",name)
$!
$!- compile
$ write sys$output "Compiling ",p1,p2,"..."
$ cc_command /object='object_file 'source_file' 'p2'
$!
$!- insert into library if command defined
$ if lib_command.nes."" then lib_command 'object_file'
$!
$!- link module if command defined
$ if link_command.nes.""
$ then
$ text = f$element(0,".",p1) ! lose the ".c"
$ write sys$output "Linking ",text,"..."
$ link_command 'object_file',-
[]libxml.olb/library
$ endif
$!
$EXIT_BUILD:
$ exit $status
$!
$endsubroutine

50
xmlIO.c
View File

@ -122,6 +122,56 @@ static xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK];
static int xmlOutputCallbackNr = 0; static int xmlOutputCallbackNr = 0;
static int xmlOutputCallbackInitialized = 0; static int xmlOutputCallbackInitialized = 0;
/**
* xmlCleanupInputCallbacks:
*
* clears the entire input callback table. this includes the
* compiled-in I/O.
*/
void
xmlCleanupInputCallbacks(void)
{
int i;
if (!xmlInputCallbackInitialized)
return;
for (i = xmlInputCallbackNr - 1; i <= 0; i--) {
xmlInputCallbackTable[i].matchcallback = NULL;
xmlInputCallbackTable[i].opencallback = NULL;
xmlInputCallbackTable[i].readcallback = NULL;
xmlInputCallbackTable[i].closecallback = NULL;
}
xmlInputCallbackNr = 0;
xmlInputCallbackInitialized = 0;
}
/**
* xmlCleanupOutputCallbacks:
*
* clears the entire output callback table. this includes the
* compiled-in I/O callbacks.
*/
void
xmlCleanupOutputCallbacks(void)
{
int i;
if (!xmlOutputCallbackInitialized)
return;
for (i = xmlOutputCallbackNr - 1; i <= 0; i--) {
xmlOutputCallbackTable[i].matchcallback = NULL;
xmlOutputCallbackTable[i].opencallback = NULL;
xmlOutputCallbackTable[i].writecallback = NULL;
xmlOutputCallbackTable[i].closecallback = NULL;
}
xmlOutputCallbackNr = 0;
xmlOutputCallbackInitialized = 0;
}
/************************************************************************ /************************************************************************
* * * *
* Standard I/O for file accesses * * Standard I/O for file accesses *