Annotation of Amaya/amaya/fetchXMLname.c, revision 1.54

1.1       cvs         1: /*
                      2:  *
1.38      cvs         3:  *  (c) COPYRIGHT MIT and INRIA, 1996-2001
1.1       cvs         4:  *  Please first read the full copyright statement in file COPYRIGHT.
                      5:  *
                      6:  */
                      7:  
                      8: /*
                      9:  *
                     10:  * fetchXMLname
                     11:  *
1.46      cvs        12:  * Authors: I. Vatton
                     13:  *          L. Carcone
1.1       cvs        14:  *
                     15:  */
                     16: 
                     17: #define THOT_EXPORT extern
                     18: #include "amaya.h"
                     19: #include "parser.h"
1.24      cvs        20: #include "HTMLnames.h"
                     21: #include "MathMLnames.h"
1.49      vatton     22: #include "SVGnames.h"
1.24      cvs        23: #include "XLinknames.h"
                     24: 
1.35      cvs        25: /* define some pointers to let other parser functions access the local table */
1.24      cvs        26: int               HTML_ENTRIES = (sizeof(XHTMLElemMappingTable) / sizeof(ElemMapping));
                     27: ElemMapping      *pHTMLGIMapping = XHTMLElemMappingTable;
                     28: AttributeMapping *pHTMLAttributeMapping = XHTMLAttributeMappingTable;
1.14      cvs        29: 
1.35      cvs        30: XmlEntity        *pXhtmlEntityTable = XhtmlEntityTable;
                     31: XmlEntity        *pMathEntityTable = MathEntityTable;
1.1       cvs        32: 
                     33: #include "fetchXMLname_f.h"
                     34: 
1.39      cvs        35: /* Global variables used by the entity mapping */
                     36: static int        XHTMLSup = 0;
                     37: static int        MathSup = 0;
                     38: 
1.1       cvs        39: /*----------------------------------------------------------------------
1.14      cvs        40:    GetXHTMLSSchema returns the XHTML Thot schema for document doc.
                     41:   ----------------------------------------------------------------------*/
1.46      cvs        42: SSchema         GetXHTMLSSchema (Document doc)
1.14      cvs        43: {
                     44:   SSchema      XHTMLSSchema;
                     45: 
1.43      cvs        46:    XHTMLSSchema = TtaGetSSchema ("HTML", doc);
1.14      cvs        47:    if (XHTMLSSchema == NULL)
1.17      cvs        48:        XHTMLSSchema = TtaNewNature(doc, TtaGetDocumentSSchema(doc),
1.46      cvs        49:                                   "HTML", "HTMLP");
1.14      cvs        50:    return (XHTMLSSchema);
                     51: }
                     52: 
1.54    ! cvs        53: /*----------------------------------------------------------------------
1.1       cvs        54:    GetMathMLSSchema returns the MathML Thot schema for document doc.
                     55:   ----------------------------------------------------------------------*/
1.46      cvs        56: SSchema         GetMathMLSSchema (Document doc)
1.1       cvs        57: {
                     58:   SSchema      MathMLSSchema;
                     59: 
1.43      cvs        60:   MathMLSSchema = TtaGetSSchema ("MathML", doc);
1.13      cvs        61:   if (MathMLSSchema == NULL)
1.17      cvs        62:      MathMLSSchema = TtaNewNature(doc, 
1.46      cvs        63:                                  TtaGetDocumentSSchema(doc),
                     64:                                  "MathML", "MathMLP");
1.13      cvs        65:   return (MathMLSSchema);
1.1       cvs        66: }
                     67: 
                     68: /*----------------------------------------------------------------------
1.49      vatton     69:    GetSVGSSchema returns the SVG Thot schema for document doc.
1.1       cvs        70:   ----------------------------------------------------------------------*/
1.49      vatton     71: SSchema         GetSVGSSchema (Document doc)
1.1       cvs        72: 
                     73: {
1.49      vatton     74:   SSchema      SVGSSchema;
1.1       cvs        75: 
1.49      vatton     76:   SVGSSchema = TtaGetSSchema ("SVG", doc);
                     77:   if (SVGSSchema == NULL)
                     78:     SVGSSchema = TtaNewNature(doc,
1.46      cvs        79:                                  TtaGetDocumentSSchema(doc),
1.49      vatton     80:                                  "SVG", "SVGP");
                     81:   return (SVGSSchema);
1.1       cvs        82: }
                     83: 
                     84: /*----------------------------------------------------------------------
1.13      cvs        85:    GetXLinkSSchema returns the XLink Thot schema for document doc.
                     86:   ----------------------------------------------------------------------*/
