コード例 #1
0
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 );
	}
}
コード例 #2
0
ファイル: newstr.c プロジェクト: andytwoods/xPapers
newstr *
newstr_strdup( char *s1 )
{
	newstr *s2 = newstr_new();
	if ( s2 )
		newstr_strcpy( s2, s1 );
	return s2;
}