File fortune-decl.patch of Package fortune
--- fortune/fortune.c
+++ fortune/fortune.c
@@ -61,6 +61,8 @@
# include <ctype.h>
# include <stdlib.h>
# include <string.h>
+# include <time.h>
+# include <netinet/in.h>
#if !(defined __GLIBC__ && __GLIBC__ >= 2)
# include <rx.h>
#endif
--- strfile/strfile.c
+++ strfile/strfile.c
@@ -56,6 +56,8 @@
# include <ctype.h>
# include <stdlib.h>
# include <string.h>
+# include <unistd.h>
+# include <netinet/in.h>
# include "strfile.h"
# ifndef MAXPATHLEN
@@ -135,6 +137,11 @@
STR *Firstch; /* first chars of each string */
+void getargs(int, char **);
+void add_offset(FILE *, off_t);
+void do_order(void);
+void randomize(void);
+void usage(void);
/*
* main:
@@ -145,6 +152,7 @@
* CHUNKSIZE blocks; if the latter, we just write each pointer,
* and then seek back to the beginning to write in the table.
*/
+int
main(ac, av)
int ac;
char **av;
@@ -230,7 +238,7 @@
if (Num_pts == 2)
puts("There was 1 string");
else
- printf("There were %d strings\n", Num_pts - 1);
+ printf("There were %ld strings\n", Num_pts - 1);
printf("Longest string: %lu byte%s\n", Tbl.str_longlen,
Tbl.str_longlen == 1 ? "" : "s");
printf("Shortest string: %lu byte%s\n", Tbl.str_shortlen,
@@ -256,6 +264,7 @@
/*
* This routine evaluates arguments from the command line
*/
+void
getargs(argc, argv)
int argc;
char **argv;
@@ -309,6 +318,7 @@
}
}
+void
usage()
{
(void) fprintf(stderr,
@@ -320,6 +330,7 @@
* add_offset:
* Add an offset to the list, or write it out, as appropriate.
*/
+void
add_offset(fp, off)
FILE *fp;
off_t off;
@@ -340,6 +351,7 @@
* do_order:
* Order the strings alphabetically (possibly ignoring case).
*/
+void
do_order()
{
register int i;
@@ -385,6 +397,7 @@
return buf;
}
+int
cmp_str(p1, p2)
STR *p1, *p2;
{
@@ -436,6 +449,7 @@
* not to randomize across delimiter boundaries. All
* randomization is done within each block.
*/
+void
randomize()
{
register int cnt, i;
--- unstr/unstr.c
+++ unstr/unstr.c
@@ -65,6 +65,7 @@
# include <stdio.h>
# include <stdlib.h>
# include <ctype.h>
+# include <netinet/in.h>
# ifndef MAXPATHLEN
# define MAXPATHLEN 1024
@@ -78,7 +79,11 @@
char *strcat(), *strcpy();
+void getargs(char **);
+void order_unstr(STRFILE *);
+
/* ARGSUSED */
+int
main(ac, av)
int ac;
char **av;
@@ -111,6 +116,7 @@
exit(0);
}
+void
getargs(av)
register char *av[];
{
@@ -123,6 +129,7 @@
(void) strcat(Datafile, ".dat");
}
+void
order_unstr(tbl)
register STRFILE *tbl;
{