astropy/utils/xml/src/iterparse.c
/*
 * Append text to the text buffer.
 *
 * For the first chunk of text, all whitespace characters before the
 * first non-whitespace character are stripped.  This saves time
 * stripping on the Python side later.
 */
Append text to the text buffer.
For the first chunk of text, all whitespace characters before the
first non-whitespace character are stripped.  This saves time
stripping on the Python side later.
Append text to the text buffer . For the first chunk of text all whitespace characters before the first non - whitespace character are stripped . This saves time stripping on the Python side later .
static int
text_append(IterParser *self, const XML_Char *data, Py_ssize_t len)
{
    Py_ssize_t new_size;
    if (len == 0) {
        return 0;
    }
    if (self->text_size == 0) {
        while (len && IS_WHITESPACE(*data)) {
            ++data;
            --len;
        }
    }
    new_size = self->text_size + len;
    if (text_realloc(self, new_size + 1)) {
        return -1;
    }
    memcpy(self->text + self->text_size,
           data,
           (size_t)len * sizeof(XML_Char));
    self->text_size = new_size;
    self->text[self->text_size] = (XML_Char)0x0;
    return 0;
}
static int text_append ( IterParser * self , const XML_Char * data , Py_ssize_t len ) { Py_ssize_t new_size ; if ( len == 0 ) { return 0 ; } if ( self -> text_size == 0 ) { while ( len && IS_WHITESPACE ( * data ) ) { ++ data ; -- len ; } } new_size = self -> text_size + len ; if ( text_realloc ( self , new_size + 1 ) ) { return -1 ; } memcpy ( self -> text + self -> text_size , data , ( size_t ) len * sizeof ( XML_Char ) ) ; self -> text_size = new_size ; self -> text [ self -> text_size ] = ( XML_Char ) 0x0 ; return 0 ; }
Append text to the text buffer.
Append text to the text buffer .
/* If this is the first chunk, handle whitespace */ /* Grow text buffer if necessary */