1.46      cvs        87: SSchema         GetXLinkSSchema (Document doc)
1.13      cvs        88: 
                     89: {
                     90:   SSchema      XLinkSSchema;
                     91: 
1.43      cvs        92:   XLinkSSchema = TtaGetSSchema ("XLink", doc);
1.13      cvs        93:   if (XLinkSSchema == NULL)
1.46      cvs        94:     XLinkSSchema = TtaNewNature(doc, TtaGetDocumentSSchema(doc),
                     95:                                "XLink", "XLinkP");
1.13      cvs        96:   return (XLinkSSchema);
                     97: }
                     98: 
                     99: /*----------------------------------------------------------------------
1.46      cvs       100:    GetGenericXMLSSchema returns the XML Thot schema for the document doc.
                    101:   ----------------------------------------------------------------------*/
                    102: SSchema         GetGenericXMLSSchema (Document doc)
                    103: 
                    104: {
                    105:   SSchema      XMLSSchema;
                    106: 
                    107:   XMLSSchema = TtaGetSSchema ("XML", doc);
                    108:   if (XMLSSchema == NULL)
                    109:       XMLSSchema = TtaNewNature(doc, TtaGetDocumentSSchema(doc),
                    110:                                "XML", "XMLP");
                    111:   return (XMLSSchema);
                    112: }
                    113: 
                    114: /*----------------------------------------------------------------------
                    115:    GetGenericXMLSSchemaByUri returns the XML Thot schema for the document doc.
                    116:   ----------------------------------------------------------------------*/
                    117: SSchema         GetGenericXMLSSchemaByUri (char *uriName, Document doc, ThotBool *isnew)
                    118: 
                    119: {
                    120:   SSchema      XMLSSchema;
                    121: 
                    122:   XMLSSchema = TtaGetSSchemaByUri (uriName, doc);
                    123:   if (XMLSSchema == NULL)
                    124:     {
                    125:       XMLSSchema = TtaNewNature(doc, TtaGetDocumentSSchema(doc),
                    126:                                "XML", "XMLP");
                    127:       *isnew = TRUE;
                    128:     }
                    129:   return (XMLSSchema);
                    130: }
                    131: 
                    132: /*----------------------------------------------------------------------
1.13      cvs       133:    GetXMLSSchema returns the XML Thot schema for document doc.
1.1       cvs       134:   ----------------------------------------------------------------------*/
1.45      cvs       135: SSchema GetXMLSSchema (int XMLtype, Document doc)
1.38      cvs       136: 
1.1       cvs       137: {
1.14      cvs       138:   if (XMLtype == XHTML_TYPE)
                    139:     return GetXHTMLSSchema (doc);
                    140:   else if (XMLtype == MATH_TYPE)
1.13      cvs       141:     return GetMathMLSSchema (doc);
1.51      cvs       142:   else if (XMLtype == SVG_TYPE)
1.49      vatton    143:     return GetSVGSSchema (doc);
1.13      cvs       144:   else if (XMLtype == XLINK_TYPE)
1.15      cvs       145:     return GetXLinkSSchema (doc);
1.13      cvs       146:   else
                    147:     return NULL;
1.1       cvs       148: }
                    149: 
                    150: /*----------------------------------------------------------------------
1.22      cvs       151:   MapXMLElementType
                    152:   Generic function which searchs in the Element Mapping table, selected
                    153:   by the parameter XMLtype, the entry XMLname and returns the corresponding
                    154:   Thot element type.
1.1       cvs       155:    Returns:
1.22      cvs       156:     - ElTypeNum and ElSSchema into elType  ElTypeNum = 0 if not found.
1.1       cvs       157:     - content 
                    158:   ----------------------------------------------------------------------*/
