MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / xmlGetEncodingAlias

Function xmlGetEncodingAlias

Externals/LibXML/encoding.c:957–983  ·  view source on GitHub ↗

* xmlGetEncodingAlias: * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) * * Lookup an encoding name for the given alias. * * Returns NULL if not found, otherwise the original name */

Source from the content-addressed store, hash-verified

955 * Returns NULL if not found, otherwise the original name
956 */
957const char *
958xmlGetEncodingAlias(const char *alias) {
959 int i;
960 char upper[100];
961
962 if (alias == NULL)
963 return(NULL);
964
965 if (xmlCharEncodingAliases == NULL)
966 return(NULL);
967
968 for (i = 0;i < 99;i++) {
969 upper[i] = toupper(alias[i]);
970 if (upper[i] == 0) break;
971 }
972 upper[i] = 0;
973
974 /*
975 * Walk down the list looking for a definition of the alias
976 */
977 for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
978 if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) {
979 return(xmlCharEncodingAliases[i].name);
980 }
981 }
982 return(NULL);
983}
984
985/**
986 * xmlAddEncodingAlias:

Callers 4

test_xmlGetEncodingAliasFunction · 0.85
xmlParseCharEncodingFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_xmlGetEncodingAliasFunction · 0.68