[libxml2] OS400: Add some more C macros equivalent procedures.



commit 5378ff9378833f9aac764c1d296cf8f16179ecf5
Author: Patrick Monnerat <pm datasphere ch>
Date:   Tue May 6 13:39:40 2014 +0200

    OS400: Add some more C macros equivalent procedures.

 os400/libxmlrpg/HTMLparser.rpgle |   16 ++++++++++++++++
 os400/libxmlrpg/xpath.rpgle      |    8 ++++----
 os400/rpgsupport.c               |   38 ++++++++++++++++++++++++++++++++++----
 os400/rpgsupport.h               |    9 +++++++++
 4 files changed, 63 insertions(+), 8 deletions(-)
---
diff --git a/os400/libxmlrpg/HTMLparser.rpgle b/os400/libxmlrpg/HTMLparser.rpgle
index 6290b33..7b4a626 100644
--- a/os400/libxmlrpg/HTMLparser.rpgle
+++ b/os400/libxmlrpg/HTMLparser.rpgle
@@ -383,5 +383,21 @@
      d  #param1                            value like(htmlNodePtr)
      d  #param2                      10i 0 value
 
+      * C macros implemented as procedures for ILE/RPG support.
+
+     d htmlDefaultSubelement...
+     d                 pr              *   extproc('__htmlDefaultSubelement')   const char *
+     d  elt                            *   value                                const htmlElemDesc *
+
+     d htmlElementAllowedHereDesc...
+     d                 pr            10i 0 extproc(
+     d                                     '__htmlElementAllowedHereDesc')
+     d  parent                         *   value                                const htmlElemDesc *
+     d  elt                            *   value                                const htmlElemDesc *
+
+     d htmlRequiredAttrs...
+     d                 pr              *   extproc('__htmlRequiredAttrs')        const char * *
+     d  elt                            *   value                                const htmlElemDesc *
+
       /endif                                                                    LIBXML_HTML_ENABLED
       /endif                                                                    HTML_PARSER_H__
diff --git a/os400/libxmlrpg/xpath.rpgle b/os400/libxmlrpg/xpath.rpgle
index a31a4ac..3f3be32 100644
--- a/os400/libxmlrpg/xpath.rpgle
+++ b/os400/libxmlrpg/xpath.rpgle
@@ -628,20 +628,20 @@
 
       /undefine XML_TESTVAL
       /endif
-      *
+
       * C macros implemented as procedures for ILE/RPG support.
-      *
+
       /if defined(LIBXML_XPATH_ENABLED)
      d xmlXPathNodeSetGetLength...
      d                 pr            10i 0 extproc('__xmlXPathNodeSetGetLength')
      d  ns                                 value like(xmlNodeSetPtr)
-      *
+
      d xmlXPathNodeSetItem...
      d                 pr                  extproc('__xmlXPathNodeSetItem')
      d                                     like(xmlNodePtr)
      d  ns                                 value like(xmlNodeSetPtr)
      d  index                        10i 0 value
-      *
+
      d xmlXPathNodeSetIsEmpty...
      d                 pr            10i 0 extproc('__xmlXPathNodeSetIsEmpty')
      d  ns                                 value like(xmlNodeSetPtr)
diff --git a/os400/rpgsupport.c b/os400/rpgsupport.c
index a545483..a3609c0 100644
--- a/os400/rpgsupport.c
+++ b/os400/rpgsupport.c
@@ -13,12 +13,13 @@
 #include "libxml/xmlmemory.h"
 #include "libxml/xpath.h"
 #include "libxml/parser.h"
+#include "libxml/HTMLparser.h"
 
 #include "rpgsupport.h"
 
 
 /**
-***     ILE/RPG cannot directly derefence a pointer value an has no macros.
+***     ILE/RPG cannot directly derefence a pointer and has no macros.
 ***     The following additional procedures supply these functions.
 ***     In addition, the following code is adjusted for threads control at
 ***             compile time via the C macros.
@@ -215,7 +216,7 @@ __xmlVaEnd(char * * list)
 #ifdef LIBXML_XPATH_ENABLED
 
 int
-__xmlXPathNodeSetGetLength(xmlNodeSetPtr ns)
+__xmlXPathNodeSetGetLength(const xmlNodeSet * ns)
 
 {
        return xmlXPathNodeSetGetLength(ns);
@@ -223,7 +224,7 @@ __xmlXPathNodeSetGetLength(xmlNodeSetPtr ns)
 
 
 xmlNodePtr
-__xmlXPathNodeSetItem(xmlNodeSetPtr ns, int index)
+__xmlXPathNodeSetItem(const xmlNodeSet * ns, int index)
 
 {
        return xmlXPathNodeSetItem(ns, index);
@@ -231,10 +232,39 @@ __xmlXPathNodeSetItem(xmlNodeSetPtr ns, int index)
 
 
 int
-__xmlXPathNodeSetIsEmpty(xmlNodeSetPtr ns)
+__xmlXPathNodeSetIsEmpty(const xmlNodeSet * ns)
 
 {
        return xmlXPathNodeSetIsEmpty(ns);
 }
 
 #endif
+
+
+#ifdef LIBXML_HTML_ENABLED
+
+const char *
+__htmlDefaultSubelement(const htmlElemDesc * elt)
+
+{
+       return htmlDefaultSubelement(elt);
+}
+
+
+int
+__htmlElementAllowedHereDesc(const htmlElemDesc * parent,
+                                               const htmlElemDesc * elt)
+
+{
+       return htmlElementAllowedHereDesc(parent, elt);
+}
+
+
+const char * *
+__htmlRequiredAttrs(const htmlElemDesc * elt)
+
+{
+       return htmlRequiredAttrs(elt);
+}
+
+#endif
diff --git a/os400/rpgsupport.h b/os400/rpgsupport.h
index 20752f5..6725b59 100644
--- a/os400/rpgsupport.h
+++ b/os400/rpgsupport.h
@@ -13,6 +13,7 @@
 
 #include <libxml/xmlmemory.h>
 #include <libxml/xpath.h>
+#include "libxml/HTMLparser.h"
 
 
 XMLPUBFUN xmlFreeFunc   __get_xmlFree(void);
@@ -145,4 +146,12 @@ XMLPUBFUN xmlNodePtr       __xmlXPathNodeSetItem(xmlNodeSetPtr ns, int index);
 XMLPUBFUN int          __xmlXPathNodeSetIsEmpty(xmlNodeSetPtr ns);
 #endif
 
+#ifdef LIBXML_HTML_ENABLED
+XMLPUBFUN const char * __htmlDefaultSubelement(const htmlElemDesc * elt);
+XMLPUBFUN int  __htmlElementAllowedHereDesc(const htmlElemDesc * parent,
+                       const htmlElemDesc * elt);
+XMLPUBFUN const char * *
+                       __htmlRequiredAttrs(const htmlElemDesc * elt);
+#endif
+
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]