1.46      cvs       159: void MapXMLElementType (int XMLtype,
                    160:                        char *XMLname,
                    161:                        ElementType *elType,
                    162:                        char **mappedName,
                    163:                        char *content,
                    164:                        ThotBool *highEnoughLevel,
1.45      cvs       165:                        Document doc)
1.1       cvs       166: {
                    167:    int                 i;
                    168:    ElemMapping        *ptr;
                    169: 
1.32      cvs       170:    /* Initialize variables */
                    171:    *mappedName = NULL;
                    172:    *highEnoughLevel = TRUE;
                    173:    elType->ElTypeNum = 0;
                    174: 
1.1       cvs       175:    /* Select the right table */
1.14      cvs       176:    if (XMLtype == XHTML_TYPE)
                    177:      ptr = XHTMLElemMappingTable;
                    178:    else if (XMLtype == MATH_TYPE)
1.31      cvs       179:      {
1.53      cvs       180:        if (TtaGetDocumentProfile(doc) == L_Basic &&
                    181:           DocumentTypes[doc] == docHTML)
1.32      cvs       182:         {
                    183:           /* Maths are not allowed in this document */
                    184:           ptr = NULL;
                    185:           *highEnoughLevel = FALSE;
                    186:         }
1.31      cvs       187:        else
                    188:         ptr = MathMLElemMappingTable;
                    189:      }
1.51      cvs       190:    else if (XMLtype == SVG_TYPE)
1.31      cvs       191:      {
1.53      cvs       192:        if (TtaGetDocumentProfile(doc) == L_Basic &&
                    193:           DocumentTypes[doc] == docHTML)
1.32      cvs       194:         {
                    195:           /* Graphics are not allowed in this document */
                    196:           ptr = NULL;
                    197:           *highEnoughLevel = FALSE;
                    198:         }
1.31      cvs       199:        else
1.49      vatton    200:         ptr = SVGElemMappingTable;
1.31      cvs       201:      }
1.1       cvs       202:    else
                    203:      ptr = NULL;
1.32      cvs       204:    
1.1       cvs       205:    if (ptr != NULL)
                    206:      {
                    207:        /* search in the ElemMappingTable */
                    208:        i = 0;
                    209:        /* look for the first concerned entry in the table */
1.44      cvs       210:        while (ptr[i].XMLname[0] < XMLname[0] && ptr[i].XMLname[0] != EOS)
1.32      cvs       211:         i++;     
1.1       cvs       212:        /* look at all entries starting with the right character */
                    213:        do
1.44      cvs       214:         if (strcmp (ptr[i].XMLname, XMLname))
1.32      cvs       215:           /* it's not the tag */
1.1       cvs       216:           i++;
1.53      cvs       217:         else if (TtaGetDocumentProfile(doc) != L_Other &&
                    218:                  !(ptr[i].Level & TtaGetDocumentProfile(doc)))
1.32      cvs       219:           {
1.53      cvs       220:             /* this tag is not valid in the document profile */
1.32      cvs       221:             *highEnoughLevel = FALSE;
                    222:             i++;
                    223:           }
1.1       cvs       224:         else
                    225:           {
                    226:             elType->ElTypeNum = ptr[i].ThotType;
                    227:             if (elType->ElSSchema == NULL)
                    228:               elType->ElSSchema = GetXMLSSchema (XMLtype, doc);
                    229:             *mappedName = ptr[i].XMLname;
                    230:             *content = ptr[i].XMLcontents;
                    231:           }
                    232:        while (elType->ElTypeNum <= 0 && ptr[i].XMLname[0] == XMLname[0]);
                    233:      }
                    234: }
                    235: 
                    236: 
                    237: /*----------------------------------------------------------------------
                    238:    GetXMLElementName
1.52      cvs       239:    Generic function which searchs in the mapping tables the XML name for
1.22      cvs       240:    a given Thot type.
1.1       cvs       241:   ----------------------------------------------------------------------*/
1.44      cvs       242: char*           GetXMLElementName (ElementType elType, Document doc)
1.1       cvs       243: {
1.46      cvs       244:   ElemMapping  *ptr;
                    245:   char         *name;
                    246:   int           i;
                    247:   ThotBool      invalid = FALSE;
1.27      cvs       248: 
                    249:   if (elType.ElTypeNum > 0)
                    250:     {
                    251:       i = 0;
                    252:       /* Select the table which matches with the element schema */
                    253:       name = TtaGetSSchemaName (elType.ElSSchema);
1.44      cvs       254:       if (strcmp ("MathML", name) == 0)
1.27      cvs       255:        ptr = MathMLElemMappingTable;
1.49      vatton    256:       else if (strcmp ("SVG", name) == 0)
                    257:        ptr = SVGElemMappingTable;
1.27      cvs       258:       else
                    259:        ptr = XHTMLElemMappingTable;
                    260:       
                    261:       if (ptr)
                    262:        do
                    263:          {
                    264:            if (ptr[i].ThotType == elType.ElTypeNum)
                    265:              {
1.37      cvs       266:                if (doc == 0 || 
1.53      cvs       267:                    TtaGetDocumentProfile(doc) == L_Other ||
                    268:                    (ptr[i].Level & TtaGetDocumentProfile(doc)))
1.27      cvs       269:                  return ptr[i].XMLname;
                    270:                else
                    271:                  invalid = TRUE;
                    272:              }
                    273:            i++;
                    274:          }
1.44      cvs       275:        while (ptr[i].XMLname[0] != EOS);         
1.27      cvs       276:     }
                    277:   if (invalid)
1.43      cvs       278:     return "";
1.27      cvs       279:   else
1.43      cvs       280:     return "???";
1.22      cvs       281: }
1.25      cvs       282: 
                    283: 
