diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /indexing/addindex |
Initial commit
Diffstat (limited to 'indexing/addindex')
-rw-r--r-- | indexing/addindex/Makefile | 15 | ||||
-rw-r--r-- | indexing/addindex/README | 75 | ||||
-rw-r--r-- | indexing/addindex/addindex.lex | 202 | ||||
-rw-r--r-- | indexing/addindex/example.tex | 20 | ||||
-rw-r--r-- | indexing/addindex/inplace.c | 122 | ||||
-rw-r--r-- | indexing/addindex/names.bib | 351 | ||||
-rw-r--r-- | indexing/addindex/scanpath.c | 50 |
7 files changed, 835 insertions, 0 deletions
diff --git a/indexing/addindex/Makefile b/indexing/addindex/Makefile new file mode 100644 index 0000000000..fca6b121bd --- /dev/null +++ b/indexing/addindex/Makefile @@ -0,0 +1,15 @@ + +OBJS = addindex.o inplace.o scanpath.o + +addindex: $(OBJS) + $(CC) $(LFLAGS) -o addindex $(OBJS) -ll + +addindex.c: addindex.lex + lex addindex.lex + mv lex.yy.c addindex.c + +clean: + -@rm -f core a.out addindex.c *.o addindex *~ *.BAK *.shar + +shar: clean + shar * > addindex.shar diff --git a/indexing/addindex/README b/indexing/addindex/README new file mode 100644 index 0000000000..d065834215 --- /dev/null +++ b/indexing/addindex/README @@ -0,0 +1,75 @@ +Q: What is this? +A: This is the first version of addindex. Bugs, fixes, comments and +suggestions should be sent to Yossi Gil (yogi@cs.ubc.ca). It has been +tested on Sun Sparc station only. Modifications for other systems should be +easy. The program is supplied on an as is basis. Use at your own +risk. + +Q: What is it good for? +A: 'addindex' is a program for adding index entries to LaTeX files. +It is most useful for adding Names (such as Knuth, Donald Ervin) +index to an existing files. + +Q: How to use? +A: There are two steps in using the program: +1) Prepare a names database or use the example database enclosed. +(instructions for preparing a database are given later) +2) Invoke the program by + addindex file[s] +This will add the \index{} entries to the files named in the command +line. A backup copy of each of files processed will be created. +The old version of krack.tex will be called krack.tex.BAK. +You can also use addindex as a filter: + cat myfile.tex | addindex | more + +Q: Can 'addindex' be used on files which already have index commands? +A: Yes. Further, 'addindex' will make a reasonable effort to avoid + inserting double index commands, index to commands such as + \cite{Knu:Gnat:71} etc. When you edit your files keep in mind + that the index command should follow the indexed entry + immediately. + +Q: What should I know before using the program? +A: All about 'makeindex' and 'latex' programs! + +Q: How do I compile the program? +A: If you are on sun sparc station just use make. Season and hack to +taste on others systems. + +Q: How do I prepare the names database? +A: Start with the enclosed example. The format is quite rigid so don't +mess with it. An entry is in the form: +@string{Knuth = "Knuth, Donald Ervin"}. +Which when processed by 'addindex' will add an index entry +of "Knuth, Donald Ervin" to any mention of the name Knuth in the +text. + +Q: Are duplicate entries in the database permitted? +A: Yes, only the first occurence of each entry is significant. +note that this is different than the operation of BiBTeX. + +Q: What name should I use for the names database? +A: The default name is 'names.bib'. You can change this name to +any othe name by setting the environment variable INDEXDB. + +Q: Where should I put the names database? +A: Normally, in the current directory. However, 'addindex' will +look for the index in the directories specified in the environment +variables: INDEXINPUTS, BIBINPUTS, TEXINPUTS, PATH. + +Q: Examples? +A: A very short example file called is provided. Try running: +a) addindex < example.tex | addindex | addindex | addindex +b) 'addindex example.tex' and then 'diff example.tex example.tex.BAK' + +Q: 'addindex' looks like a last moment hack and not like a real +program. Is this true. +A: Yes, 'addindex' was done in a few hours of hacking. Do you care +enough to improve it? + +Q: What does the author expect in return for using his program? +A: Not much. If you compile your own names database, please send a +copy to me: yogi@cs.ubc.ca. + + + diff --git a/indexing/addindex/addindex.lex b/indexing/addindex/addindex.lex new file mode 100644 index 0000000000..258701b898 --- /dev/null +++ b/indexing/addindex/addindex.lex @@ -0,0 +1,202 @@ +/* Adapted from delatex.lex */ +%{ +#include <assert.h> +int depth = 0; +%} +L [A-Za-z] +SA "begin"|"bibitem"|"bibliography"|"bibstyle" +SB "cite"|"end"|"include"|"includeonly"|"input" +SC "pageref"|"label"|"ref"|"cite"|"index" +S ({SA}|{SB}|{SC}) +%Start Display Math Normal Tag +%% +\\% ECHO; /* Escaped comment */ +"\\{" ECHO; /* Escaped "{" */ +"\\}" ECHO; /* Escaped "}" */ +"\\$" ECHO; /* Escaped $ */ +"%".* ECHO; /* Comments */ +<Normal>{L}+ { /* A word */ + ECHO; + AddIndex(yytext); + } +<Normal>{L}+"\\index{" { + ECHO; + BEGIN Tag; + assert(depth == 0); + depth = 1 ; + } +<Normal>"\\"{S}"{" { + ECHO; + BEGIN Tag; + assert(depth == 0); + depth = 1; + } +\\{L}+ ECHO; /* Other controls */ +<Tag>"{" { + ECHO; + assert(depth > 0); + depth++; + } +<Tag>"}" { + ECHO; + assert(depth > 0); + if (--depth == 0) + BEGIN Normal; + } +<Tag>[^{}] ECHO; /* up to next "}" */ +<Normal>"\\(" { /* begin latex math mode */ + ECHO; + BEGIN Math; + } +<Math>"\\)" { /* end latex math mode */ + ECHO; + BEGIN Normal; + } +<Math>.|\\[^)]|\n ECHO; /* in latex math mode */ +<Normal,Display>\$([^$]|\\\$)+\$ ECHO; /* in math mode */ +<Normal>"\\[" {/* now in Latex display mode */ + ECHO; + BEGIN Display; + } +<Normal>"$$" { + ECHO; + BEGIN Display; /* now in Display math mode */ + } +<Display>[^$]|\\[^\]] ECHO; /* most things in display math mode */ +<Display>"\\]" { + ECHO; + BEGIN Normal; /* get out of Display math mode */ + } +<Display>"$$" { + ECHO; + BEGIN Normal; /* get out of Display math mode */ + } +<Normal>\\. ECHO; /* other single character control sequences */ +<Normal>\\\n ECHO; /* more of the same */ +<Normal>\n|. ECHO; /* anything else, a character at a time */ +%% +digest(fin,fout) +FILE *fin; +FILE *fout; +{ + yyin = fin; + yyout = fout; + yylex(); + return 0; +} +char *ProgName; +main(argc,argv) + char **argv; +{ + int i; + int nerrs = 0; + + ProgName = argv[0]; + + if (init() != 0) + return nerrs; + BEGIN Normal; /* Starts yylex off in the right state */ + + if (argc == 1) + return nerrs + digest(stdin,stdout); + for (i = 1; i < argc; i++) { + fprintf(stderr,"%s:\n",argv[i]); + nerrs += ProcessFile(argv[i],digest); + } + return nerrs; +} + +#include <stdio.h> +#include <search.h> + +#define NUM_KEY 10000 /* # of elements in search table */ + + +ENTRY *hsearch(); + +FILE *GetFp() +{ + char *fname; + FILE *fp; + { + char *DataBase = "names.bib"; + extern char *scanpath(); + extern char *getenv(); + + if (getenv("INDEXDB")) + DataBase = getenv("INDEXDB"); + if ((fname = scanpath(".",DataBase)) == (char *)0) + if ((fname = scanpath("INDEXINPUTS",DataBase)) == (char *)0) + if ((fname = scanpath("BIBINPUTS",DataBase)) == (char *)0) + if ((fname = scanpath("TEXINPUTS",DataBase)) == (char *)0) + if ((fname = scanpath("PATH",DataBase)) == (char *)0) { + (void) fprintf(stderr, + "%s: Cannot find \"%s\"\n", + ProgName,DataBase + ); + return (FILE *)0; + } + } + fp = fopen(fname,"r"); + if (fp == (FILE *)0) + perror(fname); + fprintf(stderr,"Reading database %s:\n",fname); + free(fname); + return fp; +} + +int init() +{ +/* space to store strings */ +static char string_space[NUM_KEY * 50]; + +/* next avail space in string_space */ +register char *str_ptr = string_space; + + char *fmt = "@string{%s = \"%[^\"]\"}\n"; + struct entry e; + FILE *fp; + + char s1[100]; + char s2[200]; + char *last = (char *)0; + int i = 0; + + if ((fp = GetFp()) == (FILE *)0) + return 1; + + (void) hcreate(NUM_KEY); + + while (fscanf(fp,fmt, s1, s2) == 2) { + e.key = str_ptr; + strcpy(str_ptr, s1); + str_ptr += strlen(str_ptr) + 1; + if (i == 0) + fprintf(stderr,"First entry is %s\n",e.key); + + e.data = str_ptr; + strcpy(str_ptr, s2); + str_ptr += strlen(str_ptr) + 1; + i++; + + (void) hsearch(e, ENTER); + } + fprintf(stderr,"Last entry is %s\n",e.key); + fprintf(stderr,"Total of %d entries\n",i); + (void) fclose(fp); + return 0; +} + +AddIndex(s) +char *s; +{ + struct entry *p; + if ((p = hsearch(&s,FIND)) != NULL) { + fprintf(yyout,"\\index{%s@%s}",p->key,p->data); + } +} + + + + + diff --git a/indexing/addindex/example.tex b/indexing/addindex/example.tex new file mode 100644 index 0000000000..506aa8e98a --- /dev/null +++ b/indexing/addindex/example.tex @@ -0,0 +1,20 @@ +\documentstyle{article} +% +% By: Yossi Gil +% +\begin{document} +This are some random comments made by Yossi Gil. + +Clearly, +\[ + Knuth \ne Knott +\] can be written as $Knott \ne Knuth$ and indeed Knuth and +Knott are not the same person. + +\TeX{} by Knuth~\cite{Knuth:84} is claimed to be bug-free. +However, Dr. Knuth never claimed that \TeX is {\em surprise} free! +In fact, the previous sentence had at least three (!) \TeX\ bugs... + +The definition of the class NC is attributed by +Cook~\cite{Cook:??} to Pippenger~\cite{Pippenger:??}. +\end{document} diff --git a/indexing/addindex/inplace.c b/indexing/addindex/inplace.c new file mode 100644 index 0000000000..19f137f273 --- /dev/null +++ b/indexing/addindex/inplace.c @@ -0,0 +1,122 @@ +/* + * copy input file to backup file. If in_name is /blah/blah/blah/file, then + * backup file will be "file.BAK". Then make the backup file the input and + * original input file the output. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#ifdef __TURBOC__ +#include <io.h> +#include <alloc.h> +#else +#include <errno.h> +extern *sys_errlist[]; +#endif + + +extern char *ProgName; + + +#define WARN(msg,param) {\ + (void) fprintf(stderr, \ + "%s: Error %s \"%s\" - %s\n",\ + ProgName,msg,param,sys_errlist[errno]\ + );\ + ++nerrs;\ +} + +#define FATAL(msg,param) {\ + WARN(msg,param);\ + if (BackFileName != (char *)0) {\ + if (unlink(BackFileName) != 0) \ + WARN("removing",BackFileName);\ + (void) free(BackFileName);\ + }\ + return nerrs;\ +} + + +int ProcessFile(InputFileName,ProcessFunc) +char *InputFileName; +int (*ProcessFunc)(); +{ + char *BackFileName = (char *)0; + int nerrs = 0; + FILE *fin; + FILE *fout; + + if ((fin = fopen(InputFileName,"r")) == (FILE *)0) + FATAL("opening",InputFileName); + { + static char BAK[] = ".BAK"; + int len = strlen(InputFileName) + sizeof(BAK); + + if ((BackFileName = malloc(len)) == (char *)0) { + (void) fprintf(stderr, + "%s: Cannot malloc %d bytes for %s%s\n", + ProgName,len,InputFileName,BAK + ); + return ++nerrs; + } + (void) sprintf(BackFileName,"%s%s",InputFileName,BAK); + assert(1 + strlen(BackFileName) == len); + } + /* + ** copy InputFileName to backup file + */ + { + int bakchn; + + if ((bakchn = creat(BackFileName, 0600)) < 0) + FATAL("create",BackFileName); + + { + int n; + char buff[BUFSIZ]; + + while ((n = read(fileno(fin), buff, sizeof buff)) > 0) + if (write(bakchn, buff, n) != n) + FATAL("writing to",BackFileName); + if (n < 0) + FATAL("reading from",InputFileName); + if (close(bakchn) != 0) + WARN("closing",BackFileName); + if (fclose(fin) != 0) + WARN("closing",InputFileName); + } + } + /* + ** re-open backup file as the input file + */ + if ((fin = fopen(BackFileName, "r")) == (FILE *)0) + FATAL("re-opening",BackFileName); + /* + ** now the original input file will be the output + */ + if ((fout = fopen(InputFileName, "w")) == (FILE *)0) + FATAL("re-opening",InputFileName); + if (ProcessFunc(fin,fout) != 0) { + (void) fprintf(stderr, + "%s: Could not process file \"%s\"\n", + ProgName,InputFileName + ); + if (rename(BackFileName,InputFileName) == 0) { + (void) fprintf(stderr, +"%s: Cannot recover original contents of \"%s\"\n\ + Original contents should be in \"%s\"\n", + ProgName,InputFileName,BackFileName + ); + nerrs++; + } + } else { + if (fclose(fin) != 0) + WARN("closing",BackFileName); + if (fclose(fout) != 0) + WARN("closing",InputFileName); + } + free(BackFileName); + return nerrs; +} diff --git a/indexing/addindex/names.bib b/indexing/addindex/names.bib new file mode 100644 index 0000000000..702a0a899f --- /dev/null +++ b/indexing/addindex/names.bib @@ -0,0 +1,351 @@ +@string{Abohassan = "Abohassan, F."} +@string{Adleman = "Adleman, Leonard M."} +@string{Aggarwal ="Aggarwal, Alok"} +@string{Aho = "Aho, Alfred Vaino"} +@string{Aho = "Aho, Alfred V."} +@string{Ajtai = "Ajtai, M."} +@string{Alon = "Alon, Noga"} +@string{Alpern = "Alpern, Bowen"} +@string{Alt = "Alt, H."} +@string{Anderson = "Anderson, Richard J."} +@string{Angluin = "Angluin, Dana"} +@string{Anastasio = "Anastasio, Thomas A."} +@string{Annexstein = "Annexstein, Fred S."} +@string{Apostolico = "Apostolico, Alberto"} +@string{Atallah = "Atallah, Mikhail J."} +@string{Attiya = "Attiya, Hagit"} +@string{Awerbuch = "Awerbuch, Baruch"} +@string{Azar = "Azar, Yossi"} +@string{Babai = "Babai, L{\'a}szl{\'o}"} +@string{Baeza-Yates = "Baeza-Yates, Ricardo A."} +@string{Barua = "Barua, S."} +@string{Bast = "Bast, Holger"} +@string{Baumslag = "Baumslag, Marc"} +@string{Beame = "Beame, Paul"} +@string{Ben-Asher = "Ben-Asher, Yosi"} +@string{Bentley = "Bentley, Jon Louis"} +@string{Bentley = "Bentley, Jon L."} +@string{Bergen = "Bergen, J. R."} +@string{Berger = "Berger, Bonnie"} +@string{Berkman = "Berkman, Omer"} +@string{Berman = "Berman, Francine"} +@string{Bern = "Bern, Marshall W."} +@string{Bhatt = "Bhatt, Sandeep N."} +@string{Blelloch = "Blelloch, Guy E."} +@string{Bock = "Bock, Mary Ellen"} +@string{Bock = "Bock, Mary E."} +@string{Bollobas = "Bollob\'{a}s, B\'{e}la"} +@string{Boppana = "Boppana, Ravi B."} +@string{Borodin = "Borodin, Alan"} +@string{Brent = "Brent, Richard Peirce"} +@string{Brent = "Brent, Richard P."} +@string{Breslauer = "Breslauer, Dany"} +@string{Broder = "Broder, Andrei Zary"} +@string{Broder = "Broder, Andrei Z."} +@string{Bryant = "Bryant, Randal E."} +@string{Carter = "Carter, John Lawrence"} +@string{Carter = "Carter, Larry J."} +@string{Cellis = "Cellis, Pedro"} +@string{Chandra = "Chandra, Ashok Kumar"} +@string{Chandra = "Chandra, Ashok K."} +@string{Chaudhuri = "Chaudhuri, Shiva"} +@string{Chebyshev = "Chebeyshev, Pafnuti\v{l} L'vovich"} +@string{Chebyshev = "Chebeyshev, Pafnuti\v{l} L."} +@string{Chen = "Chen, W. C."} +@string{Chernoff = "Chernoff, H."} +@string{Chew = "Chew, L. Paul"} +@string{Chistyakov = "Chistyakov, V. P."} +@string{Chlebus = "Chlebus, Bogdan Stanislaw"} +@string{Chlebus = "Chlebus, Bogdan S."} +@string{Chor = "Chor, Benny"} +@string{Chrobak = "Chrobak, Marek"} +@string{Cole = "Cole, Richard"} +@string{Corneil = "Corneil, D. G."} +@string{Cook = "Cook, Stephen A."} +@string{DeLaTorre = "{de la Torre}, Pilar"} +@string{DeSantis = "{De Santis}, Alfredo"} +@string{Devroye = "Devroye, Luc"} +@string{Dietz = "Dietz, Paul"} +@string{Dietzfelbinger = "Dietzfelbinger, Martin"} +@string{Diks = "Diks, Krzysztof"} +@string{Dittert = "Dittert, Eric"} +@string{Dolev = "Dolev, Danny"} +@string{Duris = "Duris, Pavol"} +@string{Dwork = "Dwork, Cynthia"} +@string{Eckstein = "Eckstein, D. M."} +@string{Eppstein = "Eppstein, David"} +@string{Eric = "W. Eric"} +@string{Feig = "Feig, Ephraim"} +@string{Feigon = "Feigon, Ofer"} +@string{Fich = "Fich, Faith E."} +@string{Fischer = "Fischer, M. J."} +@string{Flajolet = "Flajolet, Philippe"} +@string{Fmadh = "Meyer auf der Heide, Friedhelm "} +@string{Fortune = "Fortune, Steven"} +@string{Fredman = "Fredman, Michael Lawrence"} +@string{Fredman = "Fredman, Michael L."} +@string{Frieze = "Frieze, Alan"} +@string{Gabow = "Gabow, Harold N."} +@string{Galil = "Galil, Zvi"} +@string{Gazit = "Gazit, Hillel"} +@string{Ghosh = "Ghosh, R. K."} +@string{Giancarlo = "Giancarlo, Raffaele "} +@string{Gil = "Gil, Joseph"} +@string{Goldreich = "Goldreich, Oded"} +@string{Goldschlager = "Goldschlager, L. M."} +@string{Goldwasser = "Goldwasser, Shafi"} +@string{Gonnet = "Gonnet, Gaston H."} +@string{Goodrich = "Goodrich, Michael T."} +@string{Gori = "Gori, M"} +@string{Gottlieb = "Gottlieb A."} +@string{Greenberg = "Greenberg, Albert G."} +@string{Grishman = "Grishman, R."} +@string{Grimson = "Grimson, L."} +@string{Grolmusz = "Grolmusz, Vince"} +@string{Guibas = "Guibas, Leonidas Ioannis"} +@string{Gupta = "Gupta, P."} +@string{Gusfield = "Gusfield, Dan"} +@string{Hagerup = "Hagerup, Torben"} +@string{Han = "Han, Yijie"} +@string{Harel = "Harel, Dov"} +@string{Hart = "Hart, Sergiu"} +@string{Hastad = "H\aa{}stad, Johan"} +@string{Herbordt = "Herbordt, Martin C."} +@string{Hirschberg = "Hirschberg, D. S."} +@string{Hofri = "Hofri, Micha"} +@string{Hopcroft = "Hopcroft, John Edward"} +@string{Hopcroft = "Hopcroft, John E."} +@string{Huang = "Huang, M. A."} +@string{Huttenlocher = "Huttenlocher, Daniel P."} +@string{Hwa = "Hwa, Yu, Jenn"} +@string{Iliopoulos = "Iliopoulos, Costas"} +@string{Illingworth = "Illingworth, J."} +@string{Israeli = "Israeli, Amos"} +@string{Itai = "Itai, Alon"} +@string{Jacobs = "Jacobs, Christiaan T. M."} +@string{Joffe = "Joffe, A."} +@string{Jaja = "J{\'{a}}J{\'{a}}, Joseph"} +@string{Johnson = "Johnson, D. B."} +@string{Johnsson = "Johnsson, S. Lennart"} +@string{Kaas = "Kaas, R."} +@string{Kalvin = "Kalvin, A."} +@string{Kapadia = "Kapadia, C.H."} +@string{Karlin = "Karlin, Anna Rochelle"} +@string{Karlin = "Karlin, Anna R."} +@string{Karloff = "Karloff, Howard J."} +@string{Karp = "Karp, Richard Manning"} +@string{Karp = "Karp, Richard M."} +@string{Kedem = "Kedem, Zvi M."} +@string{Keller = "Keller, J."} +@string{Kessler = "Kessler, Hans W."} +@string{Khuller = "Khuller, Samir"} +@string{Kim = "Kim, Sung Kwon"} +@string{Kim = "Kim, Sung K."} +@string{KimY = "Kim, Young Man"} +@string{KimY = "Kim, Young M."} +@string{Kilian = "Kilian, Joe"} +@string{Kirkpatrick = "Kirkpatrick, David"} +@string{Kittler = "Kittler, J."} +@string{Klawe = "Klawe, Maria M."} +@string{Knott = "Knott, Gary D."} +@string{Knuth = "Knuth, Donald Ervin"} +@string{Knuth = "Knuth, Donald E."} +@string{Koch = "Koch, R. R."} +@string{Kolchin = "Kolchin, V. F."} +@string{Komlos = "Koml\'{o}s, J\'anos"} +@string{Kompella = "Kompella, K."} +@string{Koren = "Koren, Gilad"} +@string{Korner = "K{\umlaut{o}}rner, J\'anos"} +@string{Kosaraju = "Kosaraju, S. Rao"} +@string{Krishnamurthy = "Krishnamurthy, Sridhar"} +@string{Kruskal = "Kruskal, Clyde P."} +@string{Ladner = "Ladner, Richard E."} +@string{Lai = "Lai, Ten-Hwang"} +@string{Lamdan = "Y. Lamdan"} +@string{Landau = "Landau, Gad M."} +@string{Larmore = "Larmore, L"} +@string{Larson = "Larson, Per-\AA{}ke"} +@string{Lavallee = "Lavall\'{e}e, Ivan"} +@string{Lavault = "Lavault, Christian"} +@string{Lee = "Lee, David"} +@string{Leighton = "Leighton, F. Thomas"} +@string{Lin = "Lin, Geng"} +@string{Li = "Li, Ming"} +@string{Lipton = "Lipton, Richard J."} +@string{Lisinski = "Lisinski, Derek"} +@string{Litwin = "Litwin, W."} +@string{Luby = "Luby, Michael"} +@string{Lueker = "Lueker, George S."} +@string{MacKenzie = "MacKenzie, Philip D."} +@string{Maggs = "Maggs, Bruce M."} +@string{Mairson = "Mairson, Harry G."} +@string{Manzini = "Manzini, Giovanni"} +@string{Markowsky = "Markowsky, George"} +@string{Martel = "Martel, Charles U."} +@string{Marton = "Marton, K."} +@string{Matias = "Matias, Yossi"} +@string{McAulife = "McAulife, K. P."} +@string{McFaddin = "McFaddin, H. S."} +@string{Megiddo = "Megiddo, Nimrod"} +@string{Mehlhorn = "Mehlhorn, Kurt"} +@string{Mendelson = "Mendelson, H."} +@string{Micali = "Micali, Silvio"} +@string{Miller = "Miller, Gary L."} +@string{MillerRE = "Miller, R. E."} +@string{Mishra = "Mishra, B."} +@string{Molodowitch = "Molodowitch, Mariko"} +@string{Moran = "Moran, Shlomo"} +@string{Morrison = "Morrison, John A."} +@string{Motwani = "Motwani, Rajeev"} +@string{Mullin = "Mullin, Janes K."} +@string{Munro = "Munro, J. Ian"} +@string{Naher = "N{\umlaut{a}}her, Stefan"} +@string{NaorJ = "Naor, Joseph"} +@string{NaorM = "Naor, Moni"} +@string{Newman = "Newman, Ilan"} +@string{Nisan = "Nisan, Noam"} +@string{Nowak = "Nowak, Manfred"} +@string{Orbenic = "Orbeni\'c, Bojana"} +@string{ODonnel = "O'Donnel, Michael J."} +@string{Ouksel = "Ouksel, Mohamed"} +@string{Overmars = "Overmars, Mark H."} +@string{Owen = "Owen, D. B."} +@string{Palem = "Plaem, Krishna V."} +@string{Pan = "Pan, Victor"} +@string{Pantziou = "Pantziou, Grammati E."} +@string{Parberry = "Parberry, Ian"} +@string{ParkJ = "Park, James"} +@string{ParkK = "Park, Kunsoo"} +@string{Patel = "Patel, J. K."} +@string{Paul = "Paul, Wolfgang J."} +@string{Peleg = "Peleg, David"} +@string{Peter = "Peter, Scheuermann,"} +@string{Pflug = "Pflug, Georg Ch."} +@string{Pinotti = "Pinotti, Maria Cristina"} +@string{Pinotti = "Pinotti, Maria C."} +@string{Pintz = "Pintz, J."} +@string{Pippenger = "Pippenger, Nicholas"} +@string{Pittel = "Pittel, Boris K."} +@string{Plank = "Plank, Darrell"} +@string{Poblete = "Poblete, Patricio V."} +@string{Pomerance = "Pomerance, C."} +@string{Prasad = "Prasad, V. C."} +@string{Przytycka = "Przytycka, Teresa Maria"} +@string{Przytycka = "Przytycka, Teresa M."} +@string{Preparata = "Preparata, Franco P."} +@string{Pucci = "Pucci, Geppino"} +@string{Rabin = "Rabin, Michael Oser"} +@string{Rabin = "Rabin, Michael O."} +@string{Radzik = "Radzik, Tomasz"} +@string{Ragde = "Ragde, Prabhakar L."} +@string{Raghavan = "Raghavan, Prabhakar"} +@string{Raghunathan = "Raghunathan, A."} +@string{Rajan = "Rajan, V."} +@string{Rajasekaran = "Rajasekaran, Sanguthevar"} +@string{Ramachandran = "Ramachandran, Vijaya"} +@string{Ramakrishna = "Ramakrishna, M. V."} +@string{Raman = "Raman, Rajeev"} +@string{Ramaswami = "Ramaswami, R."} +@string{Ranade = "Ranade, Abhiram G."} +@string{Rao = "Rao, S. B."} +@string{Rauch = "Rauch, Monika"} +@string{Reghbati = "Eshrat Reghbati (Arjomandi)"} +@string{Reghbati = "Reghbati, Eshrat"} +@string{Reif = "Reif, John H."} +@string{Reisch = "Reisch, Stefan"} +@string{Reischuk = "Reischuk, R\umlaut{u}diger"} +@string{Rivest = "Rivest, Ronald L."} +@string{Rohnert = "Rohnert, Hans"} +@string{Rompel = "Rompel, John"} +@string{Rosier = "Rosier, Lou"} +@string{Rosenberg = "Rosenberg, Arnold L."} +@string{Rosser = "Rosser, J. B."} +@string{Rub = "R{\umlaut{u}}b, Christine"} +@string{Rudolph = "Rudolph, Larry"} +@string{Rumely = "Rumely, R. S."} +@string{Ruzzo = "Ruzzo, Walter Larry"} +@string{Ruzzo = "Ruzzo, Walter L."} +@string{Sagiv = "Sagiv, Y."} +@string{Scheuermann = "Scheuermann, Peter"} +@string{Schieber = "Schieber, Baruch"} +@string{Schmidt = "Schmidt, Jeanette P."} +@string{Schoenfeld = "Schoenfeld, L."} +@string{Schonberg = "Schonberg, E."} +@string{Schuster = "Schuster, Assaf"} +@string{Schwartz = "Schwartz, J. T."} +@string{Schwabe = "Schwabe, E. J."} +@string{Sevastyanov = "Sevast'yanov, B. A."} +@string{Shasha = "Shasha, D."} +@string{Sheffler = "Sheffler, Thomas J."} +@string{Shepp = "Shepp, Larry A."} +@string{Shannon = "Shannon, Gregory E."} +@string{Sharir = "Sharir, Micha"} +@string{Shiloach = "Shiloach, Yossi"} +@string{Shor = "Shor, Peter"} +@string{Shoup = "Shoup, Victor"} +@string{Shvartsman = "Shvartsman, Alex A."} +@string{Shvaytser = "Shvaytser, Haim"} +@string{Siegel = "Siegel, Alan"} +@string{Simon = "Simon, J."} +@string{Sipser = "Sipser, Michael"} +@string{Slot = "Slot, C."} +@string{Snir = "Snir, Marc"} +@string{Soda = "Soda, G."} +@string{Solovay = "Solovay, R."} +@string{Somalvico = "Somalvico, Mariko"} +@string{Spencer = "Spencer, Joel H."} +@string{Spirakis = "Spirakis, Paul G."} +@string{Stamoulis = "Stamoulis, George D."} +@string{Stankovic = "Stankovic, John A."} +@string{Steiger = "Steiger, William L."} +@string{Stockmeyer = "Stockmeyer, Larry Joseph"} +@string{Stockmeyer = "Stockmeyer, Larry J."} +@string{Stout = "Stout, Quentin F."} +@string{Strassen = "Strassen, V."} +@string{Szemeredi = "Szemer\'{e}di, Endre"} +@string{Tarjan = "Tarjan, Robert Endre"} +@string{Tarjan = "Tarjan, Robert E."} +@string{Thurimella = "Thurimella, Ramakrishna"} +@string{Tsitsiklis = "Tsitsiklis, John N."} +@string{Ullman = "Ullman, Jeffrey David"} +@string{Ullman = "Ullman, Jeffrey D."} +@string{Upfal = "Upfal, Eli"} +@string{Valiant = "Valiant, Leslie G."} +@string{van-Emde-Boas = "{van Emde Boas}, Peter"} +@string{van-Leeuwen = "{van Leeuwen}, J."} +@string{Van-Wyk = "Van-Wyk, Christopher J."} +@string{Vayda = "Vayda, Thomas P."} +@string{Vidyasankar = "Vidyasankar, K."} +@string{Vishkin = "Vishkin, Uzi"} +@string{Vitter = "Vitter, Jeffrey Scott"} +@string{Vitter = "Vitter, Jeffrey S."} +@string{Wagener = "Wagener, H."} +@string{Weems = "Weems, Charles C."} +@string{Wegman = "Wegman, Mark N."} +@string{Werman = "Werman, Michael"} +@string{Wigderson = "Wigderson, Avi"} +@string{Wilber = "Wilber, R."} +@string{Willard = "Willard, Dan E."} +@string{Winters = "Winters, Vincent G."} +@string{Wolfson = "Wolfson, Haim J."} +@string{Woll = "Woll, Heather"} +@string{Yannakakis = "Yannakakis, Mihalis"} +@string{Yao = "Yao, Andrew Chi-Chih"} +@string{Yao = "Yao, Andrew C.C."} +@string{Yechiali = "Yechiali, U."} +@string{Yesha = "Yesha, Y."} +@string{Yu = "Yu, Jenn-Hwa"} +@string{Yung = "Yung, Moti"} +@string{Zaroliagis = "Zaroliagis, Christos D."} +@string{Zijlstra = "Zijlstra, E."} +@string{Zimmermann = "Zimmermann, Wolf"} +Notes: +1) Anything which doesn't match the above format will + terminate the input. +2) Entries do not have to be sorted but it is easier to + manage the list if it sorted. +3) If you know the middle name of a person, it is better to + have two entries for this person. The first with the full middle + middle name and the second with only the middle initial. + addindex will always use the first entry, while bibtex will + always use the last entry. diff --git a/indexing/addindex/scanpath.c b/indexing/addindex/scanpath.c new file mode 100644 index 0000000000..9541ebf55f --- /dev/null +++ b/indexing/addindex/scanpath.c @@ -0,0 +1,50 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <malloc.h> + +extern char *ProgName; + +static char *InDir(path,name) +char *path; +char *name; +{ + char *s; + + if ((s = strchr(path,':')) != (char *)0) + *s == '\0'; + if (*path == '\0') + return (char *)0; + if ((s = malloc(2 + strlen(path) + strlen(name))) == (char *)0) { + (void) fprintf(stderr, + "%s: cannot malloc for %s/%s\n", + ProgName,path,name + ); + return (char *)0; + } + (void) sprintf(s,"%s/%s",path,name); + if (access(s,F_OK) == 0) + return s; + (void) free(s); + return (char *)0; +} + +char *scanpath(path,name) +char *path; +char *name; +{ + char *s; + + if (path == (char *)0) + return (char *)0; + + for (;;) { + char *where; + + if (where = InDir(path,name)) + return where; + if ((s = strchr(path,':')) == (char *)0) + return (char *)0; + path = s+1; + } +} |