int isiin_typef( fields *isiin, char *filename, int nref, param *p, variants *all, int nall ) { char *refnum = ""; int n, reftype, nrefnum; n = fields_find( isiin, "PT", 0 ); nrefnum = fields_find ( isiin, "UT", 0 ); if ( nrefnum!=-1 ) refnum = isiin->data[nrefnum].data; if ( n!=-1 ) reftype = get_reftype( (isiin->data[n]).data, nref, p->progname, all, nall, refnum ); else reftype = get_reftype( "", nref, p->progname, all, nall, refnum ); /* default */ return reftype; }
int risin_typef( fields *risin, char *filename, int nref, param *p, variants *all, int nall ) { char *refnum = ""; int n, reftype, nreftype; n = fields_find( risin, "TY", 0 ); nreftype = fields_find( risin, "ID", 0 ); if ( nreftype!=-1 ) refnum = risin[n].data->data; if ( n!=-1 ) reftype = get_reftype( (risin[n].data)->data, nref, p->progname, all, nall, refnum ); else reftype = get_reftype( "", nref, p->progname, all, nall, refnum ); /*default */ return reftype; }
int endin_typef( fields *endin, char *filename, int nrefs, variants *all, int nall ) { char *refnum = ""; int n, reftype, nrefnum; n = fields_find( endin, "%0", 0 ); nrefnum = fields_find( endin, "%F", 0 ); if ( nrefnum!=-1 ) refnum = endin->data[nrefnum].data; if ( n!=-1 ) reftype = get_reftype( endin->data[n].data, nrefs, all, nall, refnum ); else reftype = get_reftype( "", nrefs, all, nall, refnum ); /* default */ return reftype; }
int bibtexin_typef( fields *bibin, char *filename, int nrefs, param *p, variants *all, int nall ) { char *refnum = ""; int reftype, n, nrefnum; n = fields_find( bibin, "INTERNAL_TYPE", 0 ); nrefnum = fields_find( bibin, "REFNUM", 0 ); if ( nrefnum!=-1 ) refnum = (bibin->data[nrefnum]).data; if ( n!=-1 ) /* figure out type */ reftype = get_reftype( (bibin->data[n]).data, nrefs, p->progname, all, nall, refnum ); else /* no type info, go for default */ reftype = get_reftype( "", nrefs, p->progname, all, nall, refnum ); return reftype; }
/* Endnote defaults if no %0 * * if %J & %V - journal article * if %B - book section * if %R & !%T - report * if %I & !%B & !%J & !%R - book * if !%B & !%J & !%R & !%I - journal article */ int endin_typef( fields *endin, char *filename, int nrefs, param *p, variants *all, int nall ) { char *refnum = ""; int n, reftype, nrefnum, nj, nv, nb, nr, nt, ni; n = fields_find( endin, "%0", 0 ); nrefnum = fields_find( endin, "%F", 0 ); if ( nrefnum!=-1 ) refnum = endin->data[nrefnum].data; if ( n!=-1 ) reftype = get_reftype( endin->data[n].data, nrefs, p->progname, all, nall, refnum ); else { nj = fields_find( endin, "%J", 0 ); nv = fields_find( endin, "%V", 0 ); nb = fields_find( endin, "%B", 0 ); nr = fields_find( endin, "%R", 0 ); nt = fields_find( endin, "%T", 0 ); ni = fields_find( endin, "%I", 0 ); if ( nj!=-1 && nv!=-1 ) { reftype = get_reftype( "Journal Article", nrefs, p->progname, all, nall, refnum ); } else if ( nb!=-1 ) { reftype = get_reftype( "Book Section", nrefs, p->progname, all, nall, refnum ); } else if ( nr!=-1 && nt==-1 ) { reftype = get_reftype( "Report", nrefs, p->progname, all, nall, refnum ); } else if ( ni!=-1 && nb==-1 && nj==-1 && nr==-1 ) { reftype = get_reftype( "Book", nrefs, p->progname, all, nall, refnum ); } else if ( nb==-1 && nj==-1 && nr==-1 && ni==-1 ) { reftype = get_reftype( "Journal Article", nrefs, p->progname, all, nall, refnum ); } else { reftype = get_reftype( "", nrefs, p->progname, all, nall, refnum ); /* default */ } } return reftype; }