* htmlEntityLookup: * @name: the entity name * * Lookup the given entity in EntitiesTable * * TODO: the linear scan is really ugly, an hash table is really needed. * * Returns the associated htmlEntityDescPtr if found, NULL otherwise. */
| 1999 | * Returns the associated htmlEntityDescPtr if found, NULL otherwise. |
| 2000 | */ |
| 2001 | const htmlEntityDesc * |
| 2002 | htmlEntityLookup(const xmlChar *name) { |
| 2003 | unsigned int i; |
| 2004 | |
| 2005 | for (i = 0;i < (sizeof(html40EntitiesTable)/ |
| 2006 | sizeof(html40EntitiesTable[0]));i++) { |
| 2007 | if (xmlStrEqual(name, BAD_CAST html40EntitiesTable[i].name)) { |
| 2008 | return((htmlEntityDescPtr) &html40EntitiesTable[i]); |
| 2009 | } |
| 2010 | } |
| 2011 | return(NULL); |
| 2012 | } |
| 2013 | |
| 2014 | static int |
| 2015 | htmlCompareEntityDesc(const void *vkey, const void *vdesc) { |
no test coverage detected