src/gedlib/spltjoin.c
/*======================================
 * split_indi_old -- Split person into parts
 *  all unrecognized (level 1) nodes go into body
 *  should be replaced by split_indi
 *====================================*/
- Split person into parts
all unrecognized (level 1) nodes go into body
should be replaced by split_indi
- Split person into parts all unrecognized ( level 1 ) nodes go into body should be replaced by split_indi
void
split_indi_old (NODE indi,
            NODE *pname,
            NODE *prefn,
            NODE *psex,
            NODE *pbody,
            NODE *pfamc,
            NODE *pfams)
{
	NODE name, lnam, refn, sex, body, famc, fams, last;
	NODE lfmc, lfms, lref, prev, node;
	ASSERT(eqstr("INDI", ntag(indi)));
	name = sex = body = famc = fams = last = lfms = lfmc = lnam = NULL;
	refn = lref = NULL;
	node = nchild(indi);
	nchild(indi) = nsibling(indi) = NULL;
	while (node) {
		STRING tag = ntag(node);
		if (eqstr("NAME", tag)) {
			if (!name)
				name = lnam = node;
			else
				lnam = nsibling(lnam) = node;
		} else if (!sex && eqstr("SEX", tag)) {
			sex = node;
		} else if (eqstr("FAMC", tag)) {
			if (!famc)
				famc = lfmc = node;
			else
				lfmc = nsibling(lfmc) = node;
 		} else if (eqstr("FAMS", tag)) {
			if (!fams)
				fams = lfms = node;
			else
				lfms = nsibling(lfms) = node;
 		} else if (eqstr("REFN", tag)) {
			if (!refn)
				refn = lref = node;
			else
				lref = nsibling(lref) = node;
		} else {
			if (!body)
				body = last = node;
			else
				last = nsibling(last) = node;
		}
		prev = node;
		node = nsibling(node);
		nsibling(prev) = NULL;
	}
	*pname = name;
	*prefn = refn;
	*psex = sex;
	*pbody = body;
	*pfamc = famc;
	*pfams = fams;
}
void split_indi_old ( NODE indi , NODE * pname , NODE * prefn , NODE * psex , NODE * pbody , NODE * pfamc , NODE * pfams ) { NODE name , lnam , refn , sex , body , famc , fams , last ; NODE lfmc , lfms , lref , prev , node ; ASSERT ( eqstr ( " " , ntag ( indi ) ) ) ; name = sex = body = famc = fams = last = lfms = lfmc = lnam = NULL ; refn = lref = NULL ; node = nchild ( indi ) ; nchild ( indi ) = nsibling ( indi ) = NULL ; while ( node ) { STRING tag = ntag ( node ) ; if ( eqstr ( " " , tag ) ) { if ( ! name ) name = lnam = node ; else lnam = nsibling ( lnam ) = node ; } else if ( ! sex && eqstr ( " " , tag ) ) { sex = node ; } else if ( eqstr ( " " , tag ) ) { if ( ! famc ) famc = lfmc = node ; else lfmc = nsibling ( lfmc ) = node ; } else if ( eqstr ( " " , tag ) ) { if ( ! fams ) fams = lfms = node ; else lfms = nsibling ( lfms ) = node ; } else if ( eqstr ( " " , tag ) ) { if ( ! refn ) refn = lref = node ; else lref = nsibling ( lref ) = node ; } else { if ( ! body ) body = last = node ; else last = nsibling ( last ) = node ; } prev = node ; node = nsibling ( node ) ; nsibling ( prev ) = NULL ; } * pname = name ; * prefn = refn ; * psex = sex ; * pbody = body ; * pfamc = famc ; * pfams = fams ; }
split_indi_old -- Split person into parts
  all unrecognized (level 1) nodes go into body
  should be replaced by split_indi
split_indi_old -- Split person into parts all unrecognized ( level 1 ) nodes go into body should be replaced by split_indi