Home | History | Annotate | Download | only in libxmlrpg
      1       * Summary: Tree debugging APIs
      2       * Description: Interfaces to a set of routines used for debugging the tree
      3       *              produced by the XML parser.
      4       *
      5       * Copy: See Copyright for the status of this software.
      6       *
      7       * Author: Patrick Monnerat <pm (a] datasphere.ch>, DATASPHERE S.A.
      8 
      9       /if not defined(DEBUG_XML__)
     10       /define DEBUG_XML__
     11 
     12       /include "libxmlrpg/xmlversion"
     13 
     14       /if defined(LIBXML_DEBUG_ENABLED)
     15 
     16       /include "libxmlrpg/xmlTypesC"
     17       /include "libxmlrpg/tree"
     18       /include "libxmlrpg/xpath"
     19 
     20       * The standard Dump routines.
     21 
     22      d xmlDebugDumpString...
     23      d                 pr                  extproc('xmlDebugDumpString')
     24      d  output                         *   value                                FILE *
     25      d  str                            *   value options(*string)               const xmlChar *
     26 
     27      d xmlDebugDumpAttr...
     28      d                 pr                  extproc('xmlDebugDumpAttr')
     29      d  output                         *   value                                FILE *
     30      d  attr                               value like(xmlAttrPtr)
     31      d  depth                              value like(xmlCint)
     32 
     33      d xmlDebugDumpAttrList...
     34      d                 pr                  extproc('xmlDebugDumpAttrList')
     35      d  output                         *   value                                FILE *
     36      d  attr                               value like(xmlAttrPtr)
     37      d  depth                              value like(xmlCint)
     38 
     39      d xmlDebugDumpOneNode...
     40      d                 pr                  extproc('xmlDebugDumpOneNode')
     41      d  output                         *   value                                FILE *
     42      d  node                               value like(xmlNodePtr)
     43      d  depth                              value like(xmlCint)
     44 
     45      d xmlDebugDumpNode...
     46      d                 pr                  extproc('xmlDebugDumpNode')
     47      d  output                         *   value                                FILE *
     48      d  node                               value like(xmlNodePtr)
     49      d  depth                              value like(xmlCint)
     50 
     51      d xmlDebugDumpNodeList...
     52      d                 pr                  extproc('xmlDebugDumpNodeList')
     53      d  output                         *   value                                FILE *
     54      d  node                               value like(xmlNodePtr)
     55      d  depth                              value like(xmlCint)
     56 
     57      d xmlDebugDumpDocumentHead...
     58      d                 pr                  extproc('xmlDebugDumpDocumentHead')
     59      d  output                         *   value                                FILE *
     60      d  doc                                value like(xmlDocPtr)
     61 
     62      d xmlDebugDumpDocument...
     63      d                 pr                  extproc('xmlDebugDumpDocument')
     64      d  output                         *   value                                FILE *
     65      d  doc                                value like(xmlDocPtr)
     66 
     67      d xmlDebugDumpDTD...
     68      d                 pr                  extproc('xmlDebugDumpDTD')
     69      d  output                         *   value                                FILE *
     70      d  dtd                                value like(xmlDtdPtr)
     71 
     72      d xmlDebugDumpEntities...
     73      d                 pr                  extproc('xmlDebugDumpEntities')
     74      d  output                         *   value                                FILE *
     75      d  doc                                value like(xmlDocPtr)
     76 
     77       ****************************************************************
     78       *                                                              *
     79       *                      Checking routines                       *
     80       *                                                              *
     81       ****************************************************************
     82 
     83      d xmlDebugCheckDocument...
     84      d                 pr                  extproc('xmlDebugCheckDocument')
     85      d                                     like(xmlCint)
     86      d  output                         *   value                                FILE *
     87      d  doc                                value like(xmlDocPtr)
     88 
     89       ****************************************************************
     90       *                                                              *
     91       *                      XML shell helpers                       *
     92       *                                                              *
     93       ****************************************************************
     94 
     95      d xmlLsOneNode    pr                  extproc('xmlLsOneNode')
     96      d  output                         *   value                                FILE *
     97      d  node                               value like(xmlNodePtr)
     98 
     99      d xmlLsCountNode  pr                  extproc('xmlLsCountNode')
    100      d                                     like(xmlCint)
    101      d  node                               value like(xmlNodePtr)
    102 
    103      d xmlBoolToText   pr              *   extproc('xmlBoolToText')             const char *
    104      d  boolval                            value like(xmlCint)
    105 
    106       ****************************************************************
    107       *                                                              *
    108       *       The XML shell related structures and functions         *
    109       *                                                              *
    110       ****************************************************************
    111 
    112       /if defined(LIBXML_XPATH_ENABLED)
    113 
    114       * xmlShellReadlineFunc:
    115       * @prompt:  a string prompt
    116       *
    117       * This is a generic signature for the XML shell input function.
    118       *
    119       * Returns a string which will be freed by the Shell.
    120 
    121      d xmlShellReadlineFunc...
    122      d                 s               *   based(######typedef######)
    123      d                                     procptr
    124 
    125       * xmlShellCtxt:
    126       *
    127       * A debugging shell context.
    128       * TODO: add the defined function tables.
    129 
    130      d xmlShellCtxtPtr...
    131      d                 s               *   based(######typedef######)
    132 
    133      d xmlSchellCtxt   ds                  based(xmlShellCtxtPtr)
    134      d                                     align qualified
    135      d  filename                       *                                        char *
    136      d  doc                                like(xmlDocPtr)
    137      d  node                               like(xmlNodePtr)
    138      d  pctxt                              like(xmlXPathContextPtr)
    139      d  loaded                             like(xmlCint)
    140      d  output                         *                                        FILE *
    141      d  input                              like(xmlShellReadlineFunc)
    142 
    143       * xmlShellCmd:
    144       * @ctxt:  a shell context
    145       * @arg:  a string argument
    146       * @node:  a first node
    147       * @node2:  a second node
    148       *
    149       * This is a generic signature for the XML shell functions.
    150       *
    151       * Returns an int, negative returns indicating errors.
    152 
    153      d xmlShellCmd     s               *   based(######typedef######)
    154      d                                     procptr
    155 
    156      d xmlShellPrintXPathError...
    157      d                 pr                  extproc('xmlShellPrintXPathError')
    158      d  errorType                          value like(xmlCint)
    159      d  arg                            *   value options(*string)               const char *
    160 
    161      d xmlShellPrintXPathResult...
    162      d                 pr                  extproc('xmlShellPrintXPathResult')
    163      d  list                               value like(xmlXPathObjectPtr)
    164 
    165      d xmlShellList    pr                  extproc('xmlShellList')
    166      d                                     like(xmlCint)
    167      d  ctxt                               value like(xmlShellCtxtPtr)
    168      d  arg                            *   value options(*string)               char *
    169      d  node                               value like(xmlNodePtr)
    170      d  node2                              value like(xmlNodePtr)
    171 
    172      d xmlShellBase    pr                  extproc('xmlShellBase')
    173      d                                     like(xmlCint)
    174      d  ctxt                               value like(xmlShellCtxtPtr)
    175      d  arg                            *   value options(*string)               char *
    176      d  node                               value like(xmlNodePtr)
    177      d  node2                              value like(xmlNodePtr)
    178 
    179      d xmlShellDir     pr                  extproc('xmlShellDir')
    180      d                                     like(xmlCint)
    181      d  ctxt                               value like(xmlShellCtxtPtr)
    182      d  arg                            *   value options(*string)               char *
    183      d  node                               value like(xmlNodePtr)
    184      d  node2                              value like(xmlNodePtr)
    185 
    186      d xmlShellLoad    pr                  extproc('xmlShellLoad')
    187      d                                     like(xmlCint)
    188      d  ctxt                               value like(xmlShellCtxtPtr)
    189      d  filename                       *   value options(*string)               char *
    190      d  node                               value like(xmlNodePtr)
    191      d  node2                              value like(xmlNodePtr)
    192 
    193       /if defined(LIBXML_OUTPUT_ENABLED)
    194      d xmlShellPrintNode...
    195      d                 pr                  extproc('xmlShellPrintNode')
    196      d  node                               value like(xmlNodePtr)
    197 
    198      d xmlShellCat     pr                  extproc('xmlShellCat')
    199      d                                     like(xmlCint)
    200      d  ctxt                               value like(xmlShellCtxtPtr)
    201      d  arg                            *   value options(*string)               char *
    202      d  node                               value like(xmlNodePtr)
    203      d  node2                              value like(xmlNodePtr)
    204 
    205      d xmlShellWrite   pr                  extproc('xmlShellWrite')
    206      d                                     like(xmlCint)
    207      d  ctxt                               value like(xmlShellCtxtPtr)
    208      d  filename                       *   value options(*string)               char *
    209      d  node                               value like(xmlNodePtr)
    210      d  node2                              value like(xmlNodePtr)
    211 
    212      d xmlShellSave    pr                  extproc('xmlShellSave')
    213      d                                     like(xmlCint)
    214      d  ctxt                               value like(xmlShellCtxtPtr)
    215      d  filename                       *   value options(*string)               char *
    216      d  node                               value like(xmlNodePtr)
    217      d  node2                              value like(xmlNodePtr)
    218       /endif                                                                    LIBXML_OUTPUT_ENABLD
    219 
    220       /if defined(LIBXML_VALID_ENABLED)
    221      d xmlShellValidate...
    222      d                 pr                  extproc('xmlShellValidate')
    223      d                                     like(xmlCint)
    224      d  ctxt                               value like(xmlShellCtxtPtr)
    225      d  dtd                            *   value options(*string)               char *
    226      d  node                               value like(xmlNodePtr)
    227      d  node2                              value like(xmlNodePtr)
    228       /endif                                                                    LIBXML_VALID_ENABLED
    229 
    230      d xmlShellDu      pr                  extproc('xmlShellDu')
    231      d                                     like(xmlCint)
    232      d  ctxt                               value like(xmlShellCtxtPtr)
    233      d  arg                            *   value options(*string)               char *
    234      d  tree                               value like(xmlNodePtr)
    235      d  node2                              value like(xmlNodePtr)
    236 
    237      d xmlShellPwd     pr                  extproc('xmlShellPwd')
    238      d                                     like(xmlCint)
    239      d  ctxt                               value like(xmlShellCtxtPtr)
    240      d  buffer                         *   value options(*string)               char *
    241      d  node                               value like(xmlNodePtr)
    242      d  node2                              value like(xmlNodePtr)
    243 
    244       * The Shell interface.
    245 
    246      d xmlShell        pr                  extproc('xmlShell')
    247      d  doc                                value like(xmlDocPtr)
    248      d  filename                       *   value options(*string)               char *
    249      d  input                              value like(xmlShellReadlineFunc)
    250      d  output                         *   value                                FILE *
    251 
    252       /endif                                                                    LIBXML_XPATH_ENABLED
    253       /endif                                                                    LIBXML_DEBUG_ENABLED
    254       /endif                                                                    DEBUG_XML__
    255