comparison lib-src/yow.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
8 */ 8 */
9 9
10 /* Synched up with: FSF 19.28. */ 10 /* Synched up with: FSF 19.28. */
11 11
12 #define DONT_ENCAPSULATE 12 #define DONT_ENCAPSULATE
13 #include <config.h> 13 #include <../src/config.h>
14 14
15 #include <stdio.h> 15 #include <stdio.h>
16 #include <ctype.h> 16 #include <ctype.h>
17 #include <../src/paths.h> /* For PATH_DATA. */ 17 #include <../src/paths.h> /* For PATH_DATA. */
18 18
31 #endif 31 #endif
32 32
33 void yow (FILE *fp); 33 void yow (FILE *fp);
34 void setup_yow (FILE *fp); 34 void setup_yow (FILE *fp);
35 35
36 #ifdef WIN32_NATIVE 36 #ifdef MSDOS
37 #define rootrelativepath(rel) \ 37 #define rootrelativepath(rel) \
38 ({\ 38 ({\
39 static char res[BUFSIZE], *p;\ 39 static char res[BUFSIZE], *p;\
40 strcpy (res, argv[0]);\ 40 strcpy (res, argv[0]);\
41 p = res + strlen (res);\ 41 p = res + strlen (res);\
89 89
90 #define AVG_LEN 40 /* average length of a quotation */ 90 #define AVG_LEN 40 /* average length of a quotation */
91 91
92 /* Sets len and header_len */ 92 /* Sets len and header_len */
93 void 93 void
94 setup_yow (FILE *fp) 94 setup_yow(fp)
95 FILE *fp;
95 { 96 {
96 int c; 97 int c;
97 98
98 /* Get length of file */ 99 /* Get length of file */
99 /* Because the header (stuff before the first SEP) can be very long, 100 /* Because the header (stuff before the first SEP) can be very long,
117 } 118 }
118 119
119 120
120 /* go to a random place in the file and print the quotation there */ 121 /* go to a random place in the file and print the quotation there */
121 void 122 void
122 yow (FILE *fp) 123 yow (fp)
124 FILE *fp;
123 { 125 {
124 long offset; 126 long offset;
125 int c, i = 0; 127 int c, i = 0;
126 char *buf; 128 char *buf;
127 unsigned int bufsize; 129 unsigned int bufsize;