-/* $NetBSD: mkindex.c,v 1.9 2003/08/07 09:37:06 agc Exp $ */
+/* $NetBSD: mkindex.c,v 1.12 2021/05/02 12:50:44 rillig Exp $ */
/*-
* Copyright (c) 1993
static char sccsid[] = "@(#)mkindex.c 8.1 (Berkeley) 6/11/93";
#else
static char rcsid[] =
- "$NetBSD: mkindex.c,v 1.9 2003/08/07 09:37:06 agc 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;