MCPcopy Create free account
hub / github.com/MariaDB/server / my_xml_entity_to_char

Function my_xml_entity_to_char

sql/sql_load.cc:1915–1938  ·  view source on GitHub ↗

Convert an XML entity to Unicode value. Return -1 on error; */

Source from the content-addressed store, hash-verified

1913 Return -1 on error;
1914*/
1915static int
1916my_xml_entity_to_char(const char *name, uint length)
1917{
1918 if (length == 2)
1919 {
1920 if (!memcmp(name, "gt", length))
1921 return '>';
1922 if (!memcmp(name, "lt", length))
1923 return '<';
1924 }
1925 else if (length == 3)
1926 {
1927 if (!memcmp(name, "amp", length))
1928 return '&';
1929 }
1930 else if (length == 4)
1931 {
1932 if (!memcmp(name, "quot", length))
1933 return '"';
1934 if (!memcmp(name, "apos", length))
1935 return '\'';
1936 }
1937 return -1;
1938}
1939
1940
1941/**

Callers 1

read_valueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected