Mercurial > hg > xemacs-beta
annotate lib-src/b2m.c @ 5899:32f4ae21abc5
Collect macro definitions in configure.ac.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Tue, 05 May 2015 12:45:20 +0900 |
parents | 061f4f90f874 |
children |
rev | line source |
---|---|
428 | 1 /* |
2 * b2m - a filter for Babyl -> Unix mail files | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
3 * The copyright on this file has been disclaimed. |
428 | 4 * |
5 * usage: b2m < babyl > mailbox | |
6 * | |
7 * I find this useful whenever I have to use a | |
8 * system which - shock horror! - doesn't run | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
9 * GNU Emacs. At least now I can read all my |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
10 * GNU Emacs Babyl format mail files! |
428 | 11 * |
12 * it's not much but it's free! | |
13 * | |
14 * Ed Wilkinson | |
15 * E.Wilkinson@massey.ac.nz | |
16 * Mon Nov 7 15:54:06 PDT 1988 | |
17 */ | |
18 | |
19 /* Made conformant to the GNU coding standards January, 1995 | |
20 by Francesco Potorti` <pot@cnuce.cnr.it>. */ | |
21 | |
22 #ifdef HAVE_CONFIG_H | |
438 | 23 #include <config.h> |
428 | 24 /* On some systems, Emacs defines static as nothing for the sake |
25 of unexec. We don't want that here since we don't use unexec. */ | |
26 #undef static | |
27 #endif | |
28 | |
29 #include <stdio.h> | |
30 #include <stdlib.h> | |
31 #include <string.h> | |
32 #include <time.h> | |
33 #include <sys/types.h> | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
34 #include <getopt.h> |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
35 #ifdef MSDOS |
428 | 36 #include <fcntl.h> |
37 #endif | |
38 | |
39 #undef TRUE | |
40 #define TRUE 1 | |
41 #undef FALSE | |
42 #define FALSE 0 | |
43 | |
44 #define streq(s,t) (strcmp (s, t) == 0) | |
45 #define strneq(s,t,n) (strncmp (s, t, n) == 0) | |
46 | |
47 typedef int logical; | |
48 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
49 #define TM_YEAR_BASE 1900 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
50 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
51 /* Nonzero if TM_YEAR is a struct tm's tm_year value that causes |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
52 asctime to have well-defined behavior. */ |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
53 #ifndef TM_YEAR_IN_ASCTIME_RANGE |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
54 # define TM_YEAR_IN_ASCTIME_RANGE(tm_year) \ |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
55 (1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
56 #endif |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
57 |
428 | 58 /* |
59 * A `struct linebuffer' is a structure which holds a line of text. | |
60 * `readline' reads a line from a stream into a linebuffer and works | |
61 * regardless of the length of the line. | |
62 */ | |
63 struct linebuffer | |
64 { | |
65 long size; | |
66 char *buffer; | |
67 }; | |
68 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
69 long *xmalloc (unsigned int), *xrealloc (char *, unsigned int); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
70 char *concat (char *, char *, char *); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
71 long readline (struct linebuffer *, register FILE *); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
72 void fatal (char *); |
428 | 73 |
74 /* | |
75 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type); | |
76 */ | |
77 #define xnew(n, Type) ((Type *) xmalloc ((n) * sizeof (Type))) | |
78 | |
79 | |
80 | |
81 char *progname; | |
82 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
83 struct option longopts[] = |
428 | 84 { |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
85 { "help", no_argument, NULL, 'h' }, |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
86 { "version", no_argument, NULL, 'V' }, |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
87 { 0 } |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
88 }; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
89 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
90 extern int optind; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
91 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
92 int |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
93 main (int argc, char **argv) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
94 { |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
95 logical labels_saved, printing, header, first, last_was_blank_line; |
428 | 96 time_t ltoday; |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
97 struct tm *tm; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
98 char *labels, *p, *today; |
428 | 99 struct linebuffer data; |
100 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
101 #ifdef MSDOS |
428 | 102 _fmode = O_BINARY; /* all of files are treated as binary files */ |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
103 #if __DJGPP__ > 1 |
428 | 104 if (!isatty (fileno (stdout))) |
105 setmode (fileno (stdout), O_BINARY); | |
106 if (!isatty (fileno (stdin))) | |
107 setmode (fileno (stdin), O_BINARY); | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
108 #else /* not __DJGPP__ > 1 */ |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
109 (stdout)->_flag &= ~_IOTEXT; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
110 (stdin)->_flag &= ~_IOTEXT; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
111 #endif /* not __DJGPP__ > 1 */ |
428 | 112 #endif |
113 progname = argv[0]; | |
114 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
115 while (1) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
116 { |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
117 int opt = getopt_long (argc, argv, "hV", longopts, 0); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
118 if (opt == EOF) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
119 break; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
120 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
121 switch (opt) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
122 { |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
123 case 'V': |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
124 printf ("%s (XEmacs %s)\n", "b2m", EMACS_VERSION); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
125 puts ("b2m is in the public domain."); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
126 exit (EXIT_SUCCESS); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
127 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
128 case 'h': |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
129 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
130 exit (EXIT_SUCCESS); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
131 } |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
132 } |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
133 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
134 if (optind != argc) |
428 | 135 { |
136 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
137 exit (EXIT_SUCCESS); |
428 | 138 } |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
139 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
140 labels_saved = printing = header = last_was_blank_line = FALSE; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
141 first = TRUE; |
428 | 142 ltoday = time (0); |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
143 /* Convert to a string, checking for out-of-range time stamps. |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
144 Don't use 'ctime', as that might dump core if the hardware clock |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
145 is set to a bizarre value. */ |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
146 tm = localtime (<oday); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
147 if (! (tm && TM_YEAR_IN_ASCTIME_RANGE (tm->tm_year) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
148 && (today = asctime (tm)))) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
149 fatal ("current time is out of range"); |
428 | 150 data.size = 200; |
151 data.buffer = xnew (200, char); | |
152 | |
153 if (readline (&data, stdin) == 0 | |
154 || !strneq (data.buffer, "BABYL OPTIONS:", 14)) | |
155 fatal ("standard input is not a Babyl mailfile."); | |
156 | |
157 while (readline (&data, stdin) > 0) | |
158 { | |
159 if (streq (data.buffer, "*** EOOH ***") && !printing) | |
160 { | |
161 printing = header = TRUE; | |
162 printf ("From \"Babyl to mail by %s\" %s", progname, today); | |
163 continue; | |
164 } | |
165 | |
166 if (data.buffer[0] == '\037') | |
167 { | |
168 if (data.buffer[1] == '\0') | |
169 continue; | |
170 else if (data.buffer[1] == '\f') | |
171 { | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
172 if (first) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
173 first = FALSE; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
174 else if (! last_was_blank_line) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
175 puts(""); |
428 | 176 /* Save labels. */ |
177 readline (&data, stdin); | |
178 p = strtok (data.buffer, " ,\r\n\t"); | |
179 labels = "X-Babyl-Labels: "; | |
180 | |
181 while ((p = strtok (NULL, " ,\r\n\t"))) | |
182 labels = concat (labels, p, ", "); | |
183 | |
184 p = &labels[strlen (labels) - 2]; | |
185 if (*p == ',') | |
186 *p = '\0'; | |
187 printing = header = FALSE; | |
188 labels_saved = TRUE; | |
189 continue; | |
190 } | |
191 } | |
192 | |
193 if ((data.buffer[0] == '\0') && header) | |
194 { | |
195 header = FALSE; | |
196 if (labels_saved) | |
197 puts (labels); | |
198 } | |
199 | |
200 if (printing) | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
201 { |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
202 puts (data.buffer); |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
203 if (data.buffer[0] == '\0') |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
204 last_was_blank_line = TRUE; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
205 else |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
206 last_was_blank_line = FALSE; |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
207 } |
428 | 208 } |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
209 |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
210 return EXIT_SUCCESS; |
428 | 211 } |
212 | |
213 | |
214 | |
215 /* | |
216 * Return a newly-allocated string whose contents | |
217 * concatenate those of s1, s2, s3. | |
218 */ | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
219 char * |
428 | 220 concat (char *s1, char *s2, char *s3) |
221 { | |
222 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | |
223 char *result = xnew (len1 + len2 + len3 + 1, char); | |
224 | |
225 strcpy (result, s1); | |
226 strcpy (result + len1, s2); | |
227 strcpy (result + len1 + len2, s3); | |
228 result[len1 + len2 + len3] = '\0'; | |
229 | |
230 return result; | |
231 } | |
232 | |
233 /* | |
234 * Read a line of text from `stream' into `linebuffer'. | |
235 * Return the number of characters read from `stream', | |
236 * which is the length of the line including the newline, if any. | |
237 */ | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
238 long |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
239 readline (struct linebuffer *linebuffer, register FILE *stream) |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
240 |
428 | 241 { |
242 char *buffer = linebuffer->buffer; | |
243 register char *p = linebuffer->buffer; | |
244 register char *pend; | |
245 int chars_deleted; | |
246 | |
247 pend = p + linebuffer->size; /* Separate to avoid 386/IX compiler bug. */ | |
248 | |
249 while (1) | |
250 { | |
251 register int c = getc (stream); | |
252 if (p == pend) | |
253 { | |
254 linebuffer->size *= 2; | |
255 buffer = (char *) xrealloc (buffer, linebuffer->size); | |
256 p += buffer - linebuffer->buffer; | |
257 pend = buffer + linebuffer->size; | |
258 linebuffer->buffer = buffer; | |
259 } | |
260 if (c == EOF) | |
261 { | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
262 *p = '\0'; |
428 | 263 chars_deleted = 0; |
264 break; | |
265 } | |
266 if (c == '\n') | |
267 { | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
268 if (p > buffer && p[-1] == '\r') |
428 | 269 { |
270 *--p = '\0'; | |
271 chars_deleted = 2; | |
272 } | |
273 else | |
274 { | |
275 *p = '\0'; | |
276 chars_deleted = 1; | |
277 } | |
278 break; | |
279 } | |
280 *p++ = c; | |
281 } | |
282 | |
283 return (p - buffer + chars_deleted); | |
284 } | |
285 | |
286 /* | |
287 * Like malloc but get fatal error if memory is exhausted. | |
288 */ | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
289 long * |
428 | 290 xmalloc (unsigned int size) |
291 { | |
292 long *result = (long *) malloc (size); | |
293 if (result == NULL) | |
294 fatal ("virtual memory exhausted"); | |
295 return result; | |
296 } | |
297 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
298 long * |
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
299 xrealloc (char *ptr, unsigned int size) |
428 | 300 { |
301 long *result = (long *) realloc (ptr, size); | |
302 if (result == NULL) | |
303 fatal ("virtual memory exhausted"); | |
304 return result; | |
305 } | |
306 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
307 void |
428 | 308 fatal (char *message) |
309 { | |
310 fprintf (stderr, "%s: %s\n", progname, message); | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
311 exit (EXIT_FAILURE); |
428 | 312 } |
313 | |
5406
061f4f90f874
Convert lib-src/ to GPLv3.
Mike Sperber <sperber@deinprogramm.de>
parents:
442
diff
changeset
|
314 /* b2m.c ends here */ |