-/* $NetBSD: mkindex.c,v 1.8 2000/07/31 11:29:48 simonb Exp $ */
+/* $NetBSD: mkindex.c,v 1.12 2021/05/02 12:50:44 rillig Exp $ */
/*-
* Copyright (c) 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
static char sccsid[] = "@(#)mkindex.c 8.1 (Berkeley) 6/11/93";
#else
static char rcsid[] =
- "$NetBSD: mkindex.c,v 1.8 2000/07/31 11:29:48 simonb Exp $";
+ "$NetBSD: mkindex.c,v 1.12 2021/05/02 12:50:44 rillig Exp $";
#endif
#endif /* not lint */
#include "bog.h"
-int main(void);
-char *nextword(FILE *, char *, int *, int *);
+static char *nextword(FILE *, char *, int *, int *);
int
main(void)
* Also set clen to the length of the compressed word (for mkindex) and
* rlen to the strlen() of the real word
*/
-char *
-nextword(fp, buffer, clen, rlen)
- FILE *fp;
- char *buffer;
- int *clen, *rlen;
+static char *
+nextword(FILE *fp, char *buffer, int *clen, int *rlen)
{
int ch, pcount;
char *p, *q;
return (NULL);
p = buf + (*clen = pcount);
-
+
while ((ch = getc(fp)) != EOF && ch >= 'a')
*p++ = ch;
lastch = ch;