1.29      cvs       284: 
                    285: /*----------------------------------------------------------------------
1.30      cvs       286:    IsXMLElementInline
1.52      cvs       287:    Generic function which searchs in the mapping tables if a given
1.29      cvs       288:    Thot type is an inline character or not
                    289:   ----------------------------------------------------------------------*/
1.52      cvs       290: ThotBool         IsXMLElementInline (ElementType elType, Document doc)
1.29      cvs       291: {
1.34      cvs       292:   int            i;
                    293:   ThotBool       ret = FALSE;
1.45      cvs       294:   char          *name;
1.34      cvs       295:   ElemMapping   *ptr;
1.29      cvs       296: 
                    297:   if (elType.ElTypeNum > 0)
                    298:     {
                    299:       i = 0;
                    300:       /* Select the table which matches with the element schema */
                    301:       name = TtaGetSSchemaName (elType.ElSSchema);
1.44      cvs       302:       if (strcmp ("MathML", name) == 0)
1.29      cvs       303:        ptr = MathMLElemMappingTable;
1.49      vatton    304:       else if (strcmp ("SVG", name) == 0)
                    305:        ptr = SVGElemMappingTable;
1.52      cvs       306:       else if (strcmp ("HTML", name) == 0)
                    307:        ptr = XHTMLElemMappingTable;
1.29      cvs       308:       else
1.52      cvs       309:        ptr = NULL;
1.29      cvs       310:       
                    311:       if (ptr)
                    312:        {
1.44      cvs       313:          while (ptr[i].XMLname[0] != EOS &&
1.29      cvs       314:                 ptr[i].ThotType != elType.ElTypeNum)
                    315:            i++;
                    316:          if (ptr[i].ThotType == elType.ElTypeNum)
                    317:            ret = ptr[i].Inline;
                    318:        }
                    319:     }
                    320:   return ret;
                    321: }
                    322: 
