Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 +2.11; site dcl-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!icdoc!dcl-cs!stephen From: stephen@dcl-cs.UUCP (Stephen J. Muir) Newsgroups: net.text Subject: Re: -me macros with refer(1) Message-ID: <293@dcl-cs.UUCP> Date: Wed, 10-Jul-85 17:48:16 EDT Article-I.D.: dcl-cs.293 Posted: Wed Jul 10 17:48:16 1985 Date-Received: Sat, 13-Jul-85 10:19:11 EDT References: <5957@duke.UUCP> <287@dcl-cs.UUCP> Reply-To: stephen@dcl-cs.UUCP (Stephen J. Muir) Organization: Department of Computing at Lancaster University. Lines: 257 Xpath: icdoc ivax In article <287@dcl-cs.UUCP> stephen@dcl-cs.UUCP (Stephen J. Muir) writes: >Actually, there is nothing wrong with the -me macros - the fault is in >refer(1). We have fixed ours to work properly. Also, you need to delete the >"(f" and ")f" macros if you want the bibliography at the end - just say >".rm (f" and ".rm )f" immediately before the "$LIST$" line. If there is >sufficient demand, I might be persuaded to post my pathes to refer(1). As there HAS been a demand - here they are. ----------------------------------- cut here ---------------------------------- *** refer..c.old Wed Jul 10 20:29:02 1985 --- refer..c Wed Jul 10 20:28:52 1985 *************** *** 5,10 #include#define FLAG 003 #define NRFTXT 10000 #define NRFTBL 500 #define NTFILE 20 --- 5,11 ----- #include #define FLAG 003 + # define FFLAG 004 #define NRFTXT 10000 #define NRFTBL 500 #define NTFILE 20 *** refer1.c.old Wed Jul 10 20:30:15 1985 --- refer1.c Wed Jul 10 20:29:55 1985 *************** *** 90,96 } sep = 002; /* separate records without confusing sort..*/ } ! if (sort && !labels) { sprintf(ofile, "/tmp/rj%db", getpid()); ftemp = fopen(ofile, "w"); if (ftemp == NULL) { --- 90,96 ----- } sep = 002; /* separate records without confusing sort..*/ } ! if (sort) { sprintf(ofile, "/tmp/rj%db", getpid()); ftemp = fopen(ofile, "w"); if (ftemp == NULL) { *************** *** 126,132 if (endpush && fo != NULL) dumpold(); output(""); ! if (sort && !labels) recopy(ofile); clfgrep(); cleanup(); --- 126,132 ----- if (endpush && fo != NULL) dumpold(); output(""); ! if (sort) recopy(ofile); clfgrep(); cleanup(); *** refer2.c.old Wed Jul 10 20:31:11 1985 --- refer2.c Wed Jul 10 20:30:50 1985 *************** *** 112,118 nf = tabs(flds, one); nf += tabs(flds+nf, dbuff); assert(nf < NFLD); ! putsig(nf,flds,nr,line1,line); } return; } --- 112,118 ----- nf = tabs(flds, one); nf += tabs(flds+nf, dbuff); assert(nf < NFLD); ! putsig(nf,flds,nr,line1,line,0); } return; } *************** *** 129,135 if (sort) putkey(nf, flds, refnum, keystr); if (bare < 2) ! putsig(nf, flds, refnum, line1, line); else flout(); putref(nf, flds); --- 129,135 ----- if (sort) putkey(nf, flds, refnum, keystr); if (bare < 2) ! putsig(nf, flds, refnum, line1, line, 1); else flout(); putref(nf, flds); *** refer5.c.old Wed Jul 10 20:36:29 1985 --- refer5.c Wed Jul 10 20:35:50 1985 *************** *** 9,15 static char sig[NLABC]; static char bflab[NFLAB]; ! static char *labtab[NLABC]; static char *lbp = bflab; static char labc[NLABC]; static char stbuff[50]; --- 9,15 ----- static char sig[NLABC]; static char bflab[NFLAB]; ! char *labtab[NLABC]; static char *lbp = bflab; char labc[NLABC]; static char stbuff[50]; *************** *** 11,17 static char bflab[NFLAB]; static char *labtab[NLABC]; static char *lbp = bflab; ! static char labc[NLABC]; static char stbuff[50]; static int prevsig; --- 11,17 ----- static char bflab[NFLAB]; char *labtab[NLABC]; static char *lbp = bflab; ! char labc[NLABC]; static char stbuff[50]; static int prevsig; *************** *** 15,21 static char stbuff[50]; static int prevsig; ! putsig (nf, flds, nref, nstline, endline) /* choose signal style */ char *flds[], *nstline, *endline; { char t[100], t1[100], t2[100], format[10], *sd, *stline; --- 15,21 ----- static char stbuff[50]; static int prevsig; ! putsig (nf, flds, nref, nstline, endline, new) /* choose signal style */ char *flds[], *nstline, *endline; { char t[100], t1[100], t2[100], format[10], *sd, *stline; *************** *** 143,151 } } } ! if (bare < 2) ! if (nf > 0) ! fprintf(fo,".ds [F %s%c",t,sep); if (bare > 0) flout(); #if EBUG --- 143,150 ----- } } } ! if (new && bare < 2 && nf > 0) ! fprintf(fo,".ds [F %s%c",t,sep); if (bare > 0) flout(); #if EBUG *************** *** 238,244 char *t; { int i; ! int x = -1; for(i = 1; i < nref; i++) { if (strcmp(labtab[i], t) == 0) --- 237,243 ----- char *t; { int i; ! int x = 'a' - 1; for(i = 1; i < nref; i++) { if (strcmp(labtab[i], t) == 0) *** refer7.c.old Wed Jul 10 20:37:16 1985 --- refer7.c Wed Jul 10 20:37:00 1985 *************** *** 3,8 #endif #include "refer..c" int newr[250]; --- 3,10 ----- #endif #include "refer..c" + extern char *labtab []; + extern char labc []; int newr[250]; *************** *** 96,101 *s = 0; printf("%d", newr[atoi(tb)]); continue; } putchar(c); } --- 98,120 ----- *s = 0; printf("%d", newr[atoi(tb)]); continue; + } + if (c == FFLAG) + { char tb [100]; + char *s = tb; + while ((c = getc (ftemp)) != FFLAG) + *s++ = c; + if (*--s == 'a') + { *s = 0; + for (c = 1; c <= refnum; ++c) + if (labc [c] != 'a' && strcmp (labtab [c], tb) == 0) + { *s = 'a'; + break; /* optimisation */ + } + } + *++s = 0; + printf ("%s", tb); + continue; } putchar(c); } -- UUCP: ...!seismo!mcvax!ukc!dcl-cs!stephen DARPA: stephen%lancs.comp@ucl-cs | Post: University of Lancaster, JANET: stephen@uk.ac.lancs.comp | Department of Computing, Phone: +44 524 65201 Ext. 4599 | Bailrigg, Lancaster, UK. Project:Alvey ECLIPSE Distribution | LA1 4YR