MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlTextWriterEndAttribute

Function xmlTextWriterEndAttribute

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:1909–1946  ·  view source on GitHub ↗

* xmlTextWriterEndAttribute: * @writer: the xmlTextWriterPtr * * End the current xml element. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */

Source from the content-addressed store, hash-verified

1907 * Returns the bytes written (may be 0 because of buffering) or -1 in case of error
1908 */
1909int
1910xmlTextWriterEndAttribute(xmlTextWriterPtr writer)
1911{
1912 int count;
1913 int sum;
1914 xmlLinkPtr lk;
1915 xmlTextWriterStackEntry *p;
1916
1917 if (writer == NULL)
1918 return -1;
1919
1920 lk = xmlListFront(writer->nodes);
1921 if (lk == 0) {
1922 return -1;
1923 }
1924
1925 p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk);
1926 if (p == 0) {
1927 return -1;
1928 }
1929
1930 sum = 0;
1931 switch (p->state) {
1932 case XML_TEXTWRITER_ATTRIBUTE:
1933 p->state = XML_TEXTWRITER_NAME;
1934
1935 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
1936 if (count < 0) {
1937 return -1;
1938 }
1939 sum += count;
1940 break;
1941 default:
1942 return -1;
1943 }
1944
1945 return sum;
1946}
1947
1948/**
1949 * xmlTextWriterWriteFormatAttribute:

Callers 8

xmlTextWriterEndElementFunction · 0.85
xmlTextWriterStartPIFunction · 0.85
xmlTextWriterStartCDATAFunction · 0.85

Calls 3

xmlListFrontFunction · 0.85
xmlLinkGetDataFunction · 0.85
xmlOutputBufferWriteFunction · 0.85

Tested by

no test coverage detected