static void output_people( FILE *fp, fields *f, char *tag, char *ristag, int level ) { newstr oneperson; vplist people; int i; newstr_init( &oneperson ); vplist_init( &people ); fields_findv_each( f, level, FIELDS_CHRP, &people, tag ); for ( i=0; i<people.n; ++i ) { name_build_withcomma( &oneperson, ( char * ) vplist_get( &people, i ) ); fprintf( fp, "%s - %s\n", ristag, oneperson.data ); } vplist_free( &people ); newstr_free( &oneperson ); }
static void output_people( FILE *fp, fields *info, char *tag, char *entag, int level ) { newstr oneperson; int i, n, flvl; char *ftag; newstr_init( &oneperson ); n = fields_num( info ); for ( i=0; i<n; ++i ) { flvl = fields_level( info, i ); if ( level!=LEVEL_ANY && flvl!=level ) continue; ftag = fields_tag( info, i, FIELDS_CHRP ); if ( !strcasecmp( ftag, tag ) ) { name_build_withcomma( &oneperson, fields_value( info, i, FIELDS_CHRP ) ); fprintf( fp, "%s %s\n", entag, oneperson.data ); } } newstr_free( &oneperson ); }
static void output_people( FILE *fp, fields *f, char *tag1, char *tag2, char *tag3, char *adstag, int level ) { newstr oneperson; vplist a; int i; newstr_init( &oneperson ); vplist_init( &a ); fields_findv_eachof( f, level, FIELDS_CHRP, &a, tag1, tag2, tag3, NULL ); extern void fields_findv_eachof( fields *f, int level, int mode, vplist *a, ... ); for ( i=0; i<a.n; ++i ) { if ( i==0 ) fprintf( fp, "%s ", adstag ); else fprintf( fp, "; " ); name_build_withcomma( &oneperson, (char *) vplist_get( &a, i) ); fprintf( fp, "%s", oneperson.data ); } if ( a.n ) fprintf( fp, "\n" ); vplist_free( &a ); newstr_free( &oneperson ); }