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

Function parse_list

ThirdParty/libxml2/vtklibxml2/runtest.c:3951–3991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3949}
3950
3951static xmlChar **
3952parse_list(xmlChar *str) {
3953 xmlChar **buffer;
3954 xmlChar **out = NULL;
3955 int buffer_size = 0;
3956 int len;
3957
3958 if(str == NULL) {
3959 return(NULL);
3960 }
3961
3962 len = xmlStrlen(str);
3963 if((str[0] == '\'') && (str[len - 1] == '\'')) {
3964 str[len - 1] = '\0';
3965 str++;
3966 }
3967 /*
3968 * allocate an translation buffer.
3969 */
3970 buffer_size = 1000;
3971 buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*));
3972 if (buffer == NULL) {
3973 perror("malloc failed");
3974 return(NULL);
3975 }
3976 out = buffer;
3977
3978 while(*str != '\0') {
3979 if (out - buffer > buffer_size - 10) {
3980 int indx = out - buffer;
3981
3982 xxx_growBufferReentrant();
3983 out = &buffer[indx];
3984 }
3985 (*out++) = str;
3986 while(*str != ',' && *str != '\0') ++str;
3987 if(*str == ',') *(str++) = '\0';
3988 }
3989 (*out) = NULL;
3990 return buffer;
3991}
3992
3993static int
3994c14nRunTest(const char* xml_filename, int with_comments, int mode,

Callers 1

c14nRunTestFunction · 0.85

Calls 1

xmlStrlenFunction · 0.85

Tested by

no test coverage detected