void xml_init( xml *x ) { x->tag = newstr_new(); x->value = newstr_new(); x->a = NULL; x->down = NULL; x->next = NULL; if ( !(x->tag) || !(x->value) ) { fprintf(stderr,"xml_init: memory error.\n"); exit( EXIT_FAILURE ); } }
newstr * newstr_strdup( char *s1 ) { newstr *s2 = newstr_new(); if ( s2 ) newstr_strcpy( s2, s1 ); return s2; }