1.22      cvs       323: /*----------------------------------------------------------------------
1.24      cvs       324:    MapXMLAttribute
1.22      cvs       325:    Generic function which searchs in the Attribute Mapping Table (table)
                    326:    the entry attrName associated to the element elementName.
1.24      cvs       327:    Returns the corresponding entry or -1.
1.22      cvs       328:   ----------------------------------------------------------------------*/
1.44      cvs       329: int       MapXMLAttribute (int XMLtype, char *attrName,
                    330:                           char *elementName, ThotBool *highEnoughLevel,
1.33      cvs       331:                           Document doc, int *thotType)
1.22      cvs       332: {
1.24      cvs       333:   int               i;
                    334:   AttributeMapping *ptr;
                    335: 
1.33      cvs       336:   /* Initialization */
                    337:   *highEnoughLevel = TRUE;
                    338:   i = 1;
                    339:   *thotType = 0;
1.50      cvs       340:   
                    341:   /* Select the right table */
                    342:   if (XMLtype == XHTML_TYPE)
                    343:     ptr = XHTMLAttributeMappingTable;
                    344:   else if (XMLtype == MATH_TYPE)
                    345:     ptr = MathMLAttributeMappingTable;
1.51      cvs       346:   else if (XMLtype == SVG_TYPE)
1.50      cvs       347:     ptr = SVGAttributeMappingTable;
                    348:   else if (XMLtype == XLINK_TYPE)
                    349:     ptr = XLinkAttributeMappingTable;
                    350:   else
                    351:     ptr = NULL;
                    352:   
1.24      cvs       353:   if (ptr == NULL)
                    354:     return -1;
1.50      cvs       355:   
                    356:   if (strcmp (attrName, "unknown_attr") == 0)
                    357:     {
                    358:       *thotType = ptr[0].ThotAttribute;
                    359:       return 0;
                    360:     }
1.22      cvs       361: 
                    362:   /* look for the first concerned entry in the table */
1.33      cvs       363:   while (ptr[i].XMLattribute[0] < attrName[0] && 
1.44      cvs       364:         ptr[i].XMLattribute[0] != EOS)
1.22      cvs       365:     i++;
1.33      cvs       366: 
1.24      cvs       367:   while (ptr[i].XMLattribute[0] == attrName[0])
1.22      cvs       368:     {
1.44      cvs       369:       if (strcmp (ptr[i].XMLattribute, attrName) ||
                    370:          (ptr[i].XMLelement[0] != EOS &&
                    371:           strcmp (ptr[i].XMLelement, elementName)))
1.22      cvs       372:        i++;
1.53      cvs       373:       else if (TtaGetDocumentProfile(doc) != L_Other &&
                    374:               !(ptr[i].Level & TtaGetDocumentProfile(doc)))
1.33      cvs       375:        {
                    376:          *highEnoughLevel = FALSE;
                    377:          i++;
                    378:        }
1.22      cvs       379:       else
1.24      cvs       380:        {
                    381:          *thotType = ptr[i].ThotAttribute;
                    382:          return (i);
                    383:        }
1.22      cvs       384:     }
1.24      cvs       385:   return (-1);
1.25      cvs       386: }
                    387: 
                    388: 
                    389: /*----------------------------------------------------------------------
1.37      cvs       390:    GetXMLAttributeName
1.52      cvs       391:    Generic function which searchs in the mapping tables the XML name for
1.25      cvs       392:    a given Thot type.
                    393:   ----------------------------------------------------------------------*/
1.44      cvs       394: char*           GetXMLAttributeName (AttributeType attrType,
1.46      cvs       395:                                     ElementType elType,
                    396:                                     Document doc)
1.25      cvs       397: {
                    398:   AttributeMapping   *ptr;
1.45      cvs       399:   char               *name, *tag;
1.25      cvs       400:   int                 i;
1.27      cvs       401:   ThotBool            invalid = FALSE;
1.25      cvs       402: 
1.27      cvs       403:   if (attrType.AttrTypeNum > 0)
                    404:     {
1.28      cvs       405:       /* get the specific element tag */
                    406:       if (elType.ElTypeNum > 0)
                    407:        tag = GetXMLElementName (elType, doc);
                    408:       else
1.43      cvs       409:        tag = "";
1.28      cvs       410: 
1.27      cvs       411:       i = 0;
                    412:       /* Select the table which matches with the element schema */
                    413:       name = TtaGetSSchemaName (attrType.AttrSSchema);
1.44      cvs       414:       if (strcmp ("MathML", name) == 0)
1.27      cvs       415:        ptr = MathMLAttributeMappingTable;
1.49      vatton    416:       else if (strcmp ("SVG", name) == 0)
                    417:        ptr = SVGAttributeMappingTable;
1.44      cvs       418:       else if (strcmp ("XLink", name) == 0)
1.27      cvs       419:        ptr = XLinkAttributeMappingTable;
                    420:       else
                    421:        ptr = XHTMLAttributeMappingTable;
                    422:       
                    423:       if (ptr)
                    424:        do
                    425:          {
1.28      cvs       426:            if (ptr[i].ThotAttribute == attrType.AttrTypeNum &&
1.44      cvs       427:                (ptr[i].XMLelement[0] == EOS ||
                    428:                 !strcmp (ptr[i].XMLelement, tag)))
1.25      cvs       429:              {
1.48      cvs       430:                if (doc != 0 &&
1.53      cvs       431:                    TtaGetDocumentProfile(doc) != L_Other &&
                    432:                    !(ptr[i].Level & TtaGetDocumentProfile(doc)))
1.48      cvs       433:                  invalid = TRUE;
                    434:                else
1.25      cvs       435:                  return ptr[i].XMLattribute;
                    436:              }
                    437:            i++;
1.27      cvs       438:          }
1.44      cvs       439:        while (ptr[i].XMLattribute[0] != EOS);    
1.27      cvs       440:     }
                    441:   if (invalid)
1.43      cvs       442:     return "";
1.27      cvs       443:   else
1.43      cvs       444:     return "???";
1.36      cvs       445: }
                    446: 
                    447: /*----------------------------------------------------------------------
                    448:    MapXMLEntity
                    449:    Generic function which searchs in the Entity Mapping Table (table)
                    450:    the entry entityName and give the corresponding decimal value.
                    451:    Returns FALSE if entityName is not found.
                    452:   ----------------------------------------------------------------------*/
