* xmlGetPredefinedEntity: * @name: the entity name * * Check whether this name is an predefined entity. * * Returns NULL if not, otherwise the entity */
| 304 | * Returns NULL if not, otherwise the entity |
| 305 | */ |
| 306 | xmlEntityPtr |
| 307 | xmlGetPredefinedEntity(const xmlChar *name) { |
| 308 | if (name == NULL) return(NULL); |
| 309 | switch (name[0]) { |
| 310 | case 'l': |
| 311 | if (xmlStrEqual(name, BAD_CAST "lt")) |
| 312 | return(&xmlEntityLt); |
| 313 | break; |
| 314 | case 'g': |
| 315 | if (xmlStrEqual(name, BAD_CAST "gt")) |
| 316 | return(&xmlEntityGt); |
| 317 | break; |
| 318 | case 'a': |
| 319 | if (xmlStrEqual(name, BAD_CAST "amp")) |
| 320 | return(&xmlEntityAmp); |
| 321 | if (xmlStrEqual(name, BAD_CAST "apos")) |
| 322 | return(&xmlEntityApos); |
| 323 | break; |
| 324 | case 'q': |
| 325 | if (xmlStrEqual(name, BAD_CAST "quot")) |
| 326 | return(&xmlEntityQuot); |
| 327 | break; |
| 328 | default: |
| 329 | break; |
| 330 | } |
| 331 | return(NULL); |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * xmlAddDtdEntity: |
no test coverage detected