aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog38
-rw-r--r--lib-src/Makefile.in9
-rw-r--r--lib-src/digest-doc.c81
-rw-r--r--lib-src/ebrowse.c5
-rw-r--r--lib-src/emacsclient.c3
-rw-r--r--lib-src/makefile.w32-in22
-rw-r--r--lib-src/sorted-doc.c296
-rw-r--r--lib-src/test-distrib.c12
8 files changed, 45 insertions, 421 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 0f24b234972..160a19099a3 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,33 @@
12010-11-27 Joe Matarazzo <joe.matarazzo@gmail.com> (tiny change)
2
3 * ebrowse.c (yylex): If end of input buffer encountered while
4 searching for a newline after "//", return YYEOF. (Bug#7446)
5
62010-11-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7
8 * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back
9 definition of _CS_DARWIN_USER_TEMP_DIR for Mac OS X 10.4 and older.
10
112010-11-15 Dan Nicolaescu <dann@ics.uci.edu>
12
13 * test-distrib.c: Remove include guards for config.h and fcntl.h.
14 (O_RDONLY): Do not define.
15 (cool_read): Fix type for variable "sofar".
16
172010-10-25 Glenn Morris <rgm@gnu.org>
18
19 * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Remove easymenu.elc.
20
212010-10-23 Glenn Morris <rgm@gnu.org>
22
23 * digest-doc.c, sorted-doc.c: Remove files.
24 * Makefile.in (UTILITIES): Remove digest-doc and sorted-doc.
25 (digest-doc${EXEEXT}, sorted-doc${EXEEXT}): Remove rules.
26 * makefile.w32-in (ALL): Remove digest-doc and sorted-doc.
27 ($(BLD)/sorted-doc.exe, $(BLD)/digest-doc.exe, sorted-doc, digest-doc)
28 ($(BLD)/digest-doc.$(O), $(BLD)/sorted-doc.$(O)): Remove rules.
29 (install): Don't install digest-doc.exe or sorted-doc.exe.
30
12010-10-10 Dan Nicolaescu <dann@ics.uci.edu> 312010-10-10 Dan Nicolaescu <dann@ics.uci.edu>
2 32
3 * Makefile.in (PROFILING_LDFLAGS): Remove, not needed. 33 * Makefile.in (PROFILING_LDFLAGS): Remove, not needed.
@@ -5376,10 +5406,10 @@
5376 (main): Improve usage message. 5406 (main): Improve usage message.
5377 (error): Write to stderr, not stdout. 5407 (error): Write to stderr, not stdout.
5378 5408
5379 * b2m.c cvtmail.c digest-doc.c emacsclient.c emacsserver.c etags.c 5409 * b2m.c, cvtmail.c, digest-doc.c, emacsclient.c, emacsserver.c:
5380 fakemail.c hexl.c make-docfile.c profile.c sorted-doc.c test-distrib.c 5410 * etags.c, fakemail.c, hexl.c, make-docfile.c, profile.c, sorted-doc.c:
5381 timer.c wakeup.c yow.c: Eliminate some -Wall warnings from unused 5411 * test-distrib.c, timer.c, wakeup.c, yow.c: Eliminate some -Wall
5382 variables and implicitly declared functions. 5412 warnings from unused variables and implicitly declared functions.
5383 5413
53841994-10-11 Richard Stallman <rms@mole.gnu.ai.mit.edu> 54141994-10-11 Richard Stallman <rms@mole.gnu.ai.mit.edu>
5385 5415
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index b90b19b69b6..b9eea846dc8 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -118,8 +118,7 @@ STAMP_INST_SCRIPTS = stamp-rcs-checkin stamp-grep-changelog
118 118
119# Things that Emacs runs internally, or during the build process, 119# Things that Emacs runs internally, or during the build process,
120# which should not be installed in bindir. 120# which should not be installed in bindir.
121UTILITIES = profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \ 121UTILITIES = profile${EXEEXT} movemail${EXEEXT} fakemail${EXEEXT} \
122 movemail${EXEEXT} fakemail${EXEEXT} \
123 hexl${EXEEXT} update-game-score${EXEEXT} 122 hexl${EXEEXT} update-game-score${EXEEXT}
124 123
125DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT} 124DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
@@ -353,12 +352,6 @@ make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
353 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ 352 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
354 -o make-docfile 353 -o make-docfile
355 354
356digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
357 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
358
359sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c
360 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c $(LOADLIBES) -o sorted-doc
361
362movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) 355movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
363 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \ 356 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
364 $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail 357 $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
diff --git a/lib-src/digest-doc.c b/lib-src/digest-doc.c
deleted file mode 100644
index b3cb58e6d99..00000000000
--- a/lib-src/digest-doc.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/* Give this program DOC-mm.nn.oo as standard input and it outputs to
2 standard output a file of nroff output containing the doc strings.
3
4Copyright (C) 1987, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
5 2008, 2009, 2010 Free Software Foundation, Inc.
6
7This file is part of GNU Emacs.
8
9GNU Emacs is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 3 of the License, or
12(at your option) any later version.
13
14GNU Emacs is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22
23See also sorted-doc.c, which produces similar output
24but in texinfo format and sorted by function/variable name. */
25
26#include <stdio.h>
27
28#ifdef DOS_NT
29#include <fcntl.h> /* for O_BINARY */
30#include <io.h> /* for setmode */
31#endif
32
33int
34main (void)
35{
36 register int ch;
37 register int notfirst = 0;
38
39#ifdef DOS_NT
40 /* DOC is a binary file. */
41 if (!isatty (fileno (stdin)))
42 setmode (fileno (stdin), O_BINARY);
43#endif
44
45 printf (".TL\n");
46 printf ("Command Summary for GNU Emacs\n");
47 printf (".AU\nRichard M. Stallman\n");
48 while ((ch = getchar ()) != EOF)
49 {
50 if (ch == '\037')
51 {
52 if (notfirst)
53 printf ("\n.DE");
54 else
55 notfirst = 1;
56
57 printf ("\n.SH\n");
58
59 ch = getchar ();
60 printf (ch == 'F' ? "Function " : "Variable ");
61
62 while ((ch = getchar ()) != '\n') /* Changed this line */
63 {
64 if (ch != EOF)
65 putchar (ch);
66 else
67 {
68 ungetc (ch, stdin);
69 break;
70 }
71 }
72 printf ("\n.DS L\n");
73 }
74 else
75 putchar (ch);
76 }
77 return 0;
78}
79
80/* arch-tag: 2ba2c9b0-4157-4eba-bd9f-967e3677e35f
81 (do not change this comment) */
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 1fcbb8662f5..81067a90819 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -1700,6 +1700,11 @@ yylex (void)
1700 case '/': 1700 case '/':
1701 while (GET (c) && c != '\n') 1701 while (GET (c) && c != '\n')
1702 ; 1702 ;
1703 /* Don't try to read past the end of the input buffer if
1704 the file ends in a C++ comment without a newline. */
1705 if (c == 0)
1706 return YYEOF;
1707
1703 INCREMENT_LINENO; 1708 INCREMENT_LINENO;
1704 break; 1709 break;
1705 1710
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index b60b2661805..48ea3d22dc9 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1225,6 +1225,9 @@ set_local_socket (void)
1225 if (!tmpdir) 1225 if (!tmpdir)
1226 { 1226 {
1227#ifdef DARWIN_OS 1227#ifdef DARWIN_OS
1228#ifndef _CS_DARWIN_USER_TEMP_DIR
1229#define _CS_DARWIN_USER_TEMP_DIR 65537
1230#endif
1228 size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0); 1231 size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
1229 if (n > 0) 1232 if (n > 0)
1230 { 1233 {
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 25fb499cf3b..5591f0edbed 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -18,7 +18,7 @@
18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. 18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19 19
20 20
21ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc emacsclient 21ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient
22 22
23.PHONY: $(ALL) 23.PHONY: $(ALL)
24 24
@@ -36,10 +36,6 @@ $(BLD)/hexl.exe: $(BLD)/hexl.$(O)
36 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS) 36 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
37$(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) 37$(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O)
38 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS) 38 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS)
39$(BLD)/sorted-doc.exe: $(BLD)/sorted-doc.$(O)
40 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/sorted-doc.$(O) $(LIBS)
41$(BLD)/digest-doc.exe: $(BLD)/digest-doc.$(O)
42 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/digest-doc.$(O) $(LIBS)
43$(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O) 39$(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
44 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS) 40 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS)
45 41
@@ -50,8 +46,6 @@ ebrowse: stamp_BLD $(BLD)/ebrowse.exe
50hexl: stamp_BLD $(BLD)/hexl.exe 46hexl: stamp_BLD $(BLD)/hexl.exe
51movemail: stamp_BLD $(BLD)/movemail.exe 47movemail: stamp_BLD $(BLD)/movemail.exe
52fakemail: stamp_BLD $(BLD)/fakemail.exe 48fakemail: stamp_BLD $(BLD)/fakemail.exe
53sorted-doc: stamp_BLD $(BLD)/sorted-doc.exe
54digest-doc: stamp_BLD $(BLD)/digest-doc.exe
55emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe 49emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe
56 50
57test-distrib: stamp_BLD $(BLD)/test-distrib.exe 51test-distrib: stamp_BLD $(BLD)/test-distrib.exe
@@ -195,7 +189,6 @@ OTHER_PLATFORM_SUPPORT = \
195 $(lispsource)term/pc-win.elc \ 189 $(lispsource)term/pc-win.elc \
196 $(lispsource)x-dnd.elc \ 190 $(lispsource)x-dnd.elc \
197 $(lispsource)term/x-win.elc \ 191 $(lispsource)term/x-win.elc \
198 $(lispsource)emacs-lisp/easymenu.elc \
199 $(lispsource)term/ns-win.elc 192 $(lispsource)term/ns-win.elc
200 193
201 194
@@ -335,8 +328,6 @@ install: $(INSTALL_FILES)
335 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin 328 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
336 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin 329 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
337 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin 330 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
338 $(CP) $(BLD)/sorted-doc.exe $(INSTALL_DIR)/bin
339 $(CP) $(BLD)/digest-doc.exe $(INSTALL_DIR)/bin
340 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin 331 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
341 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin 332 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
342 - mkdir "$(INSTALL_DIR)/etc" 333 - mkdir "$(INSTALL_DIR)/etc"
@@ -404,9 +395,6 @@ $(BLD)/ctags.$(O) : \
404 $(SRC)/ntlib.h \ 395 $(SRC)/ntlib.h \
405 $(SRC)/getopt.h 396 $(SRC)/getopt.h
406 397
407$(BLD)/digest-doc.$(O) : \
408 $(SRC)/digest-doc.c
409
410$(BLD)/emacsclient.$(O) : \ 398$(BLD)/emacsclient.$(O) : \
411 $(SRC)/emacsclient.c \ 399 $(SRC)/emacsclient.c \
412 $(EMACS_ROOT)/src/s/ms-w32.h \ 400 $(EMACS_ROOT)/src/s/ms-w32.h \
@@ -496,12 +484,6 @@ $(BLD)/profile.$(O) : \
496$(BLD)/qsort.$(O) : \ 484$(BLD)/qsort.$(O) : \
497 $(SRC)/qsort.c 485 $(SRC)/qsort.c
498 486
499$(BLD)/sorted-doc.$(O) : \
500 $(SRC)/sorted-doc.c \
501 $(EMACS_ROOT)/src/s/ms-w32.h \
502 $(EMACS_ROOT)/src/m/intel386.h \
503 $(EMACS_ROOT)/src/config.h
504
505$(BLD)/tcp.$(O) : \ 487$(BLD)/tcp.$(O) : \
506 $(SRC)/tcp.c 488 $(SRC)/tcp.c
507 489
@@ -519,8 +501,6 @@ $(BLD)/timer.$(O) : \
519# 501#
520$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD 502$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD
521 503
522$(BLD)/sorted-doc.$(O) $(BLD)/digest-doc.$(O): stamp_BLD
523
524$(BLD)/test-distrib.$(O) $(GETOPTOBJS) $(MOVEMAILOBJS): stamp_BLD 504$(BLD)/test-distrib.$(O) $(GETOPTOBJS) $(MOVEMAILOBJS): stamp_BLD
525 505
526$(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD 506$(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c
deleted file mode 100644
index 4fe830e4013..00000000000
--- a/lib-src/sorted-doc.c
+++ /dev/null
@@ -1,296 +0,0 @@
1/* Give this program DOC-mm.nn.oo as standard input and it outputs to
2 standard output a file of texinfo input containing the doc strings.
3
4Copyright (C) 1989, 1992, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
5 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6
7This file is part of GNU Emacs.
8
9GNU Emacs is free software: you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation, either version 3 of the License, or
12(at your option) any later version.
13
14GNU Emacs is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21
22
23/* This version sorts the output by function name. */
24
25#ifdef HAVE_CONFIG_H
26#include <config.h>
27#endif
28
29#include <stdio.h>
30#include <ctype.h>
31#ifdef DOS_NT
32#include <fcntl.h> /* for O_BINARY */
33#include <io.h> /* for setmode */
34#endif
35#ifndef HAVE_STDLIB_H /* config.h includes stdlib. */
36#ifndef WINDOWSNT /* src/s/ms-w32.h includes stdlib.h */
37extern char *malloc ();
38#endif
39#endif
40
41#define NUL '\0'
42#define MARKER '\037'
43
44#define DEBUG 0
45
46typedef struct line LINE;
47
48struct line
49{
50 LINE *next; /* ptr to next or NULL */
51 char *line; /* text of the line */
52};
53
54typedef struct docstr DOCSTR;
55
56struct docstr /* Allocated thing for an entry. */
57{
58 DOCSTR *next; /* next in the chain */
59 char *name; /* name of the function or var */
60 LINE *first; /* first line of doc text. */
61 char type; /* 'F' for function, 'V' for variable */
62};
63
64
65/* Print error message. `s1' is printf control string, `s2' is arg for it. */
66
67void
68error (const char *s1, const char *s2)
69{
70 fprintf (stderr, "sorted-doc: ");
71 fprintf (stderr, s1, s2);
72 fprintf (stderr, "\n");
73}
74
75/* Print error message and exit. */
76
77void
78fatal (const char *s1, const char *s2)
79{
80 error (s1, s2);
81 exit (EXIT_FAILURE);
82}
83
84/* Like malloc but get fatal error if memory is exhausted. */
85
86char *
87xmalloc (int size)
88{
89 char *result = malloc ((unsigned)size);
90 if (result == NULL)
91 fatal ("%s", "virtual memory exhausted");
92 return result;
93}
94
95char *
96xstrdup (const char *str)
97{
98 char *buf = xmalloc (strlen (str) + 1);
99 (void) strcpy (buf, str);
100 return (buf);
101}
102
103/* Comparison function for qsort to call. */
104
105int
106cmpdoc (const void *va, const void *vb)
107{
108 DOCSTR *const *a = va;
109 DOCSTR *const *b = vb;
110 register int val = strcmp ((*a)->name, (*b)->name);
111 if (val) return val;
112 return (*a)->type - (*b)->type;
113}
114
115enum state
116{
117 WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET
118};
119
120const char *states[] =
121{
122 "WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET"
123};
124
125int
126main (void)
127{
128 register DOCSTR *dp = NULL; /* allocated DOCSTR */
129 register LINE *lp = NULL; /* allocated line */
130 register char *bp; /* ptr inside line buffer */
131 register enum state state = WAITING; /* state at start */
132 int cnt = 0; /* number of DOCSTRs read */
133
134 DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */
135 char buf[512]; /* line buffer */
136
137#ifdef DOS_NT
138 /* DOC is a binary file. */
139 if (!isatty (fileno (stdin)))
140 setmode (fileno (stdin), O_BINARY);
141#endif
142
143 bp = buf;
144
145 while (1) /* process one char at a time */
146 {
147 /* this char from the DOCSTR file */
148 register int ch = getchar ();
149
150 /* Beginnings */
151
152 if (state == WAITING)
153 {
154 if (ch == MARKER)
155 state = BEG_NAME;
156 }
157 else if (state == BEG_NAME)
158 {
159 cnt++;
160 if (dp == NULL) /* first dp allocated */
161 {
162 docs = dp = (DOCSTR*) xmalloc (sizeof (DOCSTR));
163 }
164 else /* all the rest */
165 {
166 dp->next = (DOCSTR*) xmalloc (sizeof (DOCSTR));
167 dp = dp->next;
168 }
169 lp = NULL;
170 dp->next = NULL;
171 bp = buf;
172 state = NAME_GET;
173 /* Record whether function or variable. */
174 dp->type = ch;
175 ch = getchar ();
176 }
177 else if (state == BEG_DESC)
178 {
179 if (lp == NULL) /* first line for dp */
180 {
181 dp->first = lp = (LINE*)xmalloc (sizeof (LINE));
182 }
183 else /* continuing lines */
184 {
185 lp->next = (LINE*)xmalloc (sizeof (LINE));
186 lp = lp->next;
187 }
188 lp->next = NULL;
189 bp = buf;
190 state = DESC_GET;
191 }
192
193 /* process gets */
194
195 if (state == NAME_GET || state == DESC_GET)
196 {
197 if (ch != MARKER && ch != '\n' && ch != EOF)
198 {
199 *bp++ = ch;
200 }
201 else /* saving and changing state */
202 {
203 *bp = NUL;
204 bp = xstrdup (buf);
205
206 if (state == NAME_GET)
207 dp->name = bp;
208 else
209 lp->line = bp;
210
211 bp = buf;
212 state = (ch == MARKER) ? BEG_NAME : BEG_DESC;
213 }
214 } /* NAME_GET || DESC_GET */
215 if (ch == EOF)
216 break;
217 }
218
219 {
220 DOCSTR **array;
221 register int i; /* counter */
222
223 /* build array of ptrs to DOCSTRs */
224
225 array = (DOCSTR**)xmalloc (cnt * sizeof (*array));
226 for (dp = docs, i = 0; dp != NULL ; dp = dp->next)
227 array[i++] = dp;
228
229 /* sort the array by name; within each name, by type */
230
231 qsort ((char*)array, cnt, sizeof (DOCSTR*), cmpdoc);
232
233 /* write the output header */
234
235 printf ("\\input texinfo @c -*-texinfo-*-\n");
236 printf ("@setfilename ../info/summary\n");
237 printf ("@settitle Command Summary for GNU Emacs\n");
238 printf ("@finalout\n");
239 printf ("@unnumbered Command Summary for GNU Emacs\n");
240 printf ("@table @asis\n");
241 printf ("\n");
242 printf ("@iftex\n");
243 printf ("@global@let@ITEM@item\n");
244 printf ("@def@item{@filbreak@vskip5pt@ITEM}\n");
245 printf ("@font@tensy cmsy10 scaled @magstephalf\n");
246 printf ("@font@teni cmmi10 scaled @magstephalf\n");
247 printf ("@def\\{{@tensy@char110}}\n"); /* this backslash goes with cmr10 */
248 printf ("@def|{{@tensy@char106}}\n");
249 printf ("@def@{{{@tensy@char102}}\n");
250 printf ("@def@}{{@tensy@char103}}\n");
251 printf ("@def<{{@teni@char62}}\n");
252 printf ("@def>{{@teni@char60}}\n");
253 printf ("@chardef@@64\n");
254 printf ("@catcode43=12\n");
255 printf ("@tableindent-0.2in\n");
256 printf ("@end iftex\n");
257
258 /* print each function from the array */
259
260 for (i = 0; i < cnt; i++)
261 {
262 printf ("\n@item %s @code{%s}\n@display\n",
263 array[i]->type == 'F' ? "Function" : "Variable",
264 array[i]->name);
265
266 for (lp = array[i]->first; lp != NULL ; lp = lp->next)
267 {
268 for (bp = lp->line; *bp; bp++)
269 {
270 /* the characters "@{}" need special treatment */
271 if (*bp == '@' || *bp == '{' || *bp == '}')
272 {
273 putchar('@');
274 }
275 putchar(*bp);
276 }
277 putchar ('\n');
278 }
279 printf("@end display\n");
280 /* Try to avoid a save size overflow in the TeX output
281 routine. */
282 if (i%100 == 0 && i > 0 && i != cnt)
283 printf("\n@end table\n@table @asis\n");
284 }
285
286 printf ("@end table\n");
287 printf ("@bye\n");
288 }
289
290 return EXIT_SUCCESS;
291}
292
293/* arch-tag: ce28f204-1e70-4b34-8210-3d54a5662071
294 (do not change this comment) */
295
296/* sorted-doc.c ends here */
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c
index 1487c2bab57..aca46f121fa 100644
--- a/lib-src/test-distrib.c
+++ b/lib-src/test-distrib.c
@@ -19,24 +19,14 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21 21
22#ifdef HAVE_CONFIG_H
23#include <config.h> 22#include <config.h>
24#endif
25
26#include <stdio.h> 23#include <stdio.h>
27
28#ifdef HAVE_FCNTL_H
29#include <fcntl.h> 24#include <fcntl.h>
30#endif
31 25
32#ifdef HAVE_UNISTD_H 26#ifdef HAVE_UNISTD_H
33#include <unistd.h> 27#include <unistd.h>
34#endif 28#endif
35 29
36#ifndef O_RDONLY
37#define O_RDONLY 0
38#endif
39
40/* Break string in two parts to avoid buggy C compilers that ignore characters 30/* Break string in two parts to avoid buggy C compilers that ignore characters
41 after nulls in strings. */ 31 after nulls in strings. */
42 32
@@ -55,7 +45,7 @@ int
55cool_read (int fd, char *buf, size_t size) 45cool_read (int fd, char *buf, size_t size)
56{ 46{
57 ssize_t num; 47 ssize_t num;
58 size_t sofar = 0; 48 ssize_t sofar = 0;
59 49
60 while (1) 50 while (1)
61 { 51 {