annotate lib-src/b2m.c @ 18344:dca9b4a8155e

(untabify): Handle consecutive tabs all at once. (tabify-regexp): New var. (tabify): Use it.
author Karl Heuer <kwzh@gnu.org>
date Sat, 21 Jun 1997 00:35:11 +0000
parents 1f3d8941aba2
children 000f4d300712
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /*
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 * b2m - a filter for Babyl -> Unix mail files
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 *
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 * usage: b2m < babyl > mailbox
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 *
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 * I find this useful whenever I have to use a
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 * system which - shock horror! - doesn't run
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 * Gnu emacs. At least now I can read all my
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 * Gnumacs Babyl format mail files!
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 *
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 * it's not much but it's free!
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 *
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 * Ed Wilkinson
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 * E.Wilkinson@massey.ac.nz
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 * Mon Nov 7 15:54:06 PDT 1988
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 */
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
18 /* Made conformant to the GNU coding standards January, 1995
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
19 by Francesco Potorti` <pot@cnuce.cnr.it>. */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
20
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 #include <stdio.h>
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 #include <time.h>
4008
b43e59cb1d54 * b2m.c: #include <sys/types.h>.
Jim Blandy <jimb@redhat.com>
parents: 2101
diff changeset
23 #include <sys/types.h>
5448
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
24 #ifdef MSDOS
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
25 #include <fcntl.h>
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
26 #endif
998
61c6983219ff entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 440
diff changeset
27
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
28 #ifdef HAVE_CONFIG_H
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
29 #include <config.h>
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
30 /* On some systems, Emacs defines static as nothing for the sake
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
31 of unexec. We don't want that here since we don't use unexec. */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
32 #undef static
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
33 #endif
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
35 #undef TRUE
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
36 #define TRUE 1
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
37 #undef FALSE
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
38 #define FALSE 0
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
39
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
40 /* Exit codes for success and failure. */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
41 #ifdef VMS
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
42 #define GOOD 1
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
43 #define BAD 0
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
44 #else
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
45 #define GOOD 0
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
46 #define BAD 1
4572
beb5acbcd482 (TRUE, FALSE): Don't define if already defined.
Richard M. Stallman <rms@gnu.org>
parents: 4008
diff changeset
47 #endif
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
49 #define streq(s,t) (strcmp (s, t) == 0)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
50 #define strneq(s,t,n) (strncmp (s, t, n) == 0)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
51
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
52 typedef int logical;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
53
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
54 /*
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
55 * A `struct linebuffer' is a structure which holds a line of text.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
56 * `readline' reads a line from a stream into a linebuffer and works
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
57 * regardless of the length of the line.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
58 */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
59 struct linebuffer
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
60 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
61 long size;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
62 char *buffer;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
63 };
8957
4dffbc5d5dc7 (from, labels, data): Use MAX_DATA_LEN as length.
Richard M. Stallman <rms@gnu.org>
parents: 7528
diff changeset
64
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
65 extern char *strtok();
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
66
11674
754722efad75 (xmalloc, xrealloc): Declare them long *.
Richard M. Stallman <rms@gnu.org>
parents: 11423
diff changeset
67 long *xmalloc (), *xrealloc ();
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
68 char *concat ();
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
69 long readline ();
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
70 void fatal ();
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
72 /*
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
73 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
74 */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
75 #define xnew(n, Type) ((Type *) xmalloc ((n) * sizeof (Type)))
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
76
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
77
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
78
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
79 char *progname;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
80
2101
df8249aa4901 * b2m.c (main): Don't exit upon reading a blank line.
Jim Blandy <jimb@redhat.com>
parents: 998
diff changeset
81 main (argc, argv)
df8249aa4901 * b2m.c (main): Don't exit upon reading a blank line.
Jim Blandy <jimb@redhat.com>
parents: 998
diff changeset
82 int argc;
df8249aa4901 * b2m.c (main): Don't exit upon reading a blank line.
Jim Blandy <jimb@redhat.com>
parents: 998
diff changeset
83 char **argv;
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 {
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
85 logical labels_saved, printing, header;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
86 time_t ltoday;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
87 char *labels, *p, *today;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
88 struct linebuffer data;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
89
5448
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
90 #ifdef MSDOS
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
91 _fmode = O_BINARY; /* all of files are treated as binary files */
14968
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
92 #if __DJGPP__ > 1
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
93 if (!isatty (fileno (stdout)))
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
94 setmode (fileno (stdout), O_BINARY);
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
95 if (!isatty (fileno (stdin)))
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
96 setmode (fileno (stdin), O_BINARY);
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
97 #else /* not __DJGPP__ > 1 */
5448
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
98 (stdout)->_flag &= ~_IOTEXT;
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
99 (stdin)->_flag &= ~_IOTEXT;
14968
1351c75bc3d6 (main) [MSDOS]: Handle DJGPP version 2.
Richard M. Stallman <rms@gnu.org>
parents: 14850
diff changeset
100 #endif /* not __DJGPP__ > 1 */
5448
18de002e47dd (main) [MSDOS]: Open all files as binary.
Richard M. Stallman <rms@gnu.org>
parents: 4696
diff changeset
101 #endif
14850
13d38dfedb51 (main): Initialize progname variable before using it.
Richard M. Stallman <rms@gnu.org>
parents: 11674
diff changeset
102 progname = argv[0];
13d38dfedb51 (main): Initialize progname variable before using it.
Richard M. Stallman <rms@gnu.org>
parents: 11674
diff changeset
103
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
104 if (argc != 1)
6173
cbf3383981cb (main): Change delimiter from "^L" to "^_^L".
Karl Heuer <kwzh@gnu.org>
parents: 5448
diff changeset
105 {
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
106 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
107 exit (GOOD);
6173
cbf3383981cb (main): Change delimiter from "^L" to "^_^L".
Karl Heuer <kwzh@gnu.org>
parents: 5448
diff changeset
108 }
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
109 labels_saved = printing = header = FALSE;
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
110 ltoday = time (0);
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
111 today = ctime (&ltoday);
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
112 data.size = 200;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
113 data.buffer = xnew (200, char);
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
115 if (readline (&data, stdin) == 0
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
116 || !strneq (data.buffer, "BABYL OPTIONS:", 14))
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
117 fatal ("standard input is not a Babyl mailfile.");
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
118
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
119 while (readline (&data, stdin) > 0)
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
120 {
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
121 if (streq (data.buffer, "*** EOOH ***") && !printing)
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
122 {
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
123 printing = header = TRUE;
14850
13d38dfedb51 (main): Initialize progname variable before using it.
Richard M. Stallman <rms@gnu.org>
parents: 11674
diff changeset
124 printf ("From \"Babyl to mail by %s\" %s", progname, today);
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
125 continue;
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
126 }
6173
cbf3383981cb (main): Change delimiter from "^L" to "^_^L".
Karl Heuer <kwzh@gnu.org>
parents: 5448
diff changeset
127
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
128 if (data.buffer[0] == '\037')
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
129 {
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
130 if (data.buffer[1] == '\0')
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
131 continue;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
132 else if (data.buffer[1] == '\f')
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
133 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
134 /* Save labels. */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
135 readline (&data, stdin);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
136 p = strtok (data.buffer, " ,\r\n\t");
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
137 labels = "X-Babyl-Labels: ";
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
139 while (p = strtok (NULL, " ,\r\n\t"))
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
140 labels = concat (labels, p, ", ");
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
141
11423
a096f82d87d9 (main): Check for trailing ", " before trying to delete it.
Karl Heuer <kwzh@gnu.org>
parents: 10370
diff changeset
142 p = &labels[strlen (labels) - 2];
a096f82d87d9 (main): Check for trailing ", " before trying to delete it.
Karl Heuer <kwzh@gnu.org>
parents: 10370
diff changeset
143 if (*p == ',')
a096f82d87d9 (main): Check for trailing ", " before trying to delete it.
Karl Heuer <kwzh@gnu.org>
parents: 10370
diff changeset
144 *p = '\0';
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
145 printing = header = FALSE;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
146 labels_saved = TRUE;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
147 continue;
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
148 }
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
149 }
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
151 if ((data.buffer[0] == '\0') && header)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
152 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
153 header = FALSE;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
154 if (labels_saved)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
155 puts (labels);
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
156 }
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
158 if (printing)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
159 puts (data.buffer);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
160 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
161 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
162
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
163
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
164
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
165 /*
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
166 * Return a newly-allocated string whose contents
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
167 * concatenate those of s1, s2, s3.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
168 */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
169 char *
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
170 concat (s1, s2, s3)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
171 char *s1, *s2, *s3;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
172 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
173 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
174 char *result = xnew (len1 + len2 + len3 + 1, char);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
175
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
176 strcpy (result, s1);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
177 strcpy (result + len1, s2);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
178 strcpy (result + len1 + len2, s3);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
179 result[len1 + len2 + len3] = '\0';
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
180
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
181 return result;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
182 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
183
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
184 /*
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
185 * Read a line of text from `stream' into `linebuffer'.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
186 * Return the number of characters read from `stream',
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
187 * which is the length of the line including the newline, if any.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
188 */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
189 long
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
190 readline (linebuffer, stream)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
191 struct linebuffer *linebuffer;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
192 register FILE *stream;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
193 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
194 char *buffer = linebuffer->buffer;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
195 register char *p = linebuffer->buffer;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
196 register char *pend;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
197 int chars_deleted;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
198
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
199 pend = p + linebuffer->size; /* Separate to avoid 386/IX compiler bug. */
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
200
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
201 while (1)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
202 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
203 register int c = getc (stream);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
204 if (p == pend)
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
205 {
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
206 linebuffer->size *= 2;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
207 buffer = (char *) xrealloc (buffer, linebuffer->size);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
208 p += buffer - linebuffer->buffer;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
209 pend = buffer + linebuffer->size;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
210 linebuffer->buffer = buffer;
6215
226d490216f7 Clean up indentation and whitespace.
Richard M. Stallman <rms@gnu.org>
parents: 6214
diff changeset
211 }
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
212 if (c == EOF)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
213 {
18238
1f3d8941aba2 (readline): Terminate buffer properly when EOF seen.
Karl Heuer <kwzh@gnu.org>
parents: 14968
diff changeset
214 *p = '\0';
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
215 chars_deleted = 0;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
216 break;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
217 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
218 if (c == '\n')
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
219 {
18238
1f3d8941aba2 (readline): Terminate buffer properly when EOF seen.
Karl Heuer <kwzh@gnu.org>
parents: 14968
diff changeset
220 if (p > buffer && p[-1] == '\r')
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
221 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
222 *--p = '\0';
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
223 chars_deleted = 2;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
224 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
225 else
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
226 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
227 *p = '\0';
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
228 chars_deleted = 1;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
229 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
230 break;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
231 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
232 *p++ = c;
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 }
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
234
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
235 return (p - buffer + chars_deleted);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
236 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
237
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
238 /*
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
239 * Like malloc but get fatal error if memory is exhausted.
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
240 */
11674
754722efad75 (xmalloc, xrealloc): Declare them long *.
Richard M. Stallman <rms@gnu.org>
parents: 11423
diff changeset
241 long *
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
242 xmalloc (size)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
243 unsigned int size;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
244 {
11674
754722efad75 (xmalloc, xrealloc): Declare them long *.
Richard M. Stallman <rms@gnu.org>
parents: 11423
diff changeset
245 long *result = (long *) malloc (size);
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
246 if (result == NULL)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
247 fatal ("virtual memory exhausted");
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
248 return result;
440
c1abcb55a546 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 }
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
250
11674
754722efad75 (xmalloc, xrealloc): Declare them long *.
Richard M. Stallman <rms@gnu.org>
parents: 11423
diff changeset
251 long *
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
252 xrealloc (ptr, size)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
253 char *ptr;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
254 unsigned int size;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
255 {
11674
754722efad75 (xmalloc, xrealloc): Declare them long *.
Richard M. Stallman <rms@gnu.org>
parents: 11423
diff changeset
256 long *result = (long *) realloc (ptr, size);
10370
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
257 if (result == NULL)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
258 fatal ("virtual memory exhausted");
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
259 return result;
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
260 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
261
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
262 void
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
263 fatal (message)
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
264 {
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
265 fprintf (stderr, "%s: %s\n", progname, message);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
266 exit (BAD);
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
267 }
4b1c8dc724e6 (concat, xmalloc, xrealloc, readline, xnew): Four new
Richard M. Stallman <rms@gnu.org>
parents: 9491
diff changeset
268