comparison lib-src/yow.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents cc15677e0335
children de805c49cfc1
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
7 * With dynamic memory allocation. 7 * With dynamic memory allocation.
8 */ 8 */
9 9
10 /* Synched up with: FSF 19.28. */ 10 /* Synched up with: FSF 19.28. */
11 11
12 #include <../src/config.h> 12 #define DONT_ENCAPSULATE
13 #include <config.h>
13 14
14 #include <stdio.h> 15 #include <stdio.h>
15 #include <ctype.h> 16 #include <ctype.h>
16 #include <../src/paths.h> /* For PATH_DATA. */ 17 #include <../src/paths.h> /* For PATH_DATA. */
17 18
88 89
89 #define AVG_LEN 40 /* average length of a quotation */ 90 #define AVG_LEN 40 /* average length of a quotation */
90 91
91 /* Sets len and header_len */ 92 /* Sets len and header_len */
92 void 93 void
93 setup_yow(fp) 94 setup_yow (FILE *fp)
94 FILE *fp;
95 { 95 {
96 int c; 96 int c;
97 97
98 /* Get length of file */ 98 /* Get length of file */
99 /* Because the header (stuff before the first SEP) can be very long, 99 /* Because the header (stuff before the first SEP) can be very long,
117 } 117 }
118 118
119 119
120 /* go to a random place in the file and print the quotation there */ 120 /* go to a random place in the file and print the quotation there */
121 void 121 void
122 yow (fp) 122 yow (FILE *fp)
123 FILE *fp;
124 { 123 {
125 long offset; 124 long offset;
126 int c, i = 0; 125 int c, i = 0;
127 char *buf; 126 char *buf;
128 unsigned int bufsize; 127 unsigned int bufsize;