1.46      cvs       453: ThotBool      MapXMLEntity (int XMLtype, char *entityName, int *entityValue)
1.36      cvs       454: {
                    455:   XmlEntity  *ptr;
                    456:   ThotBool    found;
1.38      cvs       457:   int         inf, sup, med, rescomp;
1.36      cvs       458: 
1.38      cvs       459:   /* Initialization */
1.36      cvs       460:   found = FALSE;
1.42      cvs       461:   sup = 0;
1.36      cvs       462: 
                    463:   /* Select the right table */
                    464:   if (XMLtype == XHTML_TYPE)
1.39      cvs       465:     {
                    466:       ptr = XhtmlEntityTable;
                    467:       if (XHTMLSup == 0)
                    468:        for (XHTMLSup = 0; ptr[XHTMLSup].charCode > 0; XHTMLSup++);
                    469:       sup = XHTMLSup;
                    470:     }
1.36      cvs       471:   else if (XMLtype == MATH_TYPE)
1.39      cvs       472:     {
                    473:       ptr = MathEntityTable;
                    474:       if (MathSup == 0)
                    475:        for (MathSup = 0; ptr[MathSup].charCode > 0; MathSup++);
                    476:       sup = MathSup;
                    477:     }
1.36      cvs       478:   else
                    479:     ptr = NULL;
                    480:   
                    481:   if (ptr == NULL)
1.38      cvs       482:     return found;
                    483: 
                    484:   inf = 0;
                    485:   while (sup >= inf && !found)
                    486:     /* Dichotomic research */
1.36      cvs       487:     {
1.38      cvs       488:       med = (sup + inf) / 2;
1.44      cvs       489:       rescomp = strcmp (ptr[med].charName, entityName);
1.38      cvs       490:       if (rescomp == 0)
                    491:        {
                    492:          /* entity found */
                    493:          *entityValue = ptr[med].charCode;
                    494:          found = TRUE;
                    495:        }
                    496:       else
                    497:        {
                    498:          if (rescomp > 0)
                    499:            sup = med - 1;
                    500:          else
                    501:            inf = med + 1;
                    502:        }
1.36      cvs       503:     }
1.38      cvs       504:   return found;
                    505:  }
1.39      cvs       506: 
                    507: /*----------------------------------------------------------------------
                    508:    MapEntityByCode
                    509:    Generic function which searchs in the Entity Mapping Table (table)
                    510:    the entry with code entityValue and give the corresponding name.
                    511:    Returns FALSE if entityValue is not found.
                    512:   ----------------------------------------------------------------------*/
1.40      cvs       513: void MapEntityByCode (int entityValue, char **entityName)
1.39      cvs       514: {
                    515:   XmlEntity  *ptr;
                    516:   ThotBool    found;
                    517:   int         i;
                    518: 
                    519:   /* Select the right table */
1.40      cvs       520:   ptr = XhtmlEntityTable;
                    521:   if (ptr)
                    522:     {
1.41      cvs       523:       /* look for in the HTML entities table */
1.40      cvs       524:       found = FALSE;
1.41      cvs       525:       while (ptr && !found)
                    526:        {
                    527:          for (i = 0; ptr[i].charCode >= 0 && !found; i++)
                    528:            found = (ptr[i].charCode == entityValue);
1.39      cvs       529:   
1.41      cvs       530:          if (found)
                    531:            {
                    532:              /* entity value found */
                    533:              i--;
                    534:              *entityName = (char *) (ptr[i].charName);
                    535:            }
                    536:          else if (ptr != MathEntityTable)
                    537:            /* look for in the Math entities table */
                    538:            ptr = MathEntityTable;
                    539:          else
                    540:            {
                    541:              *entityName = NULL;
                    542:              ptr = NULL;
                    543:            }
1.40      cvs       544:        }
                    545:     }
1.39      cvs       546:   else
1.40      cvs       547:     *entityName = NULL;
1.39      cvs       548: }

Webmaster