Diff for /XML/valid.c between versions 1.63 and 1.64

version 1.63, 2000/06/30 17:56:07 version 1.64, 2000/07/05 12:32:16
Line 33 Line 33
 scope int name##VPush(xmlValidCtxtPtr ctxt, type value) {               \  scope int name##VPush(xmlValidCtxtPtr ctxt, type value) {               \
     if (ctxt->name##Nr >= ctxt->name##Max) {                            \      if (ctxt->name##Nr >= ctxt->name##Max) {                            \
         ctxt->name##Max *= 2;                                           \          ctxt->name##Max *= 2;                                           \
         ctxt->name##Tab = (void *) xmlRealloc(ctxt->name##Tab,          \          ctxt->name##Tab = (type *) xmlRealloc(ctxt->name##Tab,          \
                      ctxt->name##Max * sizeof(ctxt->name##Tab[0]));     \                       ctxt->name##Max * sizeof(ctxt->name##Tab[0]));     \
         if (ctxt->name##Tab == NULL) {                                  \          if (ctxt->name##Tab == NULL) {                                  \
             fprintf(stderr, "realloc failed !\n");                      \              fprintf(stderr, "realloc failed !\n");                      \
Line 538  xmlAddElementDecl(xmlValidCtxtPtr ctxt, Line 538  xmlAddElementDecl(xmlValidCtxtPtr ctxt,
     /*      /*
      * Create the Element table if needed.       * Create the Element table if needed.
      */       */
     table = dtd->elements;      table = (xmlElementTablePtr) dtd->elements;
     if (table == NULL)       if (table == NULL) {
         table = dtd->elements = xmlCreateElementTable();          table = xmlCreateElementTable();
           dtd->elements = (void *) table;
       }
     if (table == NULL) {      if (table == NULL) {
         fprintf(stderr, "xmlAddElementDecl: Table creation failed!\n");          fprintf(stderr, "xmlAddElementDecl: Table creation failed!\n");
         return(NULL);          return(NULL);
Line 909  xmlScanAttributeDecl(xmlDtdPtr dtd, cons Line 911  xmlScanAttributeDecl(xmlDtdPtr dtd, cons
         fprintf(stderr, "xmlScanAttributeDecl: elem == NULL\n");          fprintf(stderr, "xmlScanAttributeDecl: elem == NULL\n");
         return(NULL);          return(NULL);
     }      }
     table = dtd->attributes;      table = (xmlAttributeTablePtr) dtd->attributes;
     if (table == NULL)       if (table == NULL) 
         return(NULL);          return(NULL);
   
Line 1029  xmlAddAttributeDecl(xmlValidCtxtPtr ctxt Line 1031  xmlAddAttributeDecl(xmlValidCtxtPtr ctxt
     /*      /*
      * Create the Attribute table if needed.       * Create the Attribute table if needed.
      */       */
     table = dtd->attributes;      table = (xmlAttributeTablePtr) dtd->attributes;
     if (table == NULL)       if (table == NULL) {
         table = dtd->attributes = xmlCreateAttributeTable();          table = xmlCreateAttributeTable();
           dtd->attributes = (void *) table;
       }
     if (table == NULL) {      if (table == NULL) {
         fprintf(stderr, "xmlAddAttributeDecl: Table creation failed!\n");          fprintf(stderr, "xmlAddAttributeDecl: Table creation failed!\n");
         return(NULL);          return(NULL);
Line 1388  xmlAddNotationDecl(xmlValidCtxtPtr ctxt, Line 1392  xmlAddNotationDecl(xmlValidCtxtPtr ctxt,
     /*      /*
      * Create the Notation table if needed.       * Create the Notation table if needed.
      */       */
     table = dtd->notations;      table = (xmlNotationTablePtr) dtd->notations;
     if (table == NULL)       if (table == NULL) 
         table = dtd->notations = xmlCreateNotationTable();          dtd->notations = table = xmlCreateNotationTable();
     if (table == NULL) {      if (table == NULL) {
         fprintf(stderr, "xmlAddNotationDecl: Table creation failed!\n");          fprintf(stderr, "xmlAddNotationDecl: Table creation failed!\n");
         return(NULL);          return(NULL);
Line 1657  xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr Line 1661  xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr
     /*      /*
      * Create the ID table if needed.       * Create the ID table if needed.
      */       */
     table = doc->ids;      table = (xmlIDTablePtr) doc->ids;
     if (table == NULL)       if (table == NULL) 
         table = doc->ids = xmlCreateIDTable();          doc->ids = table = xmlCreateIDTable();
     if (table == NULL) {      if (table == NULL) {
         fprintf(stderr, "xmlAddID: Table creation failed!\n");          fprintf(stderr, "xmlAddID: Table creation failed!\n");
         return(NULL);          return(NULL);
Line 1804  xmlRemoveID(xmlDocPtr doc, xmlAttrPtr at Line 1808  xmlRemoveID(xmlDocPtr doc, xmlAttrPtr at
   
     if (doc == NULL) return(-1);      if (doc == NULL) return(-1);
     if (attr == NULL) return(-1);      if (attr == NULL) return(-1);
     table = doc->ids;      table = (xmlIDTablePtr) doc->ids;
     if (table == NULL)       if (table == NULL) 
         return(-1);          return(-1);
   
Line 1848  xmlGetID(xmlDocPtr doc, const xmlChar *I Line 1852  xmlGetID(xmlDocPtr doc, const xmlChar *I
         return(NULL);          return(NULL);
     }      }
   
     table = doc->ids;      table = (xmlIDTablePtr) doc->ids;
     if (table == NULL)       if (table == NULL) 
         return(NULL);          return(NULL);
   
Line 1935  xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPt Line 1939  xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPt
     /*      /*
      * Create the Ref table if needed.       * Create the Ref table if needed.
      */       */
     table = doc->refs;      table = (xmlRefTablePtr) doc->refs;
     if (table == NULL)       if (table == NULL) 
         table = doc->refs = xmlCreateRefTable();          doc->refs = table = xmlCreateRefTable();
     if (table == NULL) {      if (table == NULL) {
         fprintf(stderr, "xmlAddRef: Table creation failed!\n");          fprintf(stderr, "xmlAddRef: Table creation failed!\n");
         return(NULL);          return(NULL);
Line 2065  xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr a Line 2069  xmlRemoveRef(xmlDocPtr doc, xmlAttrPtr a
   
     if (doc == NULL) return(-1);      if (doc == NULL) return(-1);
     if (attr == NULL) return(-1);      if (attr == NULL) return(-1);
     table = doc->refs;      table = (xmlRefTablePtr) doc->refs;
     if (table == NULL)       if (table == NULL) 
         return(-1);          return(-1);
   
Line 2109  xmlGetRef(xmlDocPtr doc, const xmlChar * Line 2113  xmlGetRef(xmlDocPtr doc, const xmlChar *
         return(NULL);          return(NULL);
     }      }
   
     table = doc->refs;      table = (xmlRefTablePtr) doc->refs;
     if (table == NULL)       if (table == NULL) 
         return(NULL);          return(NULL);
   
Line 2150  xmlGetDtdElementDesc(xmlDtdPtr dtd, cons Line 2154  xmlGetDtdElementDesc(xmlDtdPtr dtd, cons
   
     if (dtd == NULL) return(NULL);      if (dtd == NULL) return(NULL);
     if (dtd->elements == NULL) return(NULL);      if (dtd->elements == NULL) return(NULL);
     table = dtd->elements;      table = (xmlElementTablePtr) dtd->elements;
   
     for (i = 0;i < table->nb_elements;i++) {      for (i = 0;i < table->nb_elements;i++) {
         cur = table->table[i];          cur = table->table[i];
Line 2200  xmlGetDtdQElementDesc(xmlDtdPtr dtd, con Line 2204  xmlGetDtdQElementDesc(xmlDtdPtr dtd, con
   
     if (dtd == NULL) return(NULL);      if (dtd == NULL) return(NULL);
     if (dtd->elements == NULL) return(NULL);      if (dtd->elements == NULL) return(NULL);
     table = dtd->elements;      table = (xmlElementTablePtr) dtd->elements;
   
     for (i = 0;i < table->nb_elements;i++) {      for (i = 0;i < table->nb_elements;i++) {
         cur = table->table[i];          cur = table->table[i];
Line 2234  xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x Line 2238  xmlGetDtdAttrDesc(xmlDtdPtr dtd, const x
   
     if (dtd == NULL) return(NULL);      if (dtd == NULL) return(NULL);
     if (dtd->attributes == NULL) return(NULL);      if (dtd->attributes == NULL) return(NULL);
     table = dtd->attributes;      table = (xmlAttributeTablePtr) dtd->attributes;
   
     for (i = 0;i < table->nb_attributes;i++) {      for (i = 0;i < table->nb_attributes;i++) {
         cur = table->table[i];          cur = table->table[i];
Line 2288  xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const Line 2292  xmlGetDtdQAttrDesc(xmlDtdPtr dtd, const
   
     if (dtd == NULL) return(NULL);      if (dtd == NULL) return(NULL);
     if (dtd->attributes == NULL) return(NULL);      if (dtd->attributes == NULL) return(NULL);
     table = dtd->attributes;      table = (xmlAttributeTablePtr) dtd->attributes;
   
     for (i = 0;i < table->nb_attributes;i++) {      for (i = 0;i < table->nb_attributes;i++) {
         cur = table->table[i];          cur = table->table[i];
Line 2320  xmlGetDtdNotationDesc(xmlDtdPtr dtd, con Line 2324  xmlGetDtdNotationDesc(xmlDtdPtr dtd, con
   
     if (dtd == NULL) return(NULL);      if (dtd == NULL) return(NULL);
     if (dtd->notations == NULL) return(NULL);      if (dtd->notations == NULL) return(NULL);
     table = dtd->notations;      table = (xmlNotationTablePtr) dtd->notations;
   
     for (i = 0;i < table->nb_notations;i++) {      for (i = 0;i < table->nb_notations;i++) {
         cur = table->table[i];          cur = table->table[i];
Line 2890  xmlValidateAttributeDecl(xmlValidCtxtPtr Line 2894  xmlValidateAttributeDecl(xmlValidCtxtPtr
              * element in the external subset.               * element in the external subset.
              */               */
             nbId = 0;              nbId = 0;
             table = doc->intSubset->attributes;              table = (xmlAttributeTablePtr) doc->intSubset->attributes;
             if (table != NULL) {              if (table != NULL) {
                 for (i = 0;i < table->nb_attributes;i++) {                  for (i = 0;i < table->nb_attributes;i++) {
                     if ((table->table[i]->atype == XML_ATTRIBUTE_ID) &&                      if ((table->table[i]->atype == XML_ATTRIBUTE_ID) &&
Line 3902  xmlValidateDocumentFinal(xmlValidCtxtPtr Line 3906  xmlValidateDocumentFinal(xmlValidCtxtPtr
     /*      /*
      * Check all the IDREF/IDREFS attributes definition for validity       * Check all the IDREF/IDREFS attributes definition for validity
      */       */
     table = doc->refs;      table = (xmlRefTablePtr) doc->refs;
     if (table != NULL) {      if (table != NULL) {
         for (i = 0; i < table->nb_refs; i++) {          for (i = 0; i < table->nb_refs; i++) {
             if (table->table[i]->attr->atype == XML_ATTRIBUTE_IDREF) {              if (table->table[i]->attr->atype == XML_ATTRIBUTE_IDREF) {
Line 4008  xmlValidateDtdFinal(xmlValidCtxtPtr ctxt Line 4012  xmlValidateDtdFinal(xmlValidCtxtPtr ctxt
         return(0);          return(0);
     dtd = doc->intSubset;      dtd = doc->intSubset;
     if ((dtd != NULL) && (dtd->attributes != NULL)) {      if ((dtd != NULL) && (dtd->attributes != NULL)) {
         table = dtd->attributes;          table = (xmlAttributeTablePtr) dtd->attributes;
   
         for (i = 0;i < table->nb_attributes;i++) {          for (i = 0;i < table->nb_attributes;i++) {
             cur = table->table[i];              cur = table->table[i];
Line 4041  xmlValidateDtdFinal(xmlValidCtxtPtr ctxt Line 4045  xmlValidateDtdFinal(xmlValidCtxtPtr ctxt
     }      }
     dtd = doc->extSubset;      dtd = doc->extSubset;
     if ((dtd != NULL) && (dtd->attributes != NULL)) {      if ((dtd != NULL) && (dtd->attributes != NULL)) {
         table = dtd->attributes;          table = (xmlAttributeTablePtr) dtd->attributes;
   
         for (i = 0;i < table->nb_attributes;i++) {          for (i = 0;i < table->nb_attributes;i++) {
             cur = table->table[i];              cur = table->table[i];

Removed from v.1.63  
changed lines
  Added in v.1.64


Webmaster