aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog141
-rw-r--r--lib-src/Makefile.in15
-rw-r--r--lib-src/b2m.c32
-rw-r--r--lib-src/digest-doc.c2
-rw-r--r--lib-src/ebrowse.c355
-rw-r--r--lib-src/emacsclient.c87
-rw-r--r--lib-src/etags.c618
-rw-r--r--lib-src/fakemail.c83
-rw-r--r--lib-src/hexl.c8
-rw-r--r--lib-src/make-docfile.c143
-rw-r--r--lib-src/makefile.w32-in10
-rw-r--r--lib-src/movemail.c111
-rw-r--r--lib-src/ntlib.c22
-rw-r--r--lib-src/pop.c147
-rw-r--r--lib-src/profile.c6
-rw-r--r--lib-src/sorted-doc.c21
-rw-r--r--lib-src/test-distrib.c9
-rw-r--r--lib-src/update-game-score.c89
18 files changed, 794 insertions, 1105 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 079941811c0..1b6a16dd524 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,141 @@
12010-07-20 Juanma Barranquero <lekktu@gmail.com>
2
3 * emacsclient.c (get_current_dir_name, w32_get_resource)
4 (w32_getenv, w32_set_user_model_id, w32_window_app, w32_execvp)
5 (close_winsock, initialize_sockets, w32_find_emacs_process)
6 (w32_give_focus):
7 * ntlib.c (getlogin, getuid, getgid, getegid):
8 Convert definitions to standard C.
9
102010-07-12 Andreas Schwab <schwab@linux-m68k.org>
11
12 * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
13 (PROFILING_LDFLAGS): Set from substitution.
14 (BASE_CFLAGS): Add ${C_WARNINGS_SWITCH}.
15 (ALL_CFLAGS, CPP_CFLAGS): Add ${PROFILING_CFLAGS}.
16 (LINK_CFLAGS): Add ${PROFILING_LDFLAGS}.
17
182010-07-12 Eli Zaretskii <eliz@gnu.org>
19
20 * makefile.w32-in (lisp2): Change hebrew.el to hebrew.elc (see
21 2010-07-12T05:25:46Z!handa@etlken).
22
232010-07-11 Andreas Schwab <schwab@linux-m68k.org>
24
25 * emacsclient.c (set_local_socket): Use strchr, strrchr instead of
26 index, rindex.
27 * movemail.c (mail_spool_name, popmail): Likewise.
28 * pop.c (pop_list): Likewise.
29
302010-07-11 Eli Zaretskii <eliz@gnu.org>
31
32 * makefile.w32-in (obj): Add menu.o, bidi.o, w32uniscribe.o,
33 and unexw32.o. (Bug#6603)
34
352010-07-10 Eli Zaretskii <eliz@gnu.org>
36
37 * Makefile.in ($(DESTDIR)${archlibdir}): Convert spaces to TABs.
38
392010-07-09 Andreas Schwab <schwab@linux-m68k.org>
40
41 * make-docfile.c (write_c_args): Restructure scanning loop.
42
432010-07-09 Dan Nicolaescu <dann@ics.uci.edu>
44
45 * make-docfile.c (write_c_args): Deal with type names in DEFUN
46 arguments.
47
482010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
49
50 * update-game-score.c (P_): Remove macro.
51 * ebrowse.c: Remove include guards.
52 (P_): Remove macro.
53
542010-07-07 Andreas Schwab <schwab@linux-m68k.org>
55
56 * ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
57 memcpy, memmove, memset.
58 * pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
59
602010-07-06 Andreas Schwab <schwab@linux-m68k.org>
61
62 * movemail.c: Add MAIL_USE_POP around prototypes.
63 Include <string.h> if HAVE_STRING_H.
64 (strerror): Only declare if !HAVE_STRERROR.
65 (fatal): Make static.
66 (error): Likewise.
67 (pfatal_with_name): Likewise.
68 (pfatal_and_delete). Likewise.
69 (concat): Likewise.
70 (xmalloc): Likewise.
71 (popmail): Likewise.
72 (pop_retr): Likewise.
73 (mbx_write): Likewise.
74 (mbx_delimit_begin): Likewise.
75 (mbx_delimit_end): Likewise.
76
772010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
78
79 * fakemail.c (action): Convert function definitions to standard C.
80 (add_a_stream):
81 * test-distrib.c (cool_read):
82 (main): Likewise.
83
842010-07-03 Andreas Schwab <schwab@linux-m68k.org>
85
86 * sorted-doc.c (cmpdoc): Fix signature.
87 (qsort_compare): Delete.
88 (main): Remove cast.
89
902010-07-03 Juanma Barranquero <lekktu@gmail.com>
91
92 * ebrowse.c (match_qualified_namespace_alias): Check for null pointer.
93
942010-07-03 Juanma Barranquero <lekktu@gmail.com>
95
96 Fix prototype warnings.
97
98 * ebrowse.c (match_qualified_namespace_alias):
99 Pass sym* to find_namespace, not link*.
100
101 * emacsclient.c (send_to_emacs, quote_argument): Arg s is HSOCKET.
102
103 * sorted-doc.c (qsort_compare): New typedef.
104 (main): Use it to cast cmpdoc.
105
1062010-07-03 Dan Nicolaescu <dann@ics.uci.edu>
107
108 * update-game-score.c: Convert function definitions to standard C.
109 * sorted-doc.c:
110 * profile.c:
111 * pop.c:
112 * movemail.c:
113 * make-docfile.c:
114 * hexl.c:
115 * fakemail.c:
116 * etags.c:
117 * ebrowse.c:
118 * digest-doc.c:
119 * b2m.c: Likewise.
120
1212010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
122
123 * make-docfile.c (xmalloc, xrealloc, concat, readline, fatal):
124 * b2m.c (scan_file, scan_lisp_file, scan_c_file): Convert to
125 standard C prototypes.
126
1272010-07-02 Jan Djärv <jan.h.d@swipnet.se>
128
129 * ebrowse.c: Remove P_ and __P.
130 * etags.c:
131 * movemail.c:
132 * pop.c:
133 * update-game-score.c: Likewise.
134
1352010-06-24 Juanma Barranquero <lekktu@gmail.com>
136
137 * movemail.c (error): Avoid warning when there are no args.
138
12010-06-11 Juanma Barranquero <lekktu@gmail.com> 1392010-06-11 Juanma Barranquero <lekktu@gmail.com>
2 140
3 * makefile.w32-in (lisp2): Fix references to vc/vc-hooks.elc 141 * makefile.w32-in (lisp2): Fix references to vc/vc-hooks.elc
@@ -143,8 +281,7 @@
143 281
1442010-01-29 Kester Habermann <kester@linuxtag.org> (tiny change) 2822010-01-29 Kester Habermann <kester@linuxtag.org> (tiny change)
145 283
146 * etags.c (Fortran_functions): Handle recursive keyword 284 * etags.c (Fortran_functions): Handle recursive keyword (Bug#5484).
147 (Bug#5484).
148 285
1492010-01-11 Glenn Morris <rgm@gnu.org> 2862010-01-11 Glenn Morris <rgm@gnu.org>
150 287
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 264f14b1d49..9ad3c65afad 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -36,6 +36,9 @@ configuration=@configuration@
36EXEEXT=@EXEEXT@ 36EXEEXT=@EXEEXT@
37C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ 37C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
38C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ 38C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
39C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@
40PROFILING_CFLAGS = @PROFILING_CFLAGS@
41PROFILING_LDFLAGS = @PROFILING_LDFLAGS@
39 42
40# Program name transformation. 43# Program name transformation.
41TRANSFORM = @program_transform_name@ 44TRANSFORM = @program_transform_name@
@@ -165,12 +168,12 @@ LIBS_SYSTEM = @LIBS_SYSTEM@
165# Those files shared with other GNU utilities need HAVE_CONFIG_H 168# Those files shared with other GNU utilities need HAVE_CONFIG_H
166# defined before they know they can take advantage of the information 169# defined before they know they can take advantage of the information
167# in ../src/config.h. 170# in ../src/config.h.
168BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \ 171BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) ${C_WARNINGS_SWITCH} \
169 -I. -I../src -I${srcdir} -I${srcdir}/../src 172 -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src
170 173
171ALL_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} 174ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
172LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS} 175LINK_CFLAGS = ${BASE_CFLAGS} ${PROFILING_LDFLAGS} ${LDFLAGS} ${CFLAGS}
173CPP_CFLAGS = ${BASE_CFLAGS} ${CPPFLAGS} ${CFLAGS} 176CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
174 177
175LOADLIBES=$(LIBS_SYSTEM) 178LOADLIBES=$(LIBS_SYSTEM)
176 179
@@ -245,7 +248,7 @@ $(DESTDIR)${archlibdir}: all
245 chown ${gameuser} $(DESTDIR)${gamedir}; \ 248 chown ${gameuser} $(DESTDIR)${gamedir}; \
246 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ 249 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
247 fi 250 fi
248 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \ 251 if [ `(cd $(DESTDIR)${archlibdir} && /bin/pwd)` \
249 != `(cd ${srcdir} && /bin/pwd)` ]; then \ 252 != `(cd ${srcdir} && /bin/pwd)` ]; then \
250 for file in ${SCRIPTS}; do \ 253 for file in ${SCRIPTS}; do \
251 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \ 254 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
diff --git a/lib-src/b2m.c b/lib-src/b2m.c
index 7de48e6a522..733cd276653 100644
--- a/lib-src/b2m.c
+++ b/lib-src/b2m.c
@@ -64,12 +64,13 @@ struct linebuffer
64 char *buffer; 64 char *buffer;
65}; 65};
66 66
67extern char *strtok(); 67extern char *strtok(char *, const char *);
68 68
69long *xmalloc (), *xrealloc (); 69long *xmalloc (unsigned int size);
70char *concat (); 70long *xrealloc (char *ptr, unsigned int size);
71long readline (); 71char *concat (char *s1, char *s2, char *s3);
72void fatal (); 72long readline (struct linebuffer *linebuffer, register FILE *stream);
73void fatal (char *message);
73 74
74/* 75/*
75 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type); 76 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type);
@@ -90,9 +91,7 @@ struct option longopts[] =
90extern int optind; 91extern int optind;
91 92
92int 93int
93main (argc, argv) 94main (int argc, char **argv)
94 int argc;
95 char **argv;
96{ 95{
97 logical labels_saved, printing, header, first, last_was_blank_line; 96 logical labels_saved, printing, header, first, last_was_blank_line;
98 time_t ltoday; 97 time_t ltoday;
@@ -219,8 +218,7 @@ main (argc, argv)
219 * concatenate those of s1, s2, s3. 218 * concatenate those of s1, s2, s3.
220 */ 219 */
221char * 220char *
222concat (s1, s2, s3) 221concat (char *s1, char *s2, char *s3)
223 char *s1, *s2, *s3;
224{ 222{
225 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); 223 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
226 char *result = xnew (len1 + len2 + len3 + 1, char); 224 char *result = xnew (len1 + len2 + len3 + 1, char);
@@ -239,9 +237,7 @@ concat (s1, s2, s3)
239 * which is the length of the line including the newline, if any. 237 * which is the length of the line including the newline, if any.
240 */ 238 */
241long 239long
242readline (linebuffer, stream) 240readline (struct linebuffer *linebuffer, register FILE *stream)
243 struct linebuffer *linebuffer;
244 register FILE *stream;
245{ 241{
246 char *buffer = linebuffer->buffer; 242 char *buffer = linebuffer->buffer;
247 register char *p = linebuffer->buffer; 243 register char *p = linebuffer->buffer;
@@ -291,8 +287,7 @@ readline (linebuffer, stream)
291 * Like malloc but get fatal error if memory is exhausted. 287 * Like malloc but get fatal error if memory is exhausted.
292 */ 288 */
293long * 289long *
294xmalloc (size) 290xmalloc (unsigned int size)
295 unsigned int size;
296{ 291{
297 long *result = (long *) malloc (size); 292 long *result = (long *) malloc (size);
298 if (result == NULL) 293 if (result == NULL)
@@ -301,9 +296,7 @@ xmalloc (size)
301} 296}
302 297
303long * 298long *
304xrealloc (ptr, size) 299xrealloc (char *ptr, unsigned int size)
305 char *ptr;
306 unsigned int size;
307{ 300{
308 long *result = (long *) realloc (ptr, size); 301 long *result = (long *) realloc (ptr, size);
309 if (result == NULL) 302 if (result == NULL)
@@ -312,8 +305,7 @@ xrealloc (ptr, size)
312} 305}
313 306
314void 307void
315fatal (message) 308fatal (char *message)
316 char *message;
317{ 309{
318 fprintf (stderr, "%s: %s\n", progname, message); 310 fprintf (stderr, "%s: %s\n", progname, message);
319 exit (EXIT_FAILURE); 311 exit (EXIT_FAILURE);
diff --git a/lib-src/digest-doc.c b/lib-src/digest-doc.c
index d8c6e620a19..b3cb58e6d99 100644
--- a/lib-src/digest-doc.c
+++ b/lib-src/digest-doc.c
@@ -31,7 +31,7 @@ but in texinfo format and sorted by function/variable name. */
31#endif 31#endif
32 32
33int 33int
34main () 34main (void)
35{ 35{
36 register int ch; 36 register int ch;
37 register int notfirst = 0; 37 register int notfirst = 0;
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index b51b4aa6965..a9f7ba4f3a7 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -20,20 +20,14 @@ You should have received a copy of the GNU General Public License
20along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 20along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21 21
22 22
23#ifdef HAVE_CONFIG_H
24#include <config.h> 23#include <config.h>
25#endif
26
27#include <stdio.h> 24#include <stdio.h>
28 25
29#ifdef HAVE_STDLIB_H 26#ifdef HAVE_STDLIB_H
30#include <stdlib.h> 27#include <stdlib.h>
31#endif 28#endif
32 29
33#ifdef HAVE_STRING_H
34#include <string.h> 30#include <string.h>
35#endif
36
37#include <ctype.h> 31#include <ctype.h>
38#include <assert.h> 32#include <assert.h>
39#include "getopt.h" 33#include "getopt.h"
@@ -45,12 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45 39
46/* Conditionalize function prototypes. */ 40/* Conditionalize function prototypes. */
47 41
48#ifdef PROTOTYPES /* From config.h. */
49#define P_(x) x
50#else
51#define P_(x) ()
52#endif
53
54/* Value is non-zero if strings X and Y compare equal. */ 42/* Value is non-zero if strings X and Y compare equal. */
55 43
56#define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0) 44#define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0)
@@ -479,62 +467,62 @@ struct search_path *search_path_tail;
479 467
480/* Function prototypes. */ 468/* Function prototypes. */
481 469
482int yylex P_ ((void)); 470int yylex (void);
483void yyparse P_ ((void)); 471void yyparse (void);
484void re_init_parser P_ ((void)); 472void re_init_parser (void);
485char *token_string P_ ((int)); 473char *token_string (int);
486char *matching_regexp P_ ((void)); 474char *matching_regexp (void);
487void init_sym P_ ((void)); 475void init_sym (void);
488struct sym *add_sym P_ ((char *, struct sym *)); 476struct sym *add_sym (char *, struct sym *);
489void add_link P_ ((struct sym *, struct sym *)); 477void add_link (struct sym *, struct sym *);
490void add_member_defn P_ ((struct sym *, char *, char *, 478void add_member_defn (struct sym *, char *, char *,
491 int, unsigned, int, int, int)); 479 int, unsigned, int, int, int);
492void add_member_decl P_ ((struct sym *, char *, char *, int, 480void add_member_decl (struct sym *, char *, char *, int,
493 unsigned, int, int, int, int)); 481 unsigned, int, int, int, int);
494void dump_roots P_ ((FILE *)); 482void dump_roots (FILE *);
495void *xmalloc P_ ((int)); 483void *xmalloc (int);
496void xfree P_ ((void *)); 484void xfree (void *);
497void add_global_defn P_ ((char *, char *, int, unsigned, int, int, int)); 485void add_global_defn (char *, char *, int, unsigned, int, int, int);
498void add_global_decl P_ ((char *, char *, int, unsigned, int, int, int)); 486void add_global_decl (char *, char *, int, unsigned, int, int, int);
499void add_define P_ ((char *, char *, int)); 487void add_define (char *, char *, int);
500void mark_inherited_virtual P_ ((void)); 488void mark_inherited_virtual (void);
501void leave_namespace P_ ((void)); 489void leave_namespace (void);
502void enter_namespace P_ ((char *)); 490void enter_namespace (char *);
503void register_namespace_alias P_ ((char *, struct link *)); 491void register_namespace_alias (char *, struct link *);
504void insert_keyword P_ ((char *, int)); 492void insert_keyword (char *, int);
505void re_init_scanner P_ ((void)); 493void re_init_scanner (void);
506void init_scanner P_ ((void)); 494void init_scanner (void);
507void usage P_ ((int)); 495void usage (int);
508void version P_ ((void)); 496void version (void);
509void process_file P_ ((char *)); 497void process_file (char *);
510void add_search_path P_ ((char *)); 498void add_search_path (char *);
511FILE *open_file P_ ((char *)); 499FILE *open_file (char *);
512int process_pp_line P_ ((void)); 500int process_pp_line (void);
513int dump_members P_ ((FILE *, struct member *)); 501int dump_members (FILE *, struct member *);
514void dump_sym P_ ((FILE *, struct sym *)); 502void dump_sym (FILE *, struct sym *);
515int dump_tree P_ ((FILE *, struct sym *)); 503int dump_tree (FILE *, struct sym *);
516struct member *find_member P_ ((struct sym *, char *, int, int, unsigned)); 504struct member *find_member (struct sym *, char *, int, int, unsigned);
517struct member *add_member P_ ((struct sym *, char *, int, int, unsigned)); 505struct member *add_member (struct sym *, char *, int, int, unsigned);
518void mark_virtual P_ ((struct sym *)); 506void mark_virtual (struct sym *);
519void mark_virtual P_ ((struct sym *)); 507void mark_virtual (struct sym *);
520struct sym *make_namespace P_ ((char *, struct sym *)); 508struct sym *make_namespace (char *, struct sym *);
521char *sym_scope P_ ((struct sym *)); 509char *sym_scope (struct sym *);
522char *sym_scope_1 P_ ((struct sym *)); 510char *sym_scope_1 (struct sym *);
523int skip_to P_ ((int)); 511int skip_to (int);
524void skip_matching P_ ((void)); 512void skip_matching (void);
525void member P_ ((struct sym *, int)); 513void member (struct sym *, int);
526void class_body P_ ((struct sym *, int)); 514void class_body (struct sym *, int);
527void class_definition P_ ((struct sym *, int, int, int)); 515void class_definition (struct sym *, int, int, int);
528void declaration P_ ((int)); 516void declaration (int);
529unsigned parm_list P_ ((int *)); 517unsigned parm_list (int *);
530char *operator_name P_ ((int *)); 518char *operator_name (int *);
531struct sym *parse_classname P_ ((void)); 519struct sym *parse_classname (void);
532struct sym *parse_qualified_ident_or_type P_ ((char **)); 520struct sym *parse_qualified_ident_or_type (char **);
533void parse_qualified_param_ident_or_type P_ ((char **)); 521void parse_qualified_param_ident_or_type (char **);
534int globals P_ ((int)); 522int globals (int);
535void yyerror P_ ((char *, char *)); 523void yyerror (char *, char *);
536void usage P_ ((int)) NO_RETURN; 524void usage (int) NO_RETURN;
537void version P_ (()) NO_RETURN; 525void version (void) NO_RETURN;
538 526
539 527
540 528
@@ -546,8 +534,7 @@ void version P_ (()) NO_RETURN;
546 name and line number. */ 534 name and line number. */
547 535
548void 536void
549yyerror (format, s) 537yyerror (char *format, char *s)
550 char *format, *s;
551{ 538{
552 fprintf (stderr, "%s:%d: ", filename, yyline); 539 fprintf (stderr, "%s:%d: ", filename, yyline);
553 fprintf (stderr, format, s); 540 fprintf (stderr, format, s);
@@ -559,8 +546,7 @@ yyerror (format, s)
559 available. */ 546 available. */
560 547
561void * 548void *
562xmalloc (nbytes) 549xmalloc (int nbytes)
563 int nbytes;
564{ 550{
565 void *p = malloc (nbytes); 551 void *p = malloc (nbytes);
566 if (p == NULL) 552 if (p == NULL)
@@ -575,9 +561,7 @@ xmalloc (nbytes)
575/* Like realloc but print an error and exit if out of memory. */ 561/* Like realloc but print an error and exit if out of memory. */
576 562
577void * 563void *
578xrealloc (p, sz) 564xrealloc (void *p, int sz)
579 void *p;
580 int sz;
581{ 565{
582 p = realloc (p, sz); 566 p = realloc (p, sz);
583 if (p == NULL) 567 if (p == NULL)
@@ -593,8 +577,7 @@ xrealloc (p, sz)
593 available.. If S is null, return null. */ 577 available.. If S is null, return null. */
594 578
595char * 579char *
596xstrdup (s) 580xstrdup (char *s)
597 char *s;
598{ 581{
599 if (s) 582 if (s)
600 s = strcpy (xmalloc (strlen (s) + 1), s); 583 s = strcpy (xmalloc (strlen (s) + 1), s);
@@ -611,7 +594,7 @@ xstrdup (s)
611 special symbol for globals (`*Globals*'). */ 594 special symbol for globals (`*Globals*'). */
612 595
613void 596void
614init_sym () 597init_sym (void)
615{ 598{
616 global_symbols = add_sym (GLOBALS_NAME, NULL); 599 global_symbols = add_sym (GLOBALS_NAME, NULL);
617} 600}
@@ -625,9 +608,7 @@ init_sym ()
625 create a new symbol and set it to default values. */ 608 create a new symbol and set it to default values. */
626 609
627struct sym * 610struct sym *
628add_sym (name, nested_in_class) 611add_sym (char *name, struct sym *nested_in_class)
629 char *name;
630 struct sym *nested_in_class;
631{ 612{
632 struct sym *sym; 613 struct sym *sym;
633 unsigned h; 614 unsigned h;
@@ -654,7 +635,7 @@ add_sym (name, nested_in_class)
654 } 635 }
655 636
656 sym = (struct sym *) xmalloc (sizeof *sym + strlen (name)); 637 sym = (struct sym *) xmalloc (sizeof *sym + strlen (name));
657 bzero (sym, sizeof *sym); 638 memset (sym, 0, sizeof *sym);
658 strcpy (sym->name, name); 639 strcpy (sym->name, name);
659 sym->namesp = scope; 640 sym->namesp = scope;
660 sym->next = class_table[h]; 641 sym->next = class_table[h];
@@ -668,8 +649,7 @@ add_sym (name, nested_in_class)
668/* Add links between superclass SUPER and subclass SUB. */ 649/* Add links between superclass SUPER and subclass SUB. */
669 650
670void 651void
671add_link (super, sub) 652add_link (struct sym *super, struct sym *sub)
672 struct sym *super, *sub;
673{ 653{
674 struct link *lnk, *lnk2, *p, *prev; 654 struct link *lnk, *lnk2, *p, *prev;
675 655
@@ -709,11 +689,7 @@ add_link (super, sub)
709 found or null if not found. */ 689 found or null if not found. */
710 690
711struct member * 691struct member *
712find_member (cls, name, var, sc, hash) 692find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
713 struct sym *cls;
714 char *name;
715 int var, sc;
716 unsigned hash;
717{ 693{
718 struct member **list; 694 struct member **list;
719 struct member *p; 695 struct member *p;
@@ -763,16 +739,7 @@ find_member (cls, name, var, sc, hash)
763 F_* defines). */ 739 F_* defines). */
764 740
765void 741void
766add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags) 742add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags)
767 struct sym *cls;
768 char *name;
769 char *regexp;
770 int pos;
771 unsigned hash;
772 int var;
773 int sc;
774 int vis;
775 int flags;
776{ 743{
777 struct member *m; 744 struct member *m;
778 745
@@ -820,15 +787,7 @@ add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags)
820 F_* defines). */ 787 F_* defines). */
821 788
822void 789void
823add_member_defn (cls, name, regexp, pos, hash, var, sc, flags) 790add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
824 struct sym *cls;
825 char *name;
826 char *regexp;
827 int pos;
828 unsigned hash;
829 int var;
830 int sc;
831 int flags;
832{ 791{
833 struct member *m; 792 struct member *m;
834 793
@@ -870,9 +829,7 @@ add_member_defn (cls, name, regexp, pos, hash, var, sc, flags)
870 if it is non-null. POS is the position in the file. */ 829 if it is non-null. POS is the position in the file. */
871 830
872void 831void
873add_define (name, regexp, pos) 832add_define (char *name, char *regexp, int pos)
874 char *name, *regexp;
875 int pos;
876{ 833{
877 add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); 834 add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
878 add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); 835 add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
@@ -890,13 +847,7 @@ add_define (name, regexp, pos)
890 F_* defines). */ 847 F_* defines). */
891 848
892void 849void
893add_global_defn (name, regexp, pos, hash, var, sc, flags) 850add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
894 char *name, *regexp;
895 int pos;
896 unsigned hash;
897 int var;
898 int sc;
899 int flags;
900{ 851{
901 int i; 852 int i;
902 struct sym *sym; 853 struct sym *sym;
@@ -927,13 +878,7 @@ add_global_defn (name, regexp, pos, hash, var, sc, flags)
927 F_* defines). */ 878 F_* defines). */
928 879
929void 880void
930add_global_decl (name, regexp, pos, hash, var, sc, flags) 881add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
931 char *name, *regexp;
932 int pos;
933 unsigned hash;
934 int var;
935 int sc;
936 int flags;
937{ 882{
938 /* Add declaration only if not already declared. Header files must 883 /* Add declaration only if not already declared. Header files must
939 be processed before source files for this to have the right effect. 884 be processed before source files for this to have the right effect.
@@ -972,12 +917,7 @@ add_global_decl (name, regexp, pos, hash, var, sc, flags)
972 Value is a pointer to the member's structure. */ 917 Value is a pointer to the member's structure. */
973 918
974struct member * 919struct member *
975add_member (cls, name, var, sc, hash) 920add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
976 struct sym *cls;
977 char *name;
978 int var;
979 int sc;
980 unsigned hash;
981{ 921{
982 struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name)); 922 struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name));
983 struct member **list; 923 struct member **list;
@@ -1048,8 +988,7 @@ add_member (cls, name, var, sc, hash)
1048 in base classes. */ 988 in base classes. */
1049 989
1050void 990void
1051mark_virtual (r) 991mark_virtual (struct sym *r)
1052 struct sym *r;
1053{ 992{
1054 struct link *p; 993 struct link *p;
1055 struct member *m, *m2; 994 struct member *m, *m2;
@@ -1073,7 +1012,7 @@ mark_virtual (r)
1073 are virtual because of a virtual declaration in a base class. */ 1012 are virtual because of a virtual declaration in a base class. */
1074 1013
1075void 1014void
1076mark_inherited_virtual () 1015mark_inherited_virtual (void)
1077{ 1016{
1078 struct sym *r; 1017 struct sym *r;
1079 int i; 1018 int i;
@@ -1088,12 +1027,10 @@ mark_inherited_virtual ()
1088/* Create and return a symbol for a namespace with name NAME. */ 1027/* Create and return a symbol for a namespace with name NAME. */
1089 1028
1090struct sym * 1029struct sym *
1091make_namespace (name, context) 1030make_namespace (char *name, struct sym *context)
1092 char *name;
1093 struct sym *context;
1094{ 1031{
1095 struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); 1032 struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name));
1096 bzero (s, sizeof *s); 1033 memset (s, 0, sizeof *s);
1097 strcpy (s->name, name); 1034 strcpy (s->name, name);
1098 s->next = all_namespaces; 1035 s->next = all_namespaces;
1099 s->namesp = context; 1036 s->namesp = context;
@@ -1105,9 +1042,7 @@ make_namespace (name, context)
1105/* Find the symbol for namespace NAME. If not found, retrun NULL */ 1042/* Find the symbol for namespace NAME. If not found, retrun NULL */
1106 1043
1107struct sym * 1044struct sym *
1108check_namespace (name, context) 1045check_namespace (char *name, struct sym *context)
1109 char *name;
1110 struct sym *context;
1111{ 1046{
1112 struct sym *p = NULL; 1047 struct sym *p = NULL;
1113 1048
@@ -1115,18 +1050,16 @@ check_namespace (name, context)
1115 { 1050 {
1116 if (streq (p->name, name) && (p->namesp == context)) 1051 if (streq (p->name, name) && (p->namesp == context))
1117 break; 1052 break;
1118 } 1053 }
1119 1054
1120 return p; 1055 return p;
1121 } 1056}
1122 1057
1123/* Find the symbol for namespace NAME. If not found, add a new symbol 1058/* Find the symbol for namespace NAME. If not found, add a new symbol
1124 for NAME to all_namespaces. */ 1059 for NAME to all_namespaces. */
1125 1060
1126struct sym * 1061struct sym *
1127find_namespace (name, context) 1062find_namespace (char *name, struct sym *context)
1128 char *name;
1129 struct sym *context;
1130{ 1063{
1131 struct sym *p = check_namespace (name, context); 1064 struct sym *p = check_namespace (name, context);
1132 1065
@@ -1140,8 +1073,7 @@ find_namespace (name, context)
1140/* Find namespace alias with name NAME. If not found return NULL. */ 1073/* Find namespace alias with name NAME. If not found return NULL. */
1141 1074
1142struct link * 1075struct link *
1143check_namespace_alias (name) 1076check_namespace_alias (char *name)
1144 char *name;
1145{ 1077{
1146 struct link *p = NULL; 1078 struct link *p = NULL;
1147 struct alias *al; 1079 struct alias *al;
@@ -1165,9 +1097,7 @@ check_namespace_alias (name)
1165/* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */ 1097/* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */
1166 1098
1167void 1099void
1168register_namespace_alias (new_name, old_name) 1100register_namespace_alias (char *new_name, struct link *old_name)
1169 char *new_name;
1170 struct link *old_name;
1171{ 1101{
1172 unsigned h; 1102 unsigned h;
1173 char *s; 1103 char *s;
@@ -1195,8 +1125,7 @@ register_namespace_alias (new_name, old_name)
1195/* Enter namespace with name NAME. */ 1125/* Enter namespace with name NAME. */
1196 1126
1197void 1127void
1198enter_namespace (name) 1128enter_namespace (char *name)
1199 char *name;
1200{ 1129{
1201 struct sym *p = find_namespace (name, current_namespace); 1130 struct sym *p = find_namespace (name, current_namespace);
1202 1131
@@ -1217,7 +1146,7 @@ enter_namespace (name)
1217/* Leave the current namespace. */ 1146/* Leave the current namespace. */
1218 1147
1219void 1148void
1220leave_namespace () 1149leave_namespace (void)
1221{ 1150{
1222 assert (namespace_sp > 0); 1151 assert (namespace_sp > 0);
1223 current_namespace = namespace_stack[--namespace_sp]; 1152 current_namespace = namespace_stack[--namespace_sp];
@@ -1259,8 +1188,7 @@ int scope_buffer_len;
1259/* Make sure scope_buffer has enough room to add LEN chars to it. */ 1188/* Make sure scope_buffer has enough room to add LEN chars to it. */
1260 1189
1261void 1190void
1262ensure_scope_buffer_room (len) 1191ensure_scope_buffer_room (int len)
1263 int len;
1264{ 1192{
1265 if (scope_buffer_len + len >= scope_buffer_size) 1193 if (scope_buffer_len + len >= scope_buffer_size)
1266 { 1194 {
@@ -1276,8 +1204,7 @@ ensure_scope_buffer_room (len)
1276 scope name constructed. */ 1204 scope name constructed. */
1277 1205
1278char * 1206char *
1279sym_scope_1 (p) 1207sym_scope_1 (struct sym *p)
1280 struct sym *p;
1281{ 1208{
1282 int len; 1209 int len;
1283 1210
@@ -1311,8 +1238,7 @@ sym_scope_1 (p)
1311 as it would appear in a C*+ source file. */ 1238 as it would appear in a C*+ source file. */
1312 1239
1313char * 1240char *
1314sym_scope (p) 1241sym_scope (struct sym *p)
1315 struct sym *p;
1316{ 1242{
1317 if (!scope_buffer) 1243 if (!scope_buffer)
1318 { 1244 {
@@ -1334,9 +1260,7 @@ sym_scope (p)
1334 list. */ 1260 list. */
1335 1261
1336int 1262int
1337dump_members (fp, m) 1263dump_members (FILE *fp, struct member *m)
1338 FILE *fp;
1339 struct member *m;
1340{ 1264{
1341 int n; 1265 int n;
1342 1266
@@ -1369,9 +1293,7 @@ dump_members (fp, m)
1369/* Dump class ROOT to stream FP. */ 1293/* Dump class ROOT to stream FP. */
1370 1294
1371void 1295void
1372dump_sym (fp, root) 1296dump_sym (FILE *fp, struct sym *root)
1373 FILE *fp;
1374 struct sym *root;
1375{ 1297{
1376 fputs (CLASS_STRUCT, fp); 1298 fputs (CLASS_STRUCT, fp);
1377 PUTSTR (root->name, fp); 1299 PUTSTR (root->name, fp);
@@ -1397,9 +1319,7 @@ dump_sym (fp, root)
1397 number of classes written. */ 1319 number of classes written. */
1398 1320
1399int 1321int
1400dump_tree (fp, root) 1322dump_tree (FILE *fp, struct sym *root)
1401 FILE *fp;
1402 struct sym *root;
1403{ 1323{
1404 struct link *lk; 1324 struct link *lk;
1405 unsigned n = 0; 1325 unsigned n = 0;
@@ -1446,8 +1366,7 @@ dump_tree (fp, root)
1446/* Dump the entire class tree to file FP. */ 1366/* Dump the entire class tree to file FP. */
1447 1367
1448void 1368void
1449dump_roots (fp) 1369dump_roots (FILE *fp)
1450 FILE *fp;
1451{ 1370{
1452 int i, n = 0; 1371 int i, n = 0;
1453 struct sym *r; 1372 struct sym *r;
@@ -1521,7 +1440,7 @@ do { \
1521 input buffer not consumed. */ 1440 input buffer not consumed. */
1522 1441
1523int 1442int
1524process_pp_line () 1443process_pp_line (void)
1525{ 1444{
1526 int in_comment = 0, in_string = 0; 1445 int in_comment = 0, in_string = 0;
1527 int c; 1446 int c;
@@ -1592,7 +1511,7 @@ process_pp_line ()
1592/* Value is the next token from the input buffer. */ 1511/* Value is the next token from the input buffer. */
1593 1512
1594int 1513int
1595yylex () 1514yylex (void)
1596{ 1515{
1597 int c; 1516 int c;
1598 char end_char; 1517 char end_char;
@@ -2009,7 +1928,7 @@ static char *matching_regexp_buffer, *matching_regexp_end_buf;
2009 shorter than min_regexp. */ 1928 shorter than min_regexp. */
2010 1929
2011char * 1930char *
2012matching_regexp () 1931matching_regexp (void)
2013{ 1932{
2014 char *p; 1933 char *p;
2015 char *s; 1934 char *s;
@@ -2060,8 +1979,7 @@ matching_regexp ()
2060/* Return a printable representation of token T. */ 1979/* Return a printable representation of token T. */
2061 1980
2062char * 1981char *
2063token_string (t) 1982token_string (int t)
2064 int t;
2065{ 1983{
2066 static char b[3]; 1984 static char b[3];
2067 1985
@@ -2178,7 +2096,7 @@ token_string (t)
2178/* Reinitialize the scanner for a new input file. */ 2096/* Reinitialize the scanner for a new input file. */
2179 2097
2180void 2098void
2181re_init_scanner () 2099re_init_scanner (void)
2182{ 2100{
2183 in = inbuffer; 2101 in = inbuffer;
2184 yyline = 1; 2102 yyline = 1;
@@ -2196,9 +2114,7 @@ re_init_scanner ()
2196 table. */ 2114 table. */
2197 2115
2198void 2116void
2199insert_keyword (name, tk) 2117insert_keyword (char *name, int tk)
2200 char *name;
2201 int tk;
2202{ 2118{
2203 char *s; 2119 char *s;
2204 unsigned h = 0; 2120 unsigned h = 0;
@@ -2219,7 +2135,7 @@ insert_keyword (name, tk)
2219 character class vectors and fills the keyword hash table. */ 2135 character class vectors and fills the keyword hash table. */
2220 2136
2221void 2137void
2222init_scanner () 2138init_scanner (void)
2223{ 2139{
2224 int i; 2140 int i;
2225 2141
@@ -2363,8 +2279,7 @@ init_scanner ()
2363 the current lookahead token after skipping. */ 2279 the current lookahead token after skipping. */
2364 2280
2365int 2281int
2366skip_to (token) 2282skip_to (int token)
2367 int token;
2368{ 2283{
2369 while (!LOOKING_AT2 (YYEOF, token)) 2284 while (!LOOKING_AT2 (YYEOF, token))
2370 MATCH (); 2285 MATCH ();
@@ -2375,7 +2290,7 @@ skip_to (token)
2375 angle brackets, curly brackets) matching the current lookahead. */ 2290 angle brackets, curly brackets) matching the current lookahead. */
2376 2291
2377void 2292void
2378skip_matching () 2293skip_matching (void)
2379{ 2294{
2380 int open, close, n; 2295 int open, close, n;
2381 2296
@@ -2418,7 +2333,7 @@ skip_matching ()
2418} 2333}
2419 2334
2420void 2335void
2421skip_initializer () 2336skip_initializer (void)
2422{ 2337{
2423 for (;;) 2338 for (;;)
2424 { 2339 {
@@ -2445,7 +2360,7 @@ skip_initializer ()
2445/* Build qualified namespace alias (A::B::c) and return it. */ 2360/* Build qualified namespace alias (A::B::c) and return it. */
2446 2361
2447struct link * 2362struct link *
2448match_qualified_namespace_alias () 2363match_qualified_namespace_alias (void)
2449{ 2364{
2450 struct link *head = NULL; 2365 struct link *head = NULL;
2451 struct link *cur = NULL; 2366 struct link *cur = NULL;
@@ -2458,7 +2373,7 @@ match_qualified_namespace_alias ()
2458 { 2373 {
2459 case IDENT: 2374 case IDENT:
2460 tmp = (struct link *) xmalloc (sizeof *cur); 2375 tmp = (struct link *) xmalloc (sizeof *cur);
2461 tmp->sym = find_namespace (yytext, cur); 2376 tmp->sym = find_namespace (yytext, cur ? cur->sym : NULL);
2462 tmp->next = NULL; 2377 tmp->next = NULL;
2463 if (head) 2378 if (head)
2464 { 2379 {
@@ -2482,7 +2397,7 @@ match_qualified_namespace_alias ()
2482/* Re-initialize the parser by resetting the lookahead token. */ 2397/* Re-initialize the parser by resetting the lookahead token. */
2483 2398
2484void 2399void
2485re_init_parser () 2400re_init_parser (void)
2486{ 2401{
2487 tk = -1; 2402 tk = -1;
2488} 2403}
@@ -2495,8 +2410,7 @@ re_init_parser ()
2495 distinguish between overloaded functions. */ 2410 distinguish between overloaded functions. */
2496 2411
2497unsigned 2412unsigned
2498parm_list (flags) 2413parm_list (int *flags)
2499 int *flags;
2500{ 2414{
2501 unsigned hash = 0; 2415 unsigned hash = 0;
2502 int type_seen = 0; 2416 int type_seen = 0;
@@ -2609,7 +2523,7 @@ parm_list (flags)
2609/* Print position info to stdout. */ 2523/* Print position info to stdout. */
2610 2524
2611void 2525void
2612print_info () 2526print_info (void)
2613{ 2527{
2614 if (info_position >= 0 && BUFFER_POS () <= info_position) 2528 if (info_position >= 0 && BUFFER_POS () <= info_position)
2615 if (info_cls) 2529 if (info_cls)
@@ -2624,9 +2538,7 @@ print_info ()
2624 public). */ 2538 public). */
2625 2539
2626void 2540void
2627member (cls, vis) 2541member (struct sym *cls, int vis)
2628 struct sym *cls;
2629 int vis;
2630{ 2542{
2631 char *id = NULL; 2543 char *id = NULL;
2632 int sc = SC_MEMBER; 2544 int sc = SC_MEMBER;
@@ -2835,9 +2747,7 @@ member (cls, vis)
2835 union, class). */ 2747 union, class). */
2836 2748
2837void 2749void
2838class_body (cls, tag) 2750class_body (struct sym *cls, int tag)
2839 struct sym *cls;
2840 int tag;
2841{ 2751{
2842 int vis = tag == CLASS ? PRIVATE : PUBLIC; 2752 int vis = tag == CLASS ? PRIVATE : PUBLIC;
2843 int temp; 2753 int temp;
@@ -2898,7 +2808,7 @@ class_body (cls, tag)
2898 symbol for that class. */ 2808 symbol for that class. */
2899 2809
2900struct sym * 2810struct sym *
2901parse_classname () 2811parse_classname (void)
2902{ 2812{
2903 struct sym *last_class = NULL; 2813 struct sym *last_class = NULL;
2904 2814
@@ -2928,8 +2838,7 @@ parse_classname ()
2928 a static buffer holding the constructed operator name string. */ 2838 a static buffer holding the constructed operator name string. */
2929 2839
2930char * 2840char *
2931operator_name (sc) 2841operator_name (int *sc)
2932 int *sc;
2933{ 2842{
2934 static int id_size = 0; 2843 static int id_size = 0;
2935 static char *id = NULL; 2844 static char *id = NULL;
@@ -3019,8 +2928,7 @@ operator_name (sc)
3019 symbol structure for the ident. */ 2928 symbol structure for the ident. */
3020 2929
3021struct sym * 2930struct sym *
3022parse_qualified_ident_or_type (last_id) 2931parse_qualified_ident_or_type (char **last_id)
3023 char **last_id;
3024{ 2932{
3025 struct sym *cls = NULL; 2933 struct sym *cls = NULL;
3026 char *id = NULL; 2934 char *id = NULL;
@@ -3085,8 +2993,7 @@ parse_qualified_ident_or_type (last_id)
3085 symbol structure for the ident. */ 2993 symbol structure for the ident. */
3086 2994
3087void 2995void
3088parse_qualified_param_ident_or_type (last_id) 2996parse_qualified_param_ident_or_type (char **last_id)
3089 char **last_id;
3090{ 2997{
3091 struct sym *cls = NULL; 2998 struct sym *cls = NULL;
3092 static char *id = NULL; 2999 static char *id = NULL;
@@ -3128,11 +3035,7 @@ parse_qualified_param_ident_or_type (last_id)
3128 Current lookahead is the class name. */ 3035 Current lookahead is the class name. */
3129 3036
3130void 3037void
3131class_definition (containing, tag, flags, nested) 3038class_definition (struct sym *containing, int tag, int flags, int nested)
3132 struct sym *containing;
3133 int tag;
3134 int flags;
3135 int nested;
3136{ 3039{
3137 struct sym *current; 3040 struct sym *current;
3138 struct sym *base_class; 3041 struct sym *base_class;
@@ -3229,10 +3132,7 @@ class_definition (containing, tag, flags, nested)
3229 information about the member (see the F_* defines). */ 3132 information about the member (see the F_* defines). */
3230 3133
3231void 3134void
3232add_declarator (cls, id, flags, sc) 3135add_declarator (struct sym **cls, char **id, int flags, int sc)
3233 struct sym **cls;
3234 char **id;
3235 int flags, sc;
3236{ 3136{
3237 if (LOOKING_AT2 (';', ',')) 3137 if (LOOKING_AT2 (';', ','))
3238 { 3138 {
@@ -3275,8 +3175,7 @@ add_declarator (cls, id, flags, sc)
3275/* Parse a declaration. */ 3175/* Parse a declaration. */
3276 3176
3277void 3177void
3278declaration (flags) 3178declaration (int flags)
3279 int flags;
3280{ 3179{
3281 char *id = NULL; 3180 char *id = NULL;
3282 struct sym *cls = NULL; 3181 struct sym *cls = NULL;
@@ -3430,8 +3329,7 @@ declaration (flags)
3430 otherwise. */ 3329 otherwise. */
3431 3330
3432int 3331int
3433globals (start_flags) 3332globals (int start_flags)
3434 int start_flags;
3435{ 3333{
3436 int anonymous; 3334 int anonymous;
3437 int class_tk; 3335 int class_tk;
@@ -3549,7 +3447,7 @@ globals (start_flags)
3549/* Parse the current input file. */ 3447/* Parse the current input file. */
3550 3448
3551void 3449void
3552yyparse () 3450yyparse (void)
3553{ 3451{
3554 while (globals (0) == 0) 3452 while (globals (0) == 0)
3555 MATCH_IF ('}'); 3453 MATCH_IF ('}');
@@ -3565,8 +3463,7 @@ yyparse ()
3565 input files. */ 3463 input files. */
3566 3464
3567void 3465void
3568add_search_path (path_list) 3466add_search_path (char *path_list)
3569 char *path_list;
3570{ 3467{
3571 while (*path_list) 3468 while (*path_list)
3572 { 3469 {
@@ -3601,8 +3498,7 @@ add_search_path (path_list)
3601 unchanged file name. */ 3498 unchanged file name. */
3602 3499
3603FILE * 3500FILE *
3604open_file (file) 3501open_file (char *file)
3605 char *file;
3606{ 3502{
3607 FILE *fp = NULL; 3503 FILE *fp = NULL;
3608 static char *buffer; 3504 static char *buffer;
@@ -3661,8 +3557,7 @@ Usage: ebrowse [options] {files}\n\
3661" 3557"
3662 3558
3663void 3559void
3664usage (error) 3560usage (int error)
3665 int error;
3666{ 3561{
3667 puts (USAGE); 3562 puts (USAGE);
3668 exit (error ? EXIT_FAILURE : EXIT_SUCCESS); 3563 exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
@@ -3677,7 +3572,7 @@ usage (error)
3677#endif 3572#endif
3678 3573
3679void 3574void
3680version () 3575version (void)
3681{ 3576{
3682 /* Makes it easier to update automatically. */ 3577 /* Makes it easier to update automatically. */
3683 char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; 3578 char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
@@ -3693,8 +3588,7 @@ version ()
3693 table. */ 3588 table. */
3694 3589
3695void 3590void
3696process_file (file) 3591process_file (char *file)
3697 char *file;
3698{ 3592{
3699 FILE *fp; 3593 FILE *fp;
3700 3594
@@ -3749,8 +3643,7 @@ process_file (file)
3749 is null when EOF is reached. */ 3643 is null when EOF is reached. */
3750 3644
3751char * 3645char *
3752read_line (fp) 3646read_line (FILE *fp)
3753 FILE *fp;
3754{ 3647{
3755 static char *buffer; 3648 static char *buffer;
3756 static int buffer_size; 3649 static int buffer_size;
@@ -3786,9 +3679,7 @@ read_line (fp)
3786/* Main entry point. */ 3679/* Main entry point. */
3787 3680
3788int 3681int
3789main (argc, argv) 3682main (int argc, char **argv)
3790 int argc;
3791 char **argv;
3792{ 3683{
3793 int i; 3684 int i;
3794 int any_inputfiles = 0; 3685 int any_inputfiles = 0;
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 3172ebb8cd1..bafc7e02720 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -81,7 +81,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
81#include <errno.h> 81#include <errno.h>
82 82
83 83
84char *getenv (), *getwd (); 84char *getenv (const char *), *getwd (char *);
85char *(getcwd) (); 85char *(getcwd) ();
86 86
87#ifdef WINDOWSNT 87#ifdef WINDOWSNT
@@ -157,7 +157,7 @@ char *server_file = NULL;
157/* PID of the Emacs server process. */ 157/* PID of the Emacs server process. */
158int emacs_pid = 0; 158int emacs_pid = 0;
159 159
160void print_help_and_exit () NO_RETURN; 160void print_help_and_exit (void) NO_RETURN;
161 161
162struct option longopts[] = 162struct option longopts[] =
163{ 163{
@@ -184,8 +184,7 @@ struct option longopts[] =
184/* Like malloc but get fatal error if memory is exhausted. */ 184/* Like malloc but get fatal error if memory is exhausted. */
185 185
186long * 186long *
187xmalloc (size) 187xmalloc (unsigned int size)
188 unsigned int size;
189{ 188{
190 long *result = (long *) malloc (size); 189 long *result = (long *) malloc (size);
191 if (result == NULL) 190 if (result == NULL)
@@ -236,7 +235,7 @@ xstrdup (const char *s)
236 Any other returned value must be freed with free. This is used 235 Any other returned value must be freed with free. This is used
237 only when get_current_dir_name is not defined on the system. */ 236 only when get_current_dir_name is not defined on the system. */
238char* 237char*
239get_current_dir_name () 238get_current_dir_name (void)
240{ 239{
241 char *buf; 240 char *buf;
242 char *pwd; 241 char *pwd;
@@ -312,10 +311,7 @@ get_current_dir_name ()
312 Return NULL if the variable was not found, or it was empty. 311 Return NULL if the variable was not found, or it was empty.
313 This code is based on w32_get_resource (w32.c). */ 312 This code is based on w32_get_resource (w32.c). */
314char * 313char *
315w32_get_resource (predefined, key, type) 314w32_get_resource (HKEY predefined, char *key, LPDWORD type)
316 HKEY predefined;
317 char *key;
318 LPDWORD type;
319{ 315{
320 HKEY hrootkey = NULL; 316 HKEY hrootkey = NULL;
321 char *result = NULL; 317 char *result = NULL;
@@ -348,8 +344,7 @@ w32_get_resource (predefined, key, type)
348 variables in the registry if they don't appear in the environment. 344 variables in the registry if they don't appear in the environment.
349*/ 345*/
350char * 346char *
351w32_getenv (envvar) 347w32_getenv (char *envvar)
352 char *envvar;
353{ 348{
354 char *value; 349 char *value;
355 DWORD dwType; 350 DWORD dwType;
@@ -397,7 +392,7 @@ w32_getenv (envvar)
397} 392}
398 393
399void 394void
400w32_set_user_model_id () 395w32_set_user_model_id (void)
401{ 396{
402 HMODULE shell; 397 HMODULE shell;
403 HRESULT (WINAPI * set_user_model) (wchar_t * id); 398 HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -424,7 +419,7 @@ w32_set_user_model_id ()
424} 419}
425 420
426int 421int
427w32_window_app () 422w32_window_app (void)
428{ 423{
429 static int window_app = -1; 424 static int window_app = -1;
430 char szTitle[MAX_PATH]; 425 char szTitle[MAX_PATH];
@@ -447,13 +442,11 @@ w32_window_app ()
447 This is necessary due to the broken implementation of exec* routines in 442 This is necessary due to the broken implementation of exec* routines in
448 the Microsoft libraries: they concatenate the arguments together without 443 the Microsoft libraries: they concatenate the arguments together without
449 quoting special characters, and pass the result to CreateProcess, with 444 quoting special characters, and pass the result to CreateProcess, with
450 predictably bad results. By contrast, Posix execvp passes the arguments 445 predictably bad results. By contrast, POSIX execvp passes the arguments
451 directly into the argv array of the child process. 446 directly into the argv array of the child process.
452*/ 447*/
453int 448int
454w32_execvp (path, argv) 449w32_execvp (const char *path, char **argv)
455 char *path;
456 char **argv;
457{ 450{
458 int i; 451 int i;
459 452
@@ -517,9 +510,7 @@ message (int is_error, char *message, ...)
517 The global variable `optind' will say how many arguments we used up. */ 510 The global variable `optind' will say how many arguments we used up. */
518 511
519void 512void
520decode_options (argc, argv) 513decode_options (int argc, char **argv)
521 int argc;
522 char **argv;
523{ 514{
524 alternate_editor = egetenv ("ALTERNATE_EDITOR"); 515 alternate_editor = egetenv ("ALTERNATE_EDITOR");
525 516
@@ -645,7 +636,7 @@ an empty string");
645 636
646 637
647void 638void
648print_help_and_exit () 639print_help_and_exit (void)
649{ 640{
650 /* Spaces and tabs are significant in this message; they're chosen so the 641 /* Spaces and tabs are significant in this message; they're chosen so the
651 message aligns properly both in a tty and in a Windows message box. 642 message aligns properly both in a tty and in a Windows message box.
@@ -732,7 +723,7 @@ main (argc, argv)
732#define AUTH_KEY_LENGTH 64 723#define AUTH_KEY_LENGTH 64
733#define SEND_BUFFER_SIZE 4096 724#define SEND_BUFFER_SIZE 4096
734 725
735extern char *strerror (); 726extern char *strerror (int);
736 727
737/* Buffer to accumulate data to send in TCP connections. */ 728/* Buffer to accumulate data to send in TCP connections. */
738char send_buffer[SEND_BUFFER_SIZE + 1]; 729char send_buffer[SEND_BUFFER_SIZE + 1];
@@ -743,8 +734,7 @@ HSOCKET emacs_socket = 0;
743/* On Windows, the socket library was historically separate from the standard 734/* On Windows, the socket library was historically separate from the standard
744 C library, so errors are handled differently. */ 735 C library, so errors are handled differently. */
745void 736void
746sock_err_message (function_name) 737sock_err_message (char *function_name)
747 char *function_name;
748{ 738{
749#ifdef WINDOWSNT 739#ifdef WINDOWSNT
750 char* msg = NULL; 740 char* msg = NULL;
@@ -768,9 +758,7 @@ sock_err_message (function_name)
768 - the buffer is full (but this shouldn't happen) 758 - the buffer is full (but this shouldn't happen)
769 Otherwise, we just accumulate it. */ 759 Otherwise, we just accumulate it. */
770void 760void
771send_to_emacs (s, data) 761send_to_emacs (HSOCKET s, char *data)
772 HSOCKET s;
773 char *data;
774{ 762{
775 while (data) 763 while (data)
776 { 764 {
@@ -807,11 +795,9 @@ send_to_emacs (s, data)
807 any initial -. Change spaces to underscores, too, so that the 795 any initial -. Change spaces to underscores, too, so that the
808 return value never contains a space. 796 return value never contains a space.
809 797
810 Does not change the string. Outputs the result to STREAM. */ 798 Does not change the string. Outputs the result to S. */
811void 799void
812quote_argument (s, str) 800quote_argument (HSOCKET s, char *str)
813 HSOCKET s;
814 char *str;
815{ 801{
816 char *copy = (char *) xmalloc (strlen (str) * 2 + 1); 802 char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
817 char *p, *q; 803 char *p, *q;
@@ -851,8 +837,7 @@ quote_argument (s, str)
851 modifying the string in place. Returns STR. */ 837 modifying the string in place. Returns STR. */
852 838
853char * 839char *
854unquote_argument (str) 840unquote_argument (char *str)
855 char *str;
856{ 841{
857 char *p, *q; 842 char *p, *q;
858 843
@@ -883,8 +868,7 @@ unquote_argument (str)
883 868
884 869
885int 870int
886file_name_absolute_p (filename) 871file_name_absolute_p (const unsigned char *filename)
887 const unsigned char *filename;
888{ 872{
889 /* Sanity check, it shouldn't happen. */ 873 /* Sanity check, it shouldn't happen. */
890 if (! filename) return FALSE; 874 if (! filename) return FALSE;
@@ -910,15 +894,15 @@ file_name_absolute_p (filename)
910 894
911#ifdef WINDOWSNT 895#ifdef WINDOWSNT
912/* Wrapper to make WSACleanup a cdecl, as required by atexit. */ 896/* Wrapper to make WSACleanup a cdecl, as required by atexit. */
913void 897void __cdecl
914__cdecl close_winsock () 898close_winsock (void)
915{ 899{
916 WSACleanup (); 900 WSACleanup ();
917} 901}
918 902
919/* Initialize the WinSock2 library. */ 903/* Initialize the WinSock2 library. */
920void 904void
921initialize_sockets () 905initialize_sockets (void)
922{ 906{
923 WSADATA wsaData; 907 WSADATA wsaData;
924 908
@@ -938,9 +922,7 @@ initialize_sockets ()
938 * the Emacs server: host, port, pid and authentication string. 922 * the Emacs server: host, port, pid and authentication string.
939 */ 923 */
940int 924int
941get_server_config (server, authentication) 925get_server_config (struct sockaddr_in *server, char *authentication)
942 struct sockaddr_in *server;
943 char *authentication;
944{ 926{
945 char dotted[32]; 927 char dotted[32];
946 char *port; 928 char *port;
@@ -1005,7 +987,7 @@ get_server_config (server, authentication)
1005} 987}
1006 988
1007HSOCKET 989HSOCKET
1008set_tcp_socket () 990set_tcp_socket (void)
1009{ 991{
1010 HSOCKET s; 992 HSOCKET s;
1011 struct sockaddr_in server; 993 struct sockaddr_in server;
@@ -1119,8 +1101,7 @@ find_tty (char **tty_type, char **tty_name, int noabort)
1119 0 - success: none of the above */ 1101 0 - success: none of the above */
1120 1102
1121static int 1103static int
1122socket_status (socket_name) 1104socket_status (char *socket_name)
1123 char *socket_name;
1124{ 1105{
1125 struct stat statbfr; 1106 struct stat statbfr;
1126 1107
@@ -1223,7 +1204,7 @@ init_signals (void)
1223 1204
1224 1205
1225HSOCKET 1206HSOCKET
1226set_local_socket () 1207set_local_socket (void)
1227{ 1208{
1228 HSOCKET s; 1209 HSOCKET s;
1229 struct sockaddr_un server; 1210 struct sockaddr_un server;
@@ -1247,8 +1228,10 @@ set_local_socket ()
1247 char *server_name = "server"; 1228 char *server_name = "server";
1248 char *tmpdir; 1229 char *tmpdir;
1249 1230
1250 if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\')) 1231 if (socket_name && !strchr (socket_name, '/')
1251 { /* socket_name is a file name component. */ 1232 && !strchr (socket_name, '\\'))
1233 {
1234 /* socket_name is a file name component. */
1252 server_name = socket_name; 1235 server_name = socket_name;
1253 socket_name = NULL; 1236 socket_name = NULL;
1254 default_sock = 1; /* Try both UIDs. */ 1237 default_sock = 1; /* Try both UIDs. */
@@ -1419,9 +1402,7 @@ FARPROC set_fg; /* Pointer to AllowSetForegroundWindow. */
1419FARPROC get_wc; /* Pointer to RealGetWindowClassA. */ 1402FARPROC get_wc; /* Pointer to RealGetWindowClassA. */
1420 1403
1421BOOL CALLBACK 1404BOOL CALLBACK
1422w32_find_emacs_process (hWnd, lParam) 1405w32_find_emacs_process (HWND hWnd, LPARAM lParam)
1423 HWND hWnd;
1424 LPARAM lParam;
1425{ 1406{
1426 DWORD pid; 1407 DWORD pid;
1427 char class[6]; 1408 char class[6];
@@ -1449,7 +1430,7 @@ w32_find_emacs_process (hWnd, lParam)
1449 * process id = emacs_pid. If found, allow it to grab the focus. 1430 * process id = emacs_pid. If found, allow it to grab the focus.
1450 */ 1431 */
1451void 1432void
1452w32_give_focus () 1433w32_give_focus (void)
1453{ 1434{
1454 HANDLE user32; 1435 HANDLE user32;
1455 1436
@@ -1526,9 +1507,7 @@ start_daemon_and_retry_set_socket (void)
1526} 1507}
1527 1508
1528int 1509int
1529main (argc, argv) 1510main (int argc, char **argv)
1530 int argc;
1531 char **argv;
1532{ 1511{
1533 int i, rl, needlf = 0; 1512 int i, rl, needlf = 0;
1534 char *cwd, *str; 1513 char *cwd, *str;
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 89edc6c1b27..79475fe9922 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -100,15 +100,10 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
100# ifndef PTR /* for XEmacs */ 100# ifndef PTR /* for XEmacs */
101# define PTR void * 101# define PTR void *
102# endif 102# endif
103# ifndef __P /* for XEmacs */
104# define __P(args) args
105# endif
106#else /* no config.h */ 103#else /* no config.h */
107# if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C)) 104# if defined(__STDC__) && (__STDC__ || defined(__SUNPRO_C))
108# define __P(args) args /* use prototypes */
109# define PTR void * /* for generic pointers */ 105# define PTR void * /* for generic pointers */
110# else /* not standard C */ 106# else /* not standard C */
111# define __P(args) () /* no prototypes */
112# define const /* remove const for old compilers' sake */ 107# define const /* remove const for old compilers' sake */
113# define PTR long * /* don't use void* */ 108# define PTR long * /* don't use void* */
114# endif 109# endif
@@ -158,20 +153,20 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
158# include <stdlib.h> 153# include <stdlib.h>
159# include <string.h> 154# include <string.h>
160# else /* no standard C headers */ 155# else /* no standard C headers */
161 extern char *getenv __P((const char *)); 156 extern char *getenv (const char *);
162 extern char *strcpy __P((char *, const char *)); 157 extern char *strcpy (char *, const char *);
163 extern char *strncpy __P((char *, const char *, unsigned long)); 158 extern char *strncpy (char *, const char *, unsigned long);
164 extern char *strcat __P((char *, const char *)); 159 extern char *strcat (char *, const char *);
165 extern char *strncat __P((char *, const char *, unsigned long)); 160 extern char *strncat (char *, const char *, unsigned long);
166 extern int strcmp __P((const char *, const char *)); 161 extern int strcmp (const char *, const char *);
167 extern int strncmp __P((const char *, const char *, unsigned long)); 162 extern int strncmp (const char *, const char *, unsigned long);
168 extern int system __P((const char *)); 163 extern int system (const char *);
169 extern unsigned long strlen __P((const char *)); 164 extern unsigned long strlen (const char *);
170 extern void *malloc __P((unsigned long)); 165 extern void *malloc (unsigned long);
171 extern void *realloc __P((void *, unsigned long)); 166 extern void *realloc (void *, unsigned long);
172 extern void exit __P((int)); 167 extern void exit (int);
173 extern void free __P((void *)); 168 extern void free (void *);
174 extern void *memmove __P((void *, const void *, unsigned long)); 169 extern void *memmove (void *, const void *, unsigned long);
175# define EXIT_SUCCESS 0 170# define EXIT_SUCCESS 0
176# define EXIT_FAILURE 1 171# define EXIT_FAILURE 1
177# endif 172# endif
@@ -273,7 +268,7 @@ If you want regular expression support, you should delete this notice and
273 268
274#define bool int 269#define bool int
275 270
276typedef void Lang_function __P((FILE *)); 271typedef void Lang_function (FILE *);
277 272
278typedef struct 273typedef struct
279{ 274{
@@ -365,87 +360,87 @@ typedef struct regexp
365/* Many compilers barf on this: 360/* Many compilers barf on this:
366 Lang_function Ada_funcs; 361 Lang_function Ada_funcs;
367 so let's write it this way */ 362 so let's write it this way */
368static void Ada_funcs __P((FILE *)); 363static void Ada_funcs (FILE *);
369static void Asm_labels __P((FILE *)); 364static void Asm_labels (FILE *);
370static void C_entries __P((int c_ext, FILE *)); 365static void C_entries (int c_ext, FILE *);
371static void default_C_entries __P((FILE *)); 366static void default_C_entries (FILE *);
372static void plain_C_entries __P((FILE *)); 367static void plain_C_entries (FILE *);
373static void Cjava_entries __P((FILE *)); 368static void Cjava_entries (FILE *);
374static void Cobol_paragraphs __P((FILE *)); 369static void Cobol_paragraphs (FILE *);
375static void Cplusplus_entries __P((FILE *)); 370static void Cplusplus_entries (FILE *);
376static void Cstar_entries __P((FILE *)); 371static void Cstar_entries (FILE *);
377static void Erlang_functions __P((FILE *)); 372static void Erlang_functions (FILE *);
378static void Forth_words __P((FILE *)); 373static void Forth_words (FILE *);
379static void Fortran_functions __P((FILE *)); 374static void Fortran_functions (FILE *);
380static void HTML_labels __P((FILE *)); 375static void HTML_labels (FILE *);
381static void Lisp_functions __P((FILE *)); 376static void Lisp_functions (FILE *);
382static void Lua_functions __P((FILE *)); 377static void Lua_functions (FILE *);
383static void Makefile_targets __P((FILE *)); 378static void Makefile_targets (FILE *);
384static void Pascal_functions __P((FILE *)); 379static void Pascal_functions (FILE *);
385static void Perl_functions __P((FILE *)); 380static void Perl_functions (FILE *);
386static void PHP_functions __P((FILE *)); 381static void PHP_functions (FILE *);
387static void PS_functions __P((FILE *)); 382static void PS_functions (FILE *);
388static void Prolog_functions __P((FILE *)); 383static void Prolog_functions (FILE *);
389static void Python_functions __P((FILE *)); 384static void Python_functions (FILE *);
390static void Scheme_functions __P((FILE *)); 385static void Scheme_functions (FILE *);
391static void TeX_commands __P((FILE *)); 386static void TeX_commands (FILE *);
392static void Texinfo_nodes __P((FILE *)); 387static void Texinfo_nodes (FILE *);
393static void Yacc_entries __P((FILE *)); 388static void Yacc_entries (FILE *);
394static void just_read_file __P((FILE *)); 389static void just_read_file (FILE *);
395 390
396static void print_language_names __P((void)); 391static void print_language_names (void);
397static void print_version __P((void)); 392static void print_version (void);
398static void print_help __P((argument *)); 393static void print_help (argument *);
399int main __P((int, char **)); 394int main (int, char **);
400 395
401static compressor *get_compressor_from_suffix __P((char *, char **)); 396static compressor *get_compressor_from_suffix (char *, char **);
402static language *get_language_from_langname __P((const char *)); 397static language *get_language_from_langname (const char *);
403static language *get_language_from_interpreter __P((char *)); 398static language *get_language_from_interpreter (char *);
404static language *get_language_from_filename __P((char *, bool)); 399static language *get_language_from_filename (char *, bool);
405static void readline __P((linebuffer *, FILE *)); 400static void readline (linebuffer *, FILE *);
406static long readline_internal __P((linebuffer *, FILE *)); 401static long readline_internal (linebuffer *, FILE *);
407static bool nocase_tail __P((char *)); 402static bool nocase_tail (char *);
408static void get_tag __P((char *, char **)); 403static void get_tag (char *, char **);
409 404
410static void analyse_regex __P((char *)); 405static void analyse_regex (char *);
411static void free_regexps __P((void)); 406static void free_regexps (void);
412static void regex_tag_multiline __P((void)); 407static void regex_tag_multiline (void);
413static void error __P((const char *, const char *)); 408static void error (const char *, const char *);
414static void suggest_asking_for_help __P((void)); 409static void suggest_asking_for_help (void);
415void fatal __P((char *, char *)); 410void fatal (char *, char *);
416static void pfatal __P((char *)); 411static void pfatal (char *);
417static void add_node __P((node *, node **)); 412static void add_node (node *, node **);
418 413
419static void init __P((void)); 414static void init (void);
420static void process_file_name __P((char *, language *)); 415static void process_file_name (char *, language *);
421static void process_file __P((FILE *, char *, language *)); 416static void process_file (FILE *, char *, language *);
422static void find_entries __P((FILE *)); 417static void find_entries (FILE *);
423static void free_tree __P((node *)); 418static void free_tree (node *);
424static void free_fdesc __P((fdesc *)); 419static void free_fdesc (fdesc *);
425static void pfnote __P((char *, bool, char *, int, int, long)); 420static void pfnote (char *, bool, char *, int, int, long);
426static void make_tag __P((char *, int, bool, char *, int, int, long)); 421static void make_tag (char *, int, bool, char *, int, int, long);
427static void invalidate_nodes __P((fdesc *, node **)); 422static void invalidate_nodes (fdesc *, node **);
428static void put_entries __P((node *)); 423static void put_entries (node *);
429 424
430static char *concat __P((char *, char *, char *)); 425static char *concat (char *, char *, char *);
431static char *skip_spaces __P((char *)); 426static char *skip_spaces (char *);
432static char *skip_non_spaces __P((char *)); 427static char *skip_non_spaces (char *);
433static char *savenstr __P((char *, int)); 428static char *savenstr (char *, int);
434static char *savestr __P((char *)); 429static char *savestr (char *);
435static char *etags_strchr __P((const char *, int)); 430static char *etags_strchr (const char *, int);
436static char *etags_strrchr __P((const char *, int)); 431static char *etags_strrchr (const char *, int);
437static int etags_strcasecmp __P((const char *, const char *)); 432static int etags_strcasecmp (const char *, const char *);
438static int etags_strncasecmp __P((const char *, const char *, int)); 433static int etags_strncasecmp (const char *, const char *, int);
439static char *etags_getcwd __P((void)); 434static char *etags_getcwd (void);
440static char *relative_filename __P((char *, char *)); 435static char *relative_filename (char *, char *);
441static char *absolute_filename __P((char *, char *)); 436static char *absolute_filename (char *, char *);
442static char *absolute_dirname __P((char *, char *)); 437static char *absolute_dirname (char *, char *);
443static bool filename_is_absolute __P((char *f)); 438static bool filename_is_absolute (char *f);
444static void canonicalize_filename __P((char *)); 439static void canonicalize_filename (char *);
445static void linebuffer_init __P((linebuffer *)); 440static void linebuffer_init (linebuffer *);
446static void linebuffer_setlen __P((linebuffer *, int)); 441static void linebuffer_setlen (linebuffer *, int);
447static PTR xmalloc __P((unsigned int)); 442static PTR xmalloc (unsigned int);
448static PTR xrealloc __P((char *, unsigned int)); 443static PTR xrealloc (char *, unsigned int);
449 444
450 445
451static char searchar = '/'; /* use /.../ searches */ 446static char searchar = '/'; /* use /.../ searches */
@@ -853,7 +848,7 @@ static language lang_names [] =
853 848
854 849
855static void 850static void
856print_language_names () 851print_language_names (void)
857{ 852{
858 language *lang; 853 language *lang;
859 char **name, **ext; 854 char **name, **ext;
@@ -892,7 +887,7 @@ etags --help --lang=ada.");
892# define VERSION "17.38.1.4" 887# define VERSION "17.38.1.4"
893#endif 888#endif
894static void 889static void
895print_version () 890print_version (void)
896{ 891{
897 /* Makes it easier to update automatically. */ 892 /* Makes it easier to update automatically. */
898 char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; 893 char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
@@ -909,8 +904,7 @@ print_version ()
909#endif 904#endif
910 905
911static void 906static void
912print_help (argbuffer) 907print_help (argument *argbuffer)
913 argument *argbuffer;
914{ 908{
915 bool help_for_lang = FALSE; 909 bool help_for_lang = FALSE;
916 910
@@ -1087,9 +1081,7 @@ Relative ones are stored relative to the output file's directory.\n");
1087 1081
1088 1082
1089int 1083int
1090main (argc, argv) 1084main (int argc, char **argv)
1091 int argc;
1092 char *argv[];
1093{ 1085{
1094 int i; 1086 int i;
1095 unsigned int nincluded_files; 1087 unsigned int nincluded_files;
@@ -1414,9 +1406,7 @@ main (argc, argv)
1414 * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> (1998) 1406 * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> (1998)
1415 */ 1407 */
1416static compressor * 1408static compressor *
1417get_compressor_from_suffix (file, extptr) 1409get_compressor_from_suffix (char *file, char **extptr)
1418 char *file;
1419 char **extptr;
1420{ 1410{
1421 compressor *compr; 1411 compressor *compr;
1422 char *slash, *suffix; 1412 char *slash, *suffix;
@@ -1452,8 +1442,7 @@ get_compressor_from_suffix (file, extptr)
1452 * Return a language given the name. 1442 * Return a language given the name.
1453 */ 1443 */
1454static language * 1444static language *
1455get_language_from_langname (name) 1445get_language_from_langname (const char *name)
1456 const char *name;
1457{ 1446{
1458 language *lang; 1447 language *lang;
1459 1448
@@ -1475,8 +1464,7 @@ get_language_from_langname (name)
1475 * Return a language given the interpreter name. 1464 * Return a language given the interpreter name.
1476 */ 1465 */
1477static language * 1466static language *
1478get_language_from_interpreter (interpreter) 1467get_language_from_interpreter (char *interpreter)
1479 char *interpreter;
1480{ 1468{
1481 language *lang; 1469 language *lang;
1482 char **iname; 1470 char **iname;
@@ -1498,9 +1486,7 @@ get_language_from_interpreter (interpreter)
1498 * Return a language given the file name. 1486 * Return a language given the file name.
1499 */ 1487 */
1500static language * 1488static language *
1501get_language_from_filename (file, case_sensitive) 1489get_language_from_filename (char *file, int case_sensitive)
1502 char *file;
1503 bool case_sensitive;
1504{ 1490{
1505 language *lang; 1491 language *lang;
1506 char **name, **ext, *suffix; 1492 char **name, **ext, *suffix;
@@ -1534,9 +1520,7 @@ get_language_from_filename (file, case_sensitive)
1534 * This routine is called on each file argument. 1520 * This routine is called on each file argument.
1535 */ 1521 */
1536static void 1522static void
1537process_file_name (file, lang) 1523process_file_name (char *file, language *lang)
1538 char *file;
1539 language *lang;
1540{ 1524{
1541 struct stat stat_buf; 1525 struct stat stat_buf;
1542 FILE *inf; 1526 FILE *inf;
@@ -1658,10 +1642,7 @@ process_file_name (file, lang)
1658} 1642}
1659 1643
1660static void 1644static void
1661process_file (fh, fn, lang) 1645process_file (FILE *fh, char *fn, language *lang)
1662 FILE *fh;
1663 char *fn;
1664 language *lang;
1665{ 1646{
1666 static const fdesc emptyfdesc; 1647 static const fdesc emptyfdesc;
1667 fdesc *fdp; 1648 fdesc *fdp;
@@ -1738,7 +1719,7 @@ process_file (fh, fn, lang)
1738 * of a char is TRUE if it is the string "white", else FALSE. 1719 * of a char is TRUE if it is the string "white", else FALSE.
1739 */ 1720 */
1740static void 1721static void
1741init () 1722init (void)
1742{ 1723{
1743 register char *sp; 1724 register char *sp;
1744 register int i; 1725 register int i;
@@ -1761,8 +1742,7 @@ init ()
1761 * which finds the function and type definitions. 1742 * which finds the function and type definitions.
1762 */ 1743 */
1763static void 1744static void
1764find_entries (inf) 1745find_entries (FILE *inf)
1765 FILE *inf;
1766{ 1746{
1767 char *cp; 1747 char *cp;
1768 language *lang = curfdp->lang; 1748 language *lang = curfdp->lang;
@@ -1920,14 +1900,14 @@ find_entries (inf)
1920 * etags.el needs to use the same characters that are in NONAM. 1900 * etags.el needs to use the same characters that are in NONAM.
1921 */ 1901 */
1922static void 1902static void
1923make_tag (name, namelen, is_func, linestart, linelen, lno, cno) 1903make_tag (char *name, int namelen, int is_func, char *linestart, int linelen, int lno, long int cno)
1924 char *name; /* tag name, or NULL if unnamed */ 1904 /* tag name, or NULL if unnamed */
1925 int namelen; /* tag length */ 1905 /* tag length */
1926 bool is_func; /* tag is a function */ 1906 /* tag is a function */
1927 char *linestart; /* start of the line where tag is */ 1907 /* start of the line where tag is */
1928 int linelen; /* length of the line where tag is */ 1908 /* length of the line where tag is */
1929 int lno; /* line number */ 1909 /* line number */
1930 long cno; /* character number */ 1910 /* character number */
1931{ 1911{
1932 bool named = (name != NULL && namelen > 0); 1912 bool named = (name != NULL && namelen > 0);
1933 1913
@@ -1963,13 +1943,13 @@ make_tag (name, namelen, is_func, linestart, linelen, lno, cno)
1963 1943
1964/* Record a tag. */ 1944/* Record a tag. */
1965static void 1945static void
1966pfnote (name, is_func, linestart, linelen, lno, cno) 1946pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno)
1967 char *name; /* tag name, or NULL if unnamed */ 1947 /* tag name, or NULL if unnamed */
1968 bool is_func; /* tag is a function */ 1948 /* tag is a function */
1969 char *linestart; /* start of the line where tag is */ 1949 /* start of the line where tag is */
1970 int linelen; /* length of the line where tag is */ 1950 /* length of the line where tag is */
1971 int lno; /* line number */ 1951 /* line number */
1972 long cno; /* character number */ 1952 /* character number */
1973{ 1953{
1974 register node *np; 1954 register node *np;
1975 1955
@@ -2023,8 +2003,7 @@ pfnote (name, is_func, linestart, linelen, lno, cno)
2023 * recurse on left children, iterate on right children. 2003 * recurse on left children, iterate on right children.
2024 */ 2004 */
2025static void 2005static void
2026free_tree (np) 2006free_tree (register node *np)
2027 register node *np;
2028{ 2007{
2029 while (np) 2008 while (np)
2030 { 2009 {
@@ -2042,8 +2021,7 @@ free_tree (np)
2042 * delete a file description 2021 * delete a file description
2043 */ 2022 */
2044static void 2023static void
2045free_fdesc (fdp) 2024free_fdesc (register fdesc *fdp)
2046 register fdesc *fdp;
2047{ 2025{
2048 free (fdp->infname); 2026 free (fdp->infname);
2049 free (fdp->infabsname); 2027 free (fdp->infabsname);
@@ -2063,8 +2041,7 @@ free_fdesc (fdp)
2063 * maintain state. 2041 * maintain state.
2064 */ 2042 */
2065static void 2043static void
2066add_node (np, cur_node_p) 2044add_node (node *np, node **cur_node_p)
2067 node *np, **cur_node_p;
2068{ 2045{
2069 register int dif; 2046 register int dif;
2070 register node *cur_node = *cur_node_p; 2047 register node *cur_node = *cur_node_p;
@@ -2144,9 +2121,7 @@ add_node (np, cur_node_p)
2144 * given file description (CTAGS case) or free them (ETAGS case). 2121 * given file description (CTAGS case) or free them (ETAGS case).
2145 */ 2122 */
2146static void 2123static void
2147invalidate_nodes (badfdp, npp) 2124invalidate_nodes (fdesc *badfdp, node **npp)
2148 fdesc *badfdp;
2149 node **npp;
2150{ 2125{
2151 node *np = *npp; 2126 node *np = *npp;
2152 2127
@@ -2178,13 +2153,12 @@ invalidate_nodes (badfdp, npp)
2178} 2153}
2179 2154
2180 2155
2181static int total_size_of_entries __P((node *)); 2156static int total_size_of_entries (node *);
2182static int number_len __P((long)); 2157static int number_len (long);
2183 2158
2184/* Length of a non-negative number's decimal representation. */ 2159/* Length of a non-negative number's decimal representation. */
2185static int 2160static int
2186number_len (num) 2161number_len (long int num)
2187 long num;
2188{ 2162{
2189 int len = 1; 2163 int len = 1;
2190 while ((num /= 10) > 0) 2164 while ((num /= 10) > 0)
@@ -2199,8 +2173,7 @@ number_len (num)
2199 * but is still supplied for backward compatibility. 2173 * but is still supplied for backward compatibility.
2200 */ 2174 */
2201static int 2175static int
2202total_size_of_entries (np) 2176total_size_of_entries (register node *np)
2203 register node *np;
2204{ 2177{
2205 register int total = 0; 2178 register int total = 0;
2206 2179
@@ -2220,8 +2193,7 @@ total_size_of_entries (np)
2220} 2193}
2221 2194
2222static void 2195static void
2223put_entries (np) 2196put_entries (register node *np)
2224 register node *np;
2225{ 2197{
2226 register char *sp; 2198 register char *sp;
2227 static fdesc *fdp = NULL; 2199 static fdesc *fdp = NULL;
@@ -2330,9 +2302,9 @@ enum sym_type
2330 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef 2302 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef
2331}; 2303};
2332 2304
2333static unsigned int hash __P((const char *, unsigned int)); 2305static unsigned int hash (const char *, unsigned int);
2334static struct C_stab_entry * in_word_set __P((const char *, unsigned int)); 2306static struct C_stab_entry * in_word_set (const char *, unsigned int);
2335static enum sym_type C_symtype __P((char *, int, int)); 2307static enum sym_type C_symtype (char *, int, int);
2336 2308
2337/* Feed stuff between (but not including) %[ and %] lines to: 2309/* Feed stuff between (but not including) %[ and %] lines to:
2338 gperf -m 5 2310 gperf -m 5
@@ -2400,9 +2372,7 @@ inline
2400#endif 2372#endif
2401#endif 2373#endif
2402static unsigned int 2374static unsigned int
2403hash (str, len) 2375hash (register const char *str, register unsigned int len)
2404 register const char *str;
2405 register unsigned int len;
2406{ 2376{
2407 static unsigned char asso_values[] = 2377 static unsigned char asso_values[] =
2408 { 2378 {
@@ -2448,9 +2418,7 @@ hash (str, len)
2448} 2418}
2449 2419
2450static struct C_stab_entry * 2420static struct C_stab_entry *
2451in_word_set (str, len) 2421in_word_set (register const char *str, register unsigned int len)
2452 register const char *str;
2453 register unsigned int len;
2454{ 2422{
2455 enum 2423 enum
2456 { 2424 {
@@ -2516,10 +2484,7 @@ in_word_set (str, len)
2516/*%>*/ 2484/*%>*/
2517 2485
2518static enum sym_type 2486static enum sym_type
2519C_symtype (str, len, c_ext) 2487C_symtype (char *str, int len, int c_ext)
2520 char *str;
2521 int len;
2522 int c_ext;
2523{ 2488{
2524 register struct C_stab_entry *se = in_word_set (str, len); 2489 register struct C_stab_entry *se = in_word_set (str, len);
2525 2490
@@ -2646,9 +2611,9 @@ static struct tok
2646 * Variables and functions for dealing with nested structures. 2611 * Variables and functions for dealing with nested structures.
2647 * Idea by Mykola Dzyuba <mdzyuba@yahoo.com> (2001) 2612 * Idea by Mykola Dzyuba <mdzyuba@yahoo.com> (2001)
2648 */ 2613 */
2649static void pushclass_above __P((int, char *, int)); 2614static void pushclass_above (int, char *, int);
2650static void popclass_above __P((int)); 2615static void popclass_above (int);
2651static void write_classname __P((linebuffer *, char *qualifier)); 2616static void write_classname (linebuffer *, char *qualifier);
2652 2617
2653static struct { 2618static struct {
2654 char **cname; /* nested class names */ 2619 char **cname; /* nested class names */
@@ -2663,10 +2628,7 @@ static struct {
2663 && bracelev == cstack.bracelev[nestlev-1] + 1) 2628 && bracelev == cstack.bracelev[nestlev-1] + 1)
2664 2629
2665static void 2630static void
2666pushclass_above (bracelev, str, len) 2631pushclass_above (int bracelev, char *str, int len)
2667 int bracelev;
2668 char *str;
2669 int len;
2670{ 2632{
2671 int nl; 2633 int nl;
2672 2634
@@ -2685,8 +2647,7 @@ pushclass_above (bracelev, str, len)
2685} 2647}
2686 2648
2687static void 2649static void
2688popclass_above (bracelev) 2650popclass_above (int bracelev)
2689 int bracelev;
2690{ 2651{
2691 int nl; 2652 int nl;
2692 2653
@@ -2700,9 +2661,7 @@ popclass_above (bracelev)
2700} 2661}
2701 2662
2702static void 2663static void
2703write_classname (cn, qualifier) 2664write_classname (linebuffer *cn, char *qualifier)
2704 linebuffer *cn;
2705 char *qualifier;
2706{ 2665{
2707 int i, len; 2666 int i, len;
2708 int qlen = strlen (qualifier); 2667 int qlen = strlen (qualifier);
@@ -2736,8 +2695,8 @@ write_classname (cn, qualifier)
2736} 2695}
2737 2696
2738 2697
2739static bool consider_token __P((char *, int, int, int *, int, int, bool *)); 2698static bool consider_token (char *, int, int, int *, int, int, bool *);
2740static void make_C_tag __P((bool)); 2699static void make_C_tag (bool);
2741 2700
2742/* 2701/*
2743 * consider_token () 2702 * consider_token ()
@@ -2757,14 +2716,14 @@ static void make_C_tag __P((bool));
2757 */ 2716 */
2758 2717
2759static bool 2718static bool
2760consider_token (str, len, c, c_extp, bracelev, parlev, is_func_or_var) 2719consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var)
2761 register char *str; /* IN: token pointer */ 2720 /* IN: token pointer */
2762 register int len; /* IN: token length */ 2721 /* IN: token length */
2763 register int c; /* IN: first char after the token */ 2722 /* IN: first char after the token */
2764 int *c_extp; /* IN, OUT: C extensions mask */ 2723 /* IN, OUT: C extensions mask */
2765 int bracelev; /* IN: brace level */ 2724 /* IN: brace level */
2766 int parlev; /* IN: parenthesis level */ 2725 /* IN: parenthesis level */
2767 bool *is_func_or_var; /* OUT: function or variable found */ 2726 /* OUT: function or variable found */
2768{ 2727{
2769 /* When structdef is stagseen, scolonseen, or snone with bracelev > 0, 2728 /* When structdef is stagseen, scolonseen, or snone with bracelev > 0,
2770 structtype is the type of the preceding struct-like keyword, and 2729 structtype is the type of the preceding struct-like keyword, and
@@ -3098,8 +3057,7 @@ do { \
3098 3057
3099 3058
3100static void 3059static void
3101make_C_tag (isfun) 3060make_C_tag (int isfun)
3102 bool isfun;
3103{ 3061{
3104 /* This function is never called when token.valid is FALSE, but 3062 /* This function is never called when token.valid is FALSE, but
3105 we must protect against invalid input or internal errors. */ 3063 we must protect against invalid input or internal errors. */
@@ -3125,9 +3083,9 @@ make_C_tag (isfun)
3125 * C syntax and adds them to the list. 3083 * C syntax and adds them to the list.
3126 */ 3084 */
3127static void 3085static void
3128C_entries (c_ext, inf) 3086C_entries (int c_ext, FILE *inf)
3129 int c_ext; /* extension of C */ 3087 /* extension of C */
3130 FILE *inf; /* input file */ 3088 /* input file */
3131{ 3089{
3132 register char c; /* latest char read; '\0' for end of line */ 3090 register char c; /* latest char read; '\0' for end of line */
3133 register char *lp; /* pointer one beyond the character `c' */ 3091 register char *lp; /* pointer one beyond the character `c' */
@@ -3957,48 +3915,42 @@ C_entries (c_ext, inf)
3957 * of a global flag. 3915 * of a global flag.
3958 */ 3916 */
3959static void 3917static void
3960default_C_entries (inf) 3918default_C_entries (FILE *inf)
3961 FILE *inf;
3962{ 3919{
3963 C_entries (cplusplus ? C_PLPL : C_AUTO, inf); 3920 C_entries (cplusplus ? C_PLPL : C_AUTO, inf);
3964} 3921}
3965 3922
3966/* Always do plain C. */ 3923/* Always do plain C. */
3967static void 3924static void
3968plain_C_entries (inf) 3925plain_C_entries (FILE *inf)
3969 FILE *inf;
3970{ 3926{
3971 C_entries (0, inf); 3927 C_entries (0, inf);
3972} 3928}
3973 3929
3974/* Always do C++. */ 3930/* Always do C++. */
3975static void 3931static void
3976Cplusplus_entries (inf) 3932Cplusplus_entries (FILE *inf)
3977 FILE *inf;
3978{ 3933{
3979 C_entries (C_PLPL, inf); 3934 C_entries (C_PLPL, inf);
3980} 3935}
3981 3936
3982/* Always do Java. */ 3937/* Always do Java. */
3983static void 3938static void
3984Cjava_entries (inf) 3939Cjava_entries (FILE *inf)
3985 FILE *inf;
3986{ 3940{
3987 C_entries (C_JAVA, inf); 3941 C_entries (C_JAVA, inf);
3988} 3942}
3989 3943
3990/* Always do C*. */ 3944/* Always do C*. */
3991static void 3945static void
3992Cstar_entries (inf) 3946Cstar_entries (FILE *inf)
3993 FILE *inf;
3994{ 3947{
3995 C_entries (C_STAR, inf); 3948 C_entries (C_STAR, inf);
3996} 3949}
3997 3950
3998/* Always do Yacc. */ 3951/* Always do Yacc. */
3999static void 3952static void
4000Yacc_entries (inf) 3953Yacc_entries (FILE *inf)
4001 FILE *inf;
4002{ 3954{
4003 C_entries (YACC, inf); 3955 C_entries (YACC, inf);
4004} 3956}
@@ -4031,8 +3983,7 @@ Yacc_entries (inf)
4031 * matching on files that have no language defined. 3983 * matching on files that have no language defined.
4032 */ 3984 */
4033static void 3985static void
4034just_read_file (inf) 3986just_read_file (FILE *inf)
4035 FILE *inf;
4036{ 3987{
4037 register char *dummy; 3988 register char *dummy;
4038 3989
@@ -4043,11 +3994,11 @@ just_read_file (inf)
4043 3994
4044/* Fortran parsing */ 3995/* Fortran parsing */
4045 3996
4046static void F_takeprec __P((void)); 3997static void F_takeprec (void);
4047static void F_getit __P((FILE *)); 3998static void F_getit (FILE *);
4048 3999
4049static void 4000static void
4050F_takeprec () 4001F_takeprec (void)
4051{ 4002{
4052 dbp = skip_spaces (dbp); 4003 dbp = skip_spaces (dbp);
4053 if (*dbp != '*') 4004 if (*dbp != '*')
@@ -4070,8 +4021,7 @@ F_takeprec ()
4070} 4021}
4071 4022
4072static void 4023static void
4073F_getit (inf) 4024F_getit (FILE *inf)
4074 FILE *inf;
4075{ 4025{
4076 register char *cp; 4026 register char *cp;
4077 4027
@@ -4095,8 +4045,7 @@ F_getit (inf)
4095 4045
4096 4046
4097static void 4047static void
4098Fortran_functions (inf) 4048Fortran_functions (FILE *inf)
4099 FILE *inf;
4100{ 4049{
4101 LOOP_ON_INPUT_LINES (inf, lb, dbp) 4050 LOOP_ON_INPUT_LINES (inf, lb, dbp)
4102 { 4051 {
@@ -4178,14 +4127,12 @@ Fortran_functions (inf)
4178 * Philippe Waroquiers (1998) 4127 * Philippe Waroquiers (1998)
4179 */ 4128 */
4180 4129
4181static void Ada_getit __P((FILE *, char *)); 4130static void Ada_getit (FILE *, char *);
4182 4131
4183/* Once we are positioned after an "interesting" keyword, let's get 4132/* Once we are positioned after an "interesting" keyword, let's get
4184 the real tag value necessary. */ 4133 the real tag value necessary. */
4185static void 4134static void
4186Ada_getit (inf, name_qualifier) 4135Ada_getit (FILE *inf, char *name_qualifier)
4187 FILE *inf;
4188 char *name_qualifier;
4189{ 4136{
4190 register char *cp; 4137 register char *cp;
4191 char *name; 4138 char *name;
@@ -4248,8 +4195,7 @@ Ada_getit (inf, name_qualifier)
4248} 4195}
4249 4196
4250static void 4197static void
4251Ada_funcs (inf) 4198Ada_funcs (FILE *inf)
4252 FILE *inf;
4253{ 4199{
4254 bool inquote = FALSE; 4200 bool inquote = FALSE;
4255 bool skip_till_semicolumn = FALSE; 4201 bool skip_till_semicolumn = FALSE;
@@ -4362,8 +4308,7 @@ Ada_funcs (inf)
4362 * Idea by Bob Weiner, Motorola Inc. (1994) 4308 * Idea by Bob Weiner, Motorola Inc. (1994)
4363 */ 4309 */
4364static void 4310static void
4365Asm_labels (inf) 4311Asm_labels (FILE *inf)
4366 FILE *inf;
4367{ 4312{
4368 register char *cp; 4313 register char *cp;
4369 4314
@@ -4395,8 +4340,7 @@ Asm_labels (inf)
4395 * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001) 4340 * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001)
4396 */ 4341 */
4397static void 4342static void
4398Perl_functions (inf) 4343Perl_functions (FILE *inf)
4399 FILE *inf;
4400{ 4344{
4401 char *package = savestr ("main"); /* current package name */ 4345 char *package = savestr ("main"); /* current package name */
4402 register char *cp; 4346 register char *cp;
@@ -4478,8 +4422,7 @@ Perl_functions (inf)
4478 * More ideas by seb bacon <seb@jamkit.com> (2002) 4422 * More ideas by seb bacon <seb@jamkit.com> (2002)
4479 */ 4423 */
4480static void 4424static void
4481Python_functions (inf) 4425Python_functions (FILE *inf)
4482 FILE *inf;
4483{ 4426{
4484 register char *cp; 4427 register char *cp;
4485 4428
@@ -4509,8 +4452,7 @@ Python_functions (inf)
4509 * Idea by Diez B. Roggisch (2001) 4452 * Idea by Diez B. Roggisch (2001)
4510 */ 4453 */
4511static void 4454static void
4512PHP_functions (inf) 4455PHP_functions (FILE *inf)
4513 FILE *inf;
4514{ 4456{
4515 register char *cp, *name; 4457 register char *cp, *name;
4516 bool search_identifier = FALSE; 4458 bool search_identifier = FALSE;
@@ -4589,8 +4531,7 @@ PHP_functions (inf)
4589 * Idea by Corny de Souza (1993) 4531 * Idea by Corny de Souza (1993)
4590 */ 4532 */
4591static void 4533static void
4592Cobol_paragraphs (inf) 4534Cobol_paragraphs (FILE *inf)
4593 FILE *inf;
4594{ 4535{
4595 register char *bp, *ep; 4536 register char *bp, *ep;
4596 4537
@@ -4618,8 +4559,7 @@ Cobol_paragraphs (inf)
4618 * Ideas by Assar Westerlund <assar@sics.se> (2001) 4559 * Ideas by Assar Westerlund <assar@sics.se> (2001)
4619 */ 4560 */
4620static void 4561static void
4621Makefile_targets (inf) 4562Makefile_targets (FILE *inf)
4622 FILE *inf;
4623{ 4563{
4624 register char *bp; 4564 register char *bp;
4625 4565
@@ -4654,8 +4594,7 @@ Makefile_targets (inf)
4654 * the tag is skipped. 4594 * the tag is skipped.
4655 */ 4595 */
4656static void 4596static void
4657Pascal_functions (inf) 4597Pascal_functions (FILE *inf)
4658 FILE *inf;
4659{ 4598{
4660 linebuffer tline; /* mostly copied from C_entries */ 4599 linebuffer tline; /* mostly copied from C_entries */
4661 long save_lcno; 4600 long save_lcno;
@@ -4832,10 +4771,10 @@ Pascal_functions (inf)
4832 * look for (def or (DEF, quote or QUOTE 4771 * look for (def or (DEF, quote or QUOTE
4833 */ 4772 */
4834 4773
4835static void L_getit __P((void)); 4774static void L_getit (void);
4836 4775
4837static void 4776static void
4838L_getit () 4777L_getit (void)
4839{ 4778{
4840 if (*dbp == '\'') /* Skip prefix quote */ 4779 if (*dbp == '\'') /* Skip prefix quote */
4841 dbp++; 4780 dbp++;
@@ -4851,8 +4790,7 @@ L_getit ()
4851} 4790}
4852 4791
4853static void 4792static void
4854Lisp_functions (inf) 4793Lisp_functions (FILE *inf)
4855 FILE *inf;
4856{ 4794{
4857 LOOP_ON_INPUT_LINES (inf, lb, dbp) 4795 LOOP_ON_INPUT_LINES (inf, lb, dbp)
4858 { 4796 {
@@ -4896,8 +4834,7 @@ Lisp_functions (inf)
4896 * "function" and "local function" are tags if they start at column 1. 4834 * "function" and "local function" are tags if they start at column 1.
4897 */ 4835 */
4898static void 4836static void
4899Lua_functions (inf) 4837Lua_functions (FILE *inf)
4900 FILE *inf;
4901{ 4838{
4902 register char *bp; 4839 register char *bp;
4903 4840
@@ -4923,8 +4860,7 @@ Lua_functions (inf)
4923 * Masatake Yamato <masata-y@is.aist-nara.ac.jp> (1999) 4860 * Masatake Yamato <masata-y@is.aist-nara.ac.jp> (1999)
4924 */ 4861 */
4925static void 4862static void
4926PS_functions (inf) 4863PS_functions (FILE *inf)
4927 FILE *inf;
4928{ 4864{
4929 register char *bp, *ep; 4865 register char *bp, *ep;
4930 4866
@@ -4954,8 +4890,7 @@ PS_functions (inf)
4954 * Ideas by Eduardo Horvath <eeh@netbsd.org> (2004) 4890 * Ideas by Eduardo Horvath <eeh@netbsd.org> (2004)
4955 */ 4891 */
4956static void 4892static void
4957Forth_words (inf) 4893Forth_words (FILE *inf)
4958 FILE *inf;
4959{ 4894{
4960 register char *bp; 4895 register char *bp;
4961 4896
@@ -4991,8 +4926,7 @@ Forth_words (inf)
4991 * Original code by Ken Haase (1985?) 4926 * Original code by Ken Haase (1985?)
4992 */ 4927 */
4993static void 4928static void
4994Scheme_functions (inf) 4929Scheme_functions (FILE *inf)
4995 FILE *inf;
4996{ 4930{
4997 register char *bp; 4931 register char *bp;
4998 4932
@@ -5032,8 +4966,8 @@ static char *TEX_defenv = "\
5032:part:appendix:entry:index:def\ 4966:part:appendix:entry:index:def\
5033:newcommand:renewcommand:newenvironment:renewenvironment"; 4967:newcommand:renewcommand:newenvironment:renewenvironment";
5034 4968
5035static void TEX_mode __P((FILE *)); 4969static void TEX_mode (FILE *);
5036static void TEX_decode_env __P((char *, char *)); 4970static void TEX_decode_env (char *, char *);
5037 4971
5038static char TEX_esc = '\\'; 4972static char TEX_esc = '\\';
5039static char TEX_opgrp = '{'; 4973static char TEX_opgrp = '{';
@@ -5043,8 +4977,7 @@ static char TEX_clgrp = '}';
5043 * TeX/LaTeX scanning loop. 4977 * TeX/LaTeX scanning loop.
5044 */ 4978 */
5045static void 4979static void
5046TeX_commands (inf) 4980TeX_commands (FILE *inf)
5047 FILE *inf;
5048{ 4981{
5049 char *cp; 4982 char *cp;
5050 linebuffer *key; 4983 linebuffer *key;
@@ -5108,8 +5041,7 @@ TeX_commands (inf)
5108/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping 5041/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping
5109 chars accordingly. */ 5042 chars accordingly. */
5110static void 5043static void
5111TEX_mode (inf) 5044TEX_mode (FILE *inf)
5112 FILE *inf;
5113{ 5045{
5114 int c; 5046 int c;
5115 5047
@@ -5143,9 +5075,7 @@ TEX_mode (inf)
5143/* Read environment and prepend it to the default string. 5075/* Read environment and prepend it to the default string.
5144 Build token table. */ 5076 Build token table. */
5145static void 5077static void
5146TEX_decode_env (evarname, defenv) 5078TEX_decode_env (char *evarname, char *defenv)
5147 char *evarname;
5148 char *defenv;
5149{ 5079{
5150 register char *env, *p; 5080 register char *env, *p;
5151 int i, len; 5081 int i, len;
@@ -5193,8 +5123,7 @@ TEX_decode_env (evarname, defenv)
5193 5123
5194/* Texinfo support. Dave Love, Mar. 2000. */ 5124/* Texinfo support. Dave Love, Mar. 2000. */
5195static void 5125static void
5196Texinfo_nodes (inf) 5126Texinfo_nodes (FILE *inf)
5197 FILE * inf;
5198{ 5127{
5199 char *cp, *start; 5128 char *cp, *start;
5200 LOOP_ON_INPUT_LINES (inf, lb, cp) 5129 LOOP_ON_INPUT_LINES (inf, lb, cp)
@@ -5217,8 +5146,7 @@ Texinfo_nodes (inf)
5217 * Francesco Potortì, 2002. 5146 * Francesco Potortì, 2002.
5218 */ 5147 */
5219static void 5148static void
5220HTML_labels (inf) 5149HTML_labels (FILE *inf)
5221 FILE * inf;
5222{ 5150{
5223 bool getnext = FALSE; /* next text outside of HTML tags is a tag */ 5151 bool getnext = FALSE; /* next text outside of HTML tags is a tag */
5224 bool skiptag = FALSE; /* skip to the end of the current HTML tag */ 5152 bool skiptag = FALSE; /* skip to the end of the current HTML tag */
@@ -5338,13 +5266,12 @@ HTML_labels (inf)
5338 * Original code by Sunichirou Sugou (1989) 5266 * Original code by Sunichirou Sugou (1989)
5339 * Rewritten by Anders Lindgren (1996) 5267 * Rewritten by Anders Lindgren (1996)
5340 */ 5268 */
5341static int prolog_pr __P((char *, char *)); 5269static int prolog_pr (char *, char *);
5342static void prolog_skip_comment __P((linebuffer *, FILE *)); 5270static void prolog_skip_comment (linebuffer *, FILE *);
5343static int prolog_atom __P((char *, int)); 5271static int prolog_atom (char *, int);
5344 5272
5345static void 5273static void
5346Prolog_functions (inf) 5274Prolog_functions (FILE *inf)
5347 FILE *inf;
5348{ 5275{
5349 char *cp, *last; 5276 char *cp, *last;
5350 int len; 5277 int len;
@@ -5380,9 +5307,7 @@ Prolog_functions (inf)
5380 5307
5381 5308
5382static void 5309static void
5383prolog_skip_comment (plb, inf) 5310prolog_skip_comment (linebuffer *plb, FILE *inf)
5384 linebuffer *plb;
5385 FILE *inf;
5386{ 5311{
5387 char *cp; 5312 char *cp;
5388 5313
@@ -5408,9 +5333,9 @@ prolog_skip_comment (plb, inf)
5408 * header was found. 5333 * header was found.
5409 */ 5334 */
5410static int 5335static int
5411prolog_pr (s, last) 5336prolog_pr (char *s, char *last)
5412 char *s; 5337
5413 char *last; /* Name of last clause. */ 5338 /* Name of last clause. */
5414{ 5339{
5415 int pos; 5340 int pos;
5416 int len; 5341 int len;
@@ -5446,9 +5371,7 @@ prolog_pr (s, last)
5446 * Backslash quotes everything. 5371 * Backslash quotes everything.
5447 */ 5372 */
5448static int 5373static int
5449prolog_atom (s, pos) 5374prolog_atom (char *s, int pos)
5450 char *s;
5451 int pos;
5452{ 5375{
5453 int origpos; 5376 int origpos;
5454 5377
@@ -5503,13 +5426,12 @@ prolog_atom (s, pos)
5503 * Assumes that Erlang functions start at column 0. 5426 * Assumes that Erlang functions start at column 0.
5504 * Original code by Anders Lindgren (1996) 5427 * Original code by Anders Lindgren (1996)
5505 */ 5428 */
5506static int erlang_func __P((char *, char *)); 5429static int erlang_func (char *, char *);
5507static void erlang_attribute __P((char *)); 5430static void erlang_attribute (char *);
5508static int erlang_atom __P((char *)); 5431static int erlang_atom (char *);
5509 5432
5510static void 5433static void
5511Erlang_functions (inf) 5434Erlang_functions (FILE *inf)
5512 FILE *inf;
5513{ 5435{
5514 char *cp, *last; 5436 char *cp, *last;
5515 int len; 5437 int len;
@@ -5568,9 +5490,9 @@ Erlang_functions (inf)
5568 * was found. 5490 * was found.
5569 */ 5491 */
5570static int 5492static int
5571erlang_func (s, last) 5493erlang_func (char *s, char *last)
5572 char *s; 5494
5573 char *last; /* Name of last clause. */ 5495 /* Name of last clause. */
5574{ 5496{
5575 int pos; 5497 int pos;
5576 int len; 5498 int len;
@@ -5606,8 +5528,7 @@ erlang_func (s, last)
5606 * -record(graph, {vtab = notable, cyclic = true}). 5528 * -record(graph, {vtab = notable, cyclic = true}).
5607 */ 5529 */
5608static void 5530static void
5609erlang_attribute (s) 5531erlang_attribute (char *s)
5610 char *s;
5611{ 5532{
5612 char *cp = s; 5533 char *cp = s;
5613 5534
@@ -5627,8 +5548,7 @@ erlang_attribute (s)
5627 * Return the number of bytes consumed, or -1 if there was an error. 5548 * Return the number of bytes consumed, or -1 if there was an error.
5628 */ 5549 */
5629static int 5550static int
5630erlang_atom (s) 5551erlang_atom (char *s)
5631 char *s;
5632{ 5552{
5633 int pos = 0; 5553 int pos = 0;
5634 5554
@@ -5652,9 +5572,9 @@ erlang_atom (s)
5652} 5572}
5653 5573
5654 5574
5655static char *scan_separators __P((char *)); 5575static char *scan_separators (char *);
5656static void add_regex __P((char *, language *)); 5576static void add_regex (char *, language *);
5657static char *substitute __P((char *, char *, struct re_registers *)); 5577static char *substitute (char *, char *, struct re_registers *);
5658 5578
5659/* 5579/*
5660 * Take a string like "/blah/" and turn it into "blah", verifying 5580 * Take a string like "/blah/" and turn it into "blah", verifying
@@ -5666,8 +5586,7 @@ static char *substitute __P((char *, char *, struct re_registers *));
5666 * unterminated regexps. 5586 * unterminated regexps.
5667 */ 5587 */
5668static char * 5588static char *
5669scan_separators (name) 5589scan_separators (char *name)
5670 char *name;
5671{ 5590{
5672 char sep = name[0]; 5591 char sep = name[0];
5673 char *copyto = name; 5592 char *copyto = name;
@@ -5719,8 +5638,7 @@ scan_separators (name)
5719/* Look at the argument of --regex or --no-regex and do the right 5638/* Look at the argument of --regex or --no-regex and do the right
5720 thing. Same for each line of a regexp file. */ 5639 thing. Same for each line of a regexp file. */
5721static void 5640static void
5722analyse_regex (regex_arg) 5641analyse_regex (char *regex_arg)
5723 char *regex_arg;
5724{ 5642{
5725 if (regex_arg == NULL) 5643 if (regex_arg == NULL)
5726 { 5644 {
@@ -5791,9 +5709,7 @@ analyse_regex (regex_arg)
5791/* Separate the regexp pattern, compile it, 5709/* Separate the regexp pattern, compile it,
5792 and care for optional name and modifiers. */ 5710 and care for optional name and modifiers. */
5793static void 5711static void
5794add_regex (regexp_pattern, lang) 5712add_regex (char *regexp_pattern, language *lang)
5795 char *regexp_pattern;
5796 language *lang;
5797{ 5713{
5798 static struct re_pattern_buffer zeropattern; 5714 static struct re_pattern_buffer zeropattern;
5799 char sep, *pat, *name, *modifiers; 5715 char sep, *pat, *name, *modifiers;
@@ -5910,9 +5826,7 @@ add_regex (regexp_pattern, lang)
5910 * arguments. 5826 * arguments.
5911 */ 5827 */
5912static char * 5828static char *
5913substitute (in, out, regs) 5829substitute (char *in, char *out, struct re_registers *regs)
5914 char *in, *out;
5915 struct re_registers *regs;
5916{ 5830{
5917 char *result, *t; 5831 char *result, *t;
5918 int size, dig, diglen; 5832 int size, dig, diglen;
@@ -5959,7 +5873,7 @@ substitute (in, out, regs)
5959 5873
5960/* Deallocate all regexps. */ 5874/* Deallocate all regexps. */
5961static void 5875static void
5962free_regexps () 5876free_regexps (void)
5963{ 5877{
5964 regexp *rp; 5878 regexp *rp;
5965 while (p_head != NULL) 5879 while (p_head != NULL)
@@ -5981,7 +5895,7 @@ free_regexps ()
5981 * Idea by Ben Wing <ben@666.com> (2002). 5895 * Idea by Ben Wing <ben@666.com> (2002).
5982 */ 5896 */
5983static void 5897static void
5984regex_tag_multiline () 5898regex_tag_multiline (void)
5985{ 5899{
5986 char *buffer = filebuf.buffer; 5900 char *buffer = filebuf.buffer;
5987 regexp *rp; 5901 regexp *rp;
@@ -6058,8 +5972,7 @@ regex_tag_multiline ()
6058 5972
6059 5973
6060static bool 5974static bool
6061nocase_tail (cp) 5975nocase_tail (char *cp)
6062 char *cp;
6063{ 5976{
6064 register int len = 0; 5977 register int len = 0;
6065 5978
@@ -6074,9 +5987,7 @@ nocase_tail (cp)
6074} 5987}
6075 5988
6076static void 5989static void
6077get_tag (bp, namepp) 5990get_tag (register char *bp, char **namepp)
6078 register char *bp;
6079 char **namepp;
6080{ 5991{
6081 register char *cp = bp; 5992 register char *cp = bp;
6082 5993
@@ -6107,9 +6018,7 @@ get_tag (bp, namepp)
6107 * appended to `filebuf'. 6018 * appended to `filebuf'.
6108 */ 6019 */
6109static long 6020static long
6110readline_internal (lbp, stream) 6021readline_internal (linebuffer *lbp, register FILE *stream)
6111 linebuffer *lbp;
6112 register FILE *stream;
6113{ 6022{
6114 char *buffer = lbp->buffer; 6023 char *buffer = lbp->buffer;
6115 register char *p = lbp->buffer; 6024 register char *p = lbp->buffer;
@@ -6187,9 +6096,7 @@ readline_internal (lbp, stream)
6187 * directives. 6096 * directives.
6188 */ 6097 */
6189static void 6098static void
6190readline (lbp, stream) 6099readline (linebuffer *lbp, FILE *stream)
6191 linebuffer *lbp;
6192 FILE *stream;
6193{ 6100{
6194 long result; 6101 long result;
6195 6102
@@ -6382,8 +6289,7 @@ readline (lbp, stream)
6382 * with xnew where the string CP has been copied. 6289 * with xnew where the string CP has been copied.
6383 */ 6290 */
6384static char * 6291static char *
6385savestr (cp) 6292savestr (char *cp)
6386 char *cp;
6387{ 6293{
6388 return savenstr (cp, strlen (cp)); 6294 return savenstr (cp, strlen (cp));
6389} 6295}
@@ -6393,9 +6299,7 @@ savestr (cp)
6393 * the string CP has been copied for at most the first LEN characters. 6299 * the string CP has been copied for at most the first LEN characters.
6394 */ 6300 */
6395static char * 6301static char *
6396savenstr (cp, len) 6302savenstr (char *cp, int len)
6397 char *cp;
6398 int len;
6399{ 6303{
6400 register char *dp; 6304 register char *dp;
6401 6305
@@ -6412,9 +6316,7 @@ savenstr (cp, len)
6412 * Identical to POSIX strrchr, included for portability. 6316 * Identical to POSIX strrchr, included for portability.
6413 */ 6317 */
6414static char * 6318static char *
6415etags_strrchr (sp, c) 6319etags_strrchr (register const char *sp, register int c)
6416 register const char *sp;
6417 register int c;
6418{ 6320{
6419 register const char *r; 6321 register const char *r;
6420 6322
@@ -6434,9 +6336,7 @@ etags_strrchr (sp, c)
6434 * Identical to POSIX strchr, included for portability. 6336 * Identical to POSIX strchr, included for portability.
6435 */ 6337 */
6436static char * 6338static char *
6437etags_strchr (sp, c) 6339etags_strchr (register const char *sp, register int c)
6438 register const char *sp;
6439 register int c;
6440{ 6340{
6441 do 6341 do
6442 { 6342 {
@@ -6452,9 +6352,7 @@ etags_strchr (sp, c)
6452 * Same as BSD's strcasecmp, included for portability. 6352 * Same as BSD's strcasecmp, included for portability.
6453 */ 6353 */
6454static int 6354static int
6455etags_strcasecmp (s1, s2) 6355etags_strcasecmp (register const char *s1, register const char *s2)
6456 register const char *s1;
6457 register const char *s2;
6458{ 6356{
6459 while (*s1 != '\0' 6357 while (*s1 != '\0'
6460 && (ISALPHA (*s1) && ISALPHA (*s2) 6358 && (ISALPHA (*s1) && ISALPHA (*s2)
@@ -6474,10 +6372,7 @@ etags_strcasecmp (s1, s2)
6474 * Same as BSD's strncasecmp, included for portability. 6372 * Same as BSD's strncasecmp, included for portability.
6475 */ 6373 */
6476static int 6374static int
6477etags_strncasecmp (s1, s2, n) 6375etags_strncasecmp (register const char *s1, register const char *s2, register int n)
6478 register const char *s1;
6479 register const char *s2;
6480 register int n;
6481{ 6376{
6482 while (*s1 != '\0' && n-- > 0 6377 while (*s1 != '\0' && n-- > 0
6483 && (ISALPHA (*s1) && ISALPHA (*s2) 6378 && (ISALPHA (*s1) && ISALPHA (*s2)
@@ -6495,8 +6390,7 @@ etags_strncasecmp (s1, s2, n)
6495 6390
6496/* Skip spaces (end of string is not space), return new pointer. */ 6391/* Skip spaces (end of string is not space), return new pointer. */
6497static char * 6392static char *
6498skip_spaces (cp) 6393skip_spaces (char *cp)
6499 char *cp;
6500{ 6394{
6501 while (iswhite (*cp)) 6395 while (iswhite (*cp))
6502 cp++; 6396 cp++;
@@ -6505,8 +6399,7 @@ skip_spaces (cp)
6505 6399
6506/* Skip non spaces, except end of string, return new pointer. */ 6400/* Skip non spaces, except end of string, return new pointer. */
6507static char * 6401static char *
6508skip_non_spaces (cp) 6402skip_non_spaces (char *cp)
6509 char *cp;
6510{ 6403{
6511 while (*cp != '\0' && !iswhite (*cp)) 6404 while (*cp != '\0' && !iswhite (*cp))
6512 cp++; 6405 cp++;
@@ -6515,23 +6408,21 @@ skip_non_spaces (cp)
6515 6408
6516/* Print error message and exit. */ 6409/* Print error message and exit. */
6517void 6410void
6518fatal (s1, s2) 6411fatal (char *s1, char *s2)
6519 char *s1, *s2;
6520{ 6412{
6521 error (s1, s2); 6413 error (s1, s2);
6522 exit (EXIT_FAILURE); 6414 exit (EXIT_FAILURE);
6523} 6415}
6524 6416
6525static void 6417static void
6526pfatal (s1) 6418pfatal (char *s1)
6527 char *s1;
6528{ 6419{
6529 perror (s1); 6420 perror (s1);
6530 exit (EXIT_FAILURE); 6421 exit (EXIT_FAILURE);
6531} 6422}
6532 6423
6533static void 6424static void
6534suggest_asking_for_help () 6425suggest_asking_for_help (void)
6535{ 6426{
6536 fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", 6427 fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
6537 progname, NO_LONG_OPTIONS ? "-h" : "--help"); 6428 progname, NO_LONG_OPTIONS ? "-h" : "--help");
@@ -6540,8 +6431,7 @@ suggest_asking_for_help ()
6540 6431
6541/* Print error message. `s1' is printf control string, `s2' is arg for it. */ 6432/* Print error message. `s1' is printf control string, `s2' is arg for it. */
6542static void 6433static void
6543error (s1, s2) 6434error (const char *s1, const char *s2)
6544 const char *s1, *s2;
6545{ 6435{
6546 fprintf (stderr, "%s: ", progname); 6436 fprintf (stderr, "%s: ", progname);
6547 fprintf (stderr, s1, s2); 6437 fprintf (stderr, s1, s2);
@@ -6551,8 +6441,7 @@ error (s1, s2)
6551/* Return a newly-allocated string whose contents 6441/* Return a newly-allocated string whose contents
6552 concatenate those of s1, s2, s3. */ 6442 concatenate those of s1, s2, s3. */
6553static char * 6443static char *
6554concat (s1, s2, s3) 6444concat (char *s1, char *s2, char *s3)
6555 char *s1, *s2, *s3;
6556{ 6445{
6557 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); 6446 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
6558 char *result = xnew (len1 + len2 + len3 + 1, char); 6447 char *result = xnew (len1 + len2 + len3 + 1, char);
@@ -6569,7 +6458,7 @@ concat (s1, s2, s3)
6569/* Does the same work as the system V getcwd, but does not need to 6458/* Does the same work as the system V getcwd, but does not need to
6570 guess the buffer size in advance. */ 6459 guess the buffer size in advance. */
6571static char * 6460static char *
6572etags_getcwd () 6461etags_getcwd (void)
6573{ 6462{
6574#ifdef HAVE_GETCWD 6463#ifdef HAVE_GETCWD
6575 int bufsize = 200; 6464 int bufsize = 200;
@@ -6619,8 +6508,7 @@ etags_getcwd ()
6619/* Return a newly allocated string containing the file name of FILE 6508/* Return a newly allocated string containing the file name of FILE
6620 relative to the absolute directory DIR (which should end with a slash). */ 6509 relative to the absolute directory DIR (which should end with a slash). */
6621static char * 6510static char *
6622relative_filename (file, dir) 6511relative_filename (char *file, char *dir)
6623 char *file, *dir;
6624{ 6512{
6625 char *fp, *dp, *afn, *res; 6513 char *fp, *dp, *afn, *res;
6626 int i; 6514 int i;
@@ -6659,8 +6547,7 @@ relative_filename (file, dir)
6659/* Return a newly allocated string containing the absolute file name 6547/* Return a newly allocated string containing the absolute file name
6660 of FILE given DIR (which should end with a slash). */ 6548 of FILE given DIR (which should end with a slash). */
6661static char * 6549static char *
6662absolute_filename (file, dir) 6550absolute_filename (char *file, char *dir)
6663 char *file, *dir;
6664{ 6551{
6665 char *slashp, *cp, *res; 6552 char *slashp, *cp, *res;
6666 6553
@@ -6733,8 +6620,7 @@ absolute_filename (file, dir)
6733 file name of dir where FILE resides given DIR (which should 6620 file name of dir where FILE resides given DIR (which should
6734 end with a slash). */ 6621 end with a slash). */
6735static char * 6622static char *
6736absolute_dirname (file, dir) 6623absolute_dirname (char *file, char *dir)
6737 char *file, *dir;
6738{ 6624{
6739 char *slashp, *res; 6625 char *slashp, *res;
6740 char save; 6626 char save;
@@ -6753,8 +6639,7 @@ absolute_dirname (file, dir)
6753/* Whether the argument string is an absolute file name. The argument 6639/* Whether the argument string is an absolute file name. The argument
6754 string must have been canonicalized with canonicalize_filename. */ 6640 string must have been canonicalized with canonicalize_filename. */
6755static bool 6641static bool
6756filename_is_absolute (fn) 6642filename_is_absolute (char *fn)
6757 char *fn;
6758{ 6643{
6759 return (fn[0] == '/' 6644 return (fn[0] == '/'
6760#ifdef DOS_NT 6645#ifdef DOS_NT
@@ -6766,8 +6651,7 @@ filename_is_absolute (fn)
6766/* Upcase DOS drive letter and collapse separators into single slashes. 6651/* Upcase DOS drive letter and collapse separators into single slashes.
6767 Works in place. */ 6652 Works in place. */
6768static void 6653static void
6769canonicalize_filename (fn) 6654canonicalize_filename (register char *fn)
6770 register char *fn;
6771{ 6655{
6772 register char* cp; 6656 register char* cp;
6773 char sep = '/'; 6657 char sep = '/';
@@ -6796,8 +6680,7 @@ canonicalize_filename (fn)
6796 6680
6797/* Initialize a linebuffer for use. */ 6681/* Initialize a linebuffer for use. */
6798static void 6682static void
6799linebuffer_init (lbp) 6683linebuffer_init (linebuffer *lbp)
6800 linebuffer *lbp;
6801{ 6684{
6802 lbp->size = (DEBUG) ? 3 : 200; 6685 lbp->size = (DEBUG) ? 3 : 200;
6803 lbp->buffer = xnew (lbp->size, char); 6686 lbp->buffer = xnew (lbp->size, char);
@@ -6807,9 +6690,7 @@ linebuffer_init (lbp)
6807 6690
6808/* Set the minimum size of a string contained in a linebuffer. */ 6691/* Set the minimum size of a string contained in a linebuffer. */
6809static void 6692static void
6810linebuffer_setlen (lbp, toksize) 6693linebuffer_setlen (linebuffer *lbp, int toksize)
6811 linebuffer *lbp;
6812 int toksize;
6813{ 6694{
6814 while (lbp->size <= toksize) 6695 while (lbp->size <= toksize)
6815 { 6696 {
@@ -6821,8 +6702,7 @@ linebuffer_setlen (lbp, toksize)
6821 6702
6822/* Like malloc but get fatal error if memory is exhausted. */ 6703/* Like malloc but get fatal error if memory is exhausted. */
6823static PTR 6704static PTR
6824xmalloc (size) 6705xmalloc (unsigned int size)
6825 unsigned int size;
6826{ 6706{
6827 PTR result = (PTR) malloc (size); 6707 PTR result = (PTR) malloc (size);
6828 if (result == NULL) 6708 if (result == NULL)
@@ -6831,9 +6711,7 @@ xmalloc (size)
6831} 6711}
6832 6712
6833static PTR 6713static PTR
6834xrealloc (ptr, size) 6714xrealloc (char *ptr, unsigned int size)
6835 char *ptr;
6836 unsigned int size;
6837{ 6715{
6838 PTR result = (PTR) realloc (ptr, size); 6716 PTR result = (PTR) realloc (ptr, size);
6839 if (result == NULL) 6717 if (result == NULL)
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index f98fb749476..f4d978b7d11 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -100,7 +100,7 @@ typedef struct header_record *header;
100struct stream_record 100struct stream_record
101{ 101{
102 FILE *handle; 102 FILE *handle;
103 int (*action)(); 103 int (*action)(FILE *);
104 struct stream_record *rest_streams; 104 struct stream_record *rest_streams;
105}; 105};
106typedef struct stream_record *stream_list; 106typedef struct stream_record *stream_list;
@@ -147,8 +147,8 @@ static line_list file_preface;
147static stream_list the_streams; 147static stream_list the_streams;
148static boolean no_problems = true; 148static boolean no_problems = true;
149 149
150extern FILE *popen (); 150extern FILE *popen (const char *, const char *);
151extern int fclose (), pclose (); 151extern int fclose (FILE *), pclose (FILE *);
152 152
153#ifdef CURRENT_USER 153#ifdef CURRENT_USER
154extern struct passwd *getpwuid (); 154extern struct passwd *getpwuid ();
@@ -164,8 +164,7 @@ static struct passwd *my_entry;
164/* Print error message. `s1' is printf control string, `s2' is arg for it. */ 164/* Print error message. `s1' is printf control string, `s2' is arg for it. */
165 165
166static void 166static void
167error (s1, s2) 167error (char *s1, char *s2)
168 char *s1, *s2;
169{ 168{
170 printf ("%s: ", my_name); 169 printf ("%s: ", my_name);
171 printf (s1, s2); 170 printf (s1, s2);
@@ -176,8 +175,7 @@ error (s1, s2)
176/* Print error message and exit. */ 175/* Print error message and exit. */
177 176
178static void 177static void
179fatal (s1) 178fatal (char *s1)
180 char *s1;
181{ 179{
182 error ("%s", s1); 180 error ("%s", s1);
183 exit (EXIT_FAILURE); 181 exit (EXIT_FAILURE);
@@ -186,8 +184,7 @@ fatal (s1)
186/* Like malloc but get fatal error if memory is exhausted. */ 184/* Like malloc but get fatal error if memory is exhausted. */
187 185
188static long * 186static long *
189xmalloc (size) 187xmalloc (int size)
190 int size;
191{ 188{
192 long *result = (long *) malloc (((unsigned) size)); 189 long *result = (long *) malloc (((unsigned) size));
193 if (result == ((long *) NULL)) 190 if (result == ((long *) NULL))
@@ -196,9 +193,7 @@ xmalloc (size)
196} 193}
197 194
198static long * 195static long *
199xrealloc (ptr, size) 196xrealloc (long int *ptr, int size)
200 long *ptr;
201 int size;
202{ 197{
203 long *result = (long *) realloc (ptr, ((unsigned) size)); 198 long *result = (long *) realloc (ptr, ((unsigned) size));
204 if (result == ((long *) NULL)) 199 if (result == ((long *) NULL))
@@ -209,8 +204,7 @@ xrealloc (ptr, size)
209/* Initialize a linebuffer for use */ 204/* Initialize a linebuffer for use */
210 205
211void 206void
212init_linebuffer (linebuffer) 207init_linebuffer (struct linebuffer *linebuffer)
213 struct linebuffer *linebuffer;
214{ 208{
215 linebuffer->size = INITIAL_LINE_SIZE; 209 linebuffer->size = INITIAL_LINE_SIZE;
216 linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE)); 210 linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE));
@@ -220,9 +214,7 @@ init_linebuffer (linebuffer)
220 Return the length of the line. */ 214 Return the length of the line. */
221 215
222long 216long
223readline (linebuffer, stream) 217readline (struct linebuffer *linebuffer, FILE *stream)
224 struct linebuffer *linebuffer;
225 FILE *stream;
226{ 218{
227 char *buffer = linebuffer->buffer; 219 char *buffer = linebuffer->buffer;
228 char *p = linebuffer->buffer; 220 char *p = linebuffer->buffer;
@@ -257,9 +249,7 @@ readline (linebuffer, stream)
257 If there is no keyword, return NULL and don't alter *REST. */ 249 If there is no keyword, return NULL and don't alter *REST. */
258 250
259char * 251char *
260get_keyword (field, rest) 252get_keyword (register char *field, char **rest)
261 register char *field;
262 char **rest;
263{ 253{
264 static char keyword[KEYWORD_SIZE]; 254 static char keyword[KEYWORD_SIZE];
265 register char *ptr; 255 register char *ptr;
@@ -284,8 +274,7 @@ get_keyword (field, rest)
284/* Nonzero if the string FIELD starts with a colon-terminated keyword. */ 274/* Nonzero if the string FIELD starts with a colon-terminated keyword. */
285 275
286boolean 276boolean
287has_keyword (field) 277has_keyword (char *field)
288 char *field;
289{ 278{
290 char *ignored; 279 char *ignored;
291 return (get_keyword (field, &ignored) != ((char *) NULL)); 280 return (get_keyword (field, &ignored) != ((char *) NULL));
@@ -302,9 +291,7 @@ has_keyword (field)
302 the caller has to make it big enough. */ 291 the caller has to make it big enough. */
303 292
304char * 293char *
305add_field (the_list, field, where) 294add_field (line_list the_list, register char *field, register char *where)
306 line_list the_list;
307 register char *field, *where;
308{ 295{
309 register char c; 296 register char c;
310 while (true) 297 while (true)
@@ -360,7 +347,7 @@ add_field (the_list, field, where)
360} 347}
361 348
362line_list 349line_list
363make_file_preface () 350make_file_preface (void)
364{ 351{
365 char *the_string, *temp; 352 char *the_string, *temp;
366 long idiotic_interface; 353 long idiotic_interface;
@@ -404,9 +391,7 @@ make_file_preface ()
404} 391}
405 392
406void 393void
407write_line_list (the_list, the_stream) 394write_line_list (register line_list the_list, FILE *the_stream)
408 register line_list the_list;
409 FILE *the_stream;
410{ 395{
411 for ( ; 396 for ( ;
412 the_list != ((line_list) NULL) ; 397 the_list != ((line_list) NULL) ;
@@ -419,7 +404,7 @@ write_line_list (the_list, the_stream)
419} 404}
420 405
421int 406int
422close_the_streams () 407close_the_streams (void)
423{ 408{
424 register stream_list rem; 409 register stream_list rem;
425 for (rem = the_streams; 410 for (rem = the_streams;
@@ -432,9 +417,7 @@ close_the_streams ()
432} 417}
433 418
434void 419void
435add_a_stream (the_stream, closing_action) 420add_a_stream (FILE *the_stream, int (*closing_action) (FILE *))
436 FILE *the_stream;
437 int (*closing_action)();
438{ 421{
439 stream_list old = the_streams; 422 stream_list old = the_streams;
440 the_streams = new_stream (); 423 the_streams = new_stream ();
@@ -445,8 +428,7 @@ add_a_stream (the_stream, closing_action)
445} 428}
446 429
447int 430int
448my_fclose (the_file) 431my_fclose (FILE *the_file)
449 FILE *the_file;
450{ 432{
451 putc ('\n', the_file); 433 putc ('\n', the_file);
452 fflush (the_file); 434 fflush (the_file);
@@ -454,8 +436,7 @@ my_fclose (the_file)
454} 436}
455 437
456boolean 438boolean
457open_a_file (name) 439open_a_file (char *name)
458 char *name;
459{ 440{
460 FILE *the_stream = fopen (name, "a"); 441 FILE *the_stream = fopen (name, "a");
461 if (the_stream != ((FILE *) NULL)) 442 if (the_stream != ((FILE *) NULL))
@@ -470,8 +451,7 @@ open_a_file (name)
470} 451}
471 452
472void 453void
473put_string (s) 454put_string (char *s)
474 char *s;
475{ 455{
476 register stream_list rem; 456 register stream_list rem;
477 for (rem = the_streams; 457 for (rem = the_streams;
@@ -482,8 +462,7 @@ put_string (s)
482} 462}
483 463
484void 464void
485put_line (string) 465put_line (char *string)
486 char *string;
487{ 466{
488 register stream_list rem; 467 register stream_list rem;
489 for (rem = the_streams; 468 for (rem = the_streams;
@@ -543,9 +522,7 @@ put_line (string)
543 Call open_a_file for each file. */ 522 Call open_a_file for each file. */
544 523
545void 524void
546setup_files (the_list, field) 525setup_files (register line_list the_list, register char *field)
547 register line_list the_list;
548 register char *field;
549{ 526{
550 register char *start; 527 register char *start;
551 register char c; 528 register char c;
@@ -581,8 +558,7 @@ setup_files (the_list, field)
581 The result says how big to make the buffer to pass to parse_header. */ 558 The result says how big to make the buffer to pass to parse_header. */
582 559
583int 560int
584args_size (the_header) 561args_size (header the_header)
585 header the_header;
586{ 562{
587 register header old = the_header; 563 register header old = the_header;
588 register line_list rem; 564 register line_list rem;
@@ -613,9 +589,7 @@ args_size (the_header)
613 Also, if the header has any FCC fields, call setup_files for each one. */ 589 Also, if the header has any FCC fields, call setup_files for each one. */
614 590
615void 591void
616parse_header (the_header, where) 592parse_header (header the_header, register char *where)
617 header the_header;
618 register char *where;
619{ 593{
620 register header old = the_header; 594 register header old = the_header;
621 do 595 do
@@ -647,7 +621,7 @@ parse_header (the_header, where)
647 Continuation lines are grouped in the headers they continue. */ 621 Continuation lines are grouped in the headers they continue. */
648 622
649header 623header
650read_header () 624read_header (void)
651{ 625{
652 register header the_header = ((header) NULL); 626 register header the_header = ((header) NULL);
653 register line_list *next_line = ((line_list *) NULL); 627 register line_list *next_line = ((line_list *) NULL);
@@ -701,8 +675,7 @@ read_header ()
701} 675}
702 676
703void 677void
704write_header (the_header) 678write_header (header the_header)
705 header the_header;
706{ 679{
707 register header old = the_header; 680 register header old = the_header;
708 do 681 do
@@ -719,9 +692,7 @@ write_header (the_header)
719} 692}
720 693
721int 694int
722main (argc, argv) 695main (int argc, char **argv)
723 int argc;
724 char **argv;
725{ 696{
726 char *command_line; 697 char *command_line;
727 header the_header; 698 header the_header;
@@ -731,7 +702,7 @@ main (argc, argv)
731 register int size; 702 register int size;
732 FILE *the_pipe; 703 FILE *the_pipe;
733 704
734 extern char *getenv (); 705 extern char *getenv (const char *);
735 706
736 mail_program_name = getenv ("FAKEMAILER"); 707 mail_program_name = getenv ("FAKEMAILER");
737 if (!(mail_program_name && *mail_program_name)) 708 if (!(mail_program_name && *mail_program_name))
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index 91fadd81f5a..d730cac6814 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -49,12 +49,10 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
49int group_by = DEFAULT_GROUPING; 49int group_by = DEFAULT_GROUPING;
50char *progname; 50char *progname;
51 51
52void usage(); 52void usage(void);
53 53
54int 54int
55main (argc, argv) 55main (int argc, char **argv)
56 int argc;
57 char *argv[];
58{ 56{
59 register long address; 57 register long address;
60 char string[18]; 58 char string[18];
@@ -278,7 +276,7 @@ main (argc, argv)
278} 276}
279 277
280void 278void
281usage () 279usage (void)
282{ 280{
283 fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); 281 fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
284 exit (EXIT_FAILURE); 282 exit (EXIT_FAILURE);
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index eb15342ca5b..51c30f91d8f 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -67,9 +67,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) 67#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
68#endif 68#endif
69 69
70int scan_file (); 70int scan_file (char *filename);
71int scan_lisp_file (); 71int scan_lisp_file (char *filename, char *mode);
72int scan_c_file (); 72int scan_c_file (char *filename, char *mode);
73 73
74#ifdef MSDOS 74#ifdef MSDOS
75/* s/msdos.h defines this as sys_chdir, but we're not linking with the 75/* s/msdos.h defines this as sys_chdir, but we're not linking with the
@@ -91,8 +91,7 @@ char *progname;
91 91
92/* VARARGS1 */ 92/* VARARGS1 */
93void 93void
94error (s1, s2) 94error (char *s1, char *s2)
95 char *s1, *s2;
96{ 95{
97 fprintf (stderr, "%s: ", progname); 96 fprintf (stderr, "%s: ", progname);
98 fprintf (stderr, s1, s2); 97 fprintf (stderr, s1, s2);
@@ -103,8 +102,7 @@ error (s1, s2)
103 102
104/* VARARGS1 */ 103/* VARARGS1 */
105void 104void
106fatal (s1, s2) 105fatal (char *s1, char *s2)
107 char *s1, *s2;
108{ 106{
109 error (s1, s2); 107 error (s1, s2);
110 exit (EXIT_FAILURE); 108 exit (EXIT_FAILURE);
@@ -113,8 +111,7 @@ fatal (s1, s2)
113/* Like malloc but get fatal error if memory is exhausted. */ 111/* Like malloc but get fatal error if memory is exhausted. */
114 112
115void * 113void *
116xmalloc (size) 114xmalloc (unsigned int size)
117 unsigned int size;
118{ 115{
119 void *result = (void *) malloc (size); 116 void *result = (void *) malloc (size);
120 if (result == NULL) 117 if (result == NULL)
@@ -123,9 +120,7 @@ xmalloc (size)
123} 120}
124 121
125int 122int
126main (argc, argv) 123main (int argc, char **argv)
127 int argc;
128 char **argv;
129{ 124{
130 int i; 125 int i;
131 int err_count = 0; 126 int err_count = 0;
@@ -187,8 +182,7 @@ main (argc, argv)
187 182
188/* Add a source file name boundary marker in the output file. */ 183/* Add a source file name boundary marker in the output file. */
189void 184void
190put_filename (filename) 185put_filename (char *filename)
191 char *filename;
192{ 186{
193 char *tmp; 187 char *tmp;
194 188
@@ -207,8 +201,7 @@ put_filename (filename)
207/* Return 1 if file is not found, 0 if it is found. */ 201/* Return 1 if file is not found, 0 if it is found. */
208 202
209int 203int
210scan_file (filename) 204scan_file (char *filename)
211 char *filename;
212{ 205{
213 int len = strlen (filename); 206 int len = strlen (filename);
214 207
@@ -251,9 +244,7 @@ struct rcsoc_state
251 spaces are output first. */ 244 spaces are output first. */
252 245
253static INLINE void 246static INLINE void
254put_char (ch, state) 247put_char (int ch, struct rcsoc_state *state)
255 int ch;
256 struct rcsoc_state *state;
257{ 248{
258 int out_ch; 249 int out_ch;
259 do 250 do
@@ -286,9 +277,7 @@ put_char (ch, state)
286 keyword, but were in fact not. */ 277 keyword, but were in fact not. */
287 278
288static void 279static void
289scan_keyword_or_put_char (ch, state) 280scan_keyword_or_put_char (int ch, struct rcsoc_state *state)
290 int ch;
291 struct rcsoc_state *state;
292{ 281{
293 if (state->keyword 282 if (state->keyword
294 && *state->cur_keyword_ptr == ch 283 && *state->cur_keyword_ptr == ch
@@ -359,11 +348,7 @@ scan_keyword_or_put_char (ch, state)
359 true if any were encountered. */ 348 true if any were encountered. */
360 349
361int 350int
362read_c_string_or_comment (infile, printflag, comment, saw_usage) 351read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage)
363 FILE *infile;
364 int printflag;
365 int *saw_usage;
366 int comment;
367{ 352{
368 register int c; 353 register int c;
369 struct rcsoc_state state; 354 struct rcsoc_state state;
@@ -451,15 +436,12 @@ read_c_string_or_comment (infile, printflag, comment, saw_usage)
451 MINARGS and MAXARGS are the minimum and maximum number of arguments. */ 436 MINARGS and MAXARGS are the minimum and maximum number of arguments. */
452 437
453void 438void
454write_c_args (out, func, buf, minargs, maxargs) 439write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
455 FILE *out;
456 char *func, *buf;
457 int minargs, maxargs;
458{ 440{
459 register char *p; 441 register char *p;
460 int in_ident = 0; 442 int in_ident = 0;
461 int just_spaced = 0; 443 char *ident_start;
462 int need_space = 1; 444 int ident_length;
463 445
464 fprintf (out, "(fn"); 446 fprintf (out, "(fn");
465 447
@@ -469,9 +451,8 @@ write_c_args (out, func, buf, minargs, maxargs)
469 for (p = buf; *p; p++) 451 for (p = buf; *p; p++)
470 { 452 {
471 char c = *p; 453 char c = *p;
472 int ident_start = 0;
473 454
474 /* Notice when we start printing a new identifier. */ 455 /* Notice when a new identifier starts. */
475 if ((('A' <= c && c <= 'Z') 456 if ((('A' <= c && c <= 'Z')
476 || ('a' <= c && c <= 'z') 457 || ('a' <= c && c <= 'z')
477 || ('0' <= c && c <= '9') 458 || ('0' <= c && c <= '9')
@@ -481,55 +462,50 @@ write_c_args (out, func, buf, minargs, maxargs)
481 if (!in_ident) 462 if (!in_ident)
482 { 463 {
483 in_ident = 1; 464 in_ident = 1;
484 ident_start = 1; 465 ident_start = p;
485
486 if (need_space)
487 putc (' ', out);
488
489 if (minargs == 0 && maxargs > 0)
490 fprintf (out, "&optional ");
491 just_spaced = 1;
492
493 minargs--;
494 maxargs--;
495 } 466 }
496 else 467 else
497 in_ident = 0; 468 {
469 in_ident = 0;
470 ident_length = p - ident_start;
471 }
498 } 472 }
499 473
500 /* Print the C argument list as it would appear in lisp: 474 /* Found the end of an argument, write out the last seen
501 print underscores as hyphens, and print commas and newlines 475 identifier. */
502 as spaces. Collapse adjacent spaces into one. */ 476 if (c == ',' || c == ')')
503 if (c == '_')
504 c = '-';
505 else if (c == ',' || c == '\n')
506 c = ' ';
507
508 /* In C code, `default' is a reserved word, so we spell it
509 `defalt'; unmangle that here. */
510 if (ident_start
511 && strncmp (p, "defalt", 6) == 0
512 && ! (('A' <= p[6] && p[6] <= 'Z')
513 || ('a' <= p[6] && p[6] <= 'z')
514 || ('0' <= p[6] && p[6] <= '9')
515 || p[6] == '_'))
516 {
517 fprintf (out, "DEFAULT");
518 p += 5;
519 in_ident = 0;
520 just_spaced = 0;
521 }
522 else if (c != ' ' || !just_spaced)
523 { 477 {
524 if (c >= 'a' && c <= 'z') 478 if (strncmp (ident_start, "void", ident_length) == 0)
525 /* Upcase the letter. */ 479 continue;
526 c += 'A' - 'a'; 480
527 putc (c, out); 481 putc (' ', out);
528 } 482
483 if (minargs == 0 && maxargs > 0)
484 fprintf (out, "&optional ");
485
486 minargs--;
487 maxargs--;
529 488
530 just_spaced = c == ' '; 489 /* In C code, `default' is a reserved word, so we spell it
531 need_space = 0; 490 `defalt'; unmangle that here. */
491 if (strncmp (ident_start, "defalt", ident_length) == 0)
492 fprintf (out, "DEFAULT");
493 else
494 while (ident_length-- > 0)
495 {
496 c = *ident_start++;
497 if (c >= 'a' && c <= 'z')
498 /* Upcase the letter. */
499 c += 'A' - 'a';
500 else if (c == '_')
501 /* Print underscore as hyphen. */
502 c = '-';
503 putc (c, out);
504 }
505 }
532 } 506 }
507
508 putc (')', out);
533} 509}
534 510
535/* Read through a c file. If a .o file is named, 511/* Read through a c file. If a .o file is named,
@@ -538,8 +514,7 @@ write_c_args (out, func, buf, minargs, maxargs)
538 Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ 514 Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */
539 515
540int 516int
541scan_c_file (filename, mode) 517scan_c_file (char *filename, char *mode)
542 char *filename, *mode;
543{ 518{
544 FILE *infile; 519 FILE *infile;
545 register int c; 520 register int c;
@@ -815,8 +790,7 @@ scan_c_file (filename, mode)
815 */ 790 */
816 791
817void 792void
818skip_white (infile) 793skip_white (FILE *infile)
819 FILE *infile;
820{ 794{
821 char c = ' '; 795 char c = ' ';
822 while (c == ' ' || c == '\t' || c == '\n' || c == '\r') 796 while (c == ' ' || c == '\t' || c == '\n' || c == '\r')
@@ -825,9 +799,7 @@ skip_white (infile)
825} 799}
826 800
827void 801void
828read_lisp_symbol (infile, buffer) 802read_lisp_symbol (FILE *infile, char *buffer)
829 FILE *infile;
830 char *buffer;
831{ 803{
832 char c; 804 char c;
833 char *fillp = buffer; 805 char *fillp = buffer;
@@ -855,8 +827,7 @@ read_lisp_symbol (infile, buffer)
855} 827}
856 828
857int 829int
858scan_lisp_file (filename, mode) 830scan_lisp_file (char *filename, char *mode)
859 char *filename, *mode;
860{ 831{
861 FILE *infile; 832 FILE *infile;
862 register int c; 833 register int c;
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index cad3b838208..72a04ecff89 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -143,11 +143,11 @@ $(BLD)/ctags.$(O): ctags.c
143# 143#
144obj = dosfns.o msdos.o \ 144obj = dosfns.o msdos.o \
145 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ 145 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
146 fontset.o \ 146 fontset.o menu.o \
147 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ 147 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
148 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \ 148 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
149 font.o w32font.o \ 149 font.o w32font.o w32uniscribe.o \
150 dispnew.o frame.o scroll.o xdisp.o window.o \ 150 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
151 charset.o coding.o category.o ccl.o character.o chartab.o \ 151 charset.o coding.o category.o ccl.o character.o chartab.o \
152 cm.o term.o terminal.o xfaces.o \ 152 cm.o term.o terminal.o xfaces.o \
153 emacs.o keyboard.o macros.o keymap.o sysdep.o \ 153 emacs.o keyboard.o macros.o keymap.o sysdep.o \
@@ -157,7 +157,7 @@ obj = dosfns.o msdos.o \
157 alloc.o data.o doc.o editfns.o callint.o \ 157 alloc.o data.o doc.o editfns.o callint.o \
158 eval.o floatfns.o fns.o print.o lread.o \ 158 eval.o floatfns.o fns.o print.o lread.o \
159 syntax.o bytecode.o \ 159 syntax.o bytecode.o \
160 process.o callproc.o \ 160 process.o callproc.o unexw32.o \
161 region-cache.o sound.o atimer.o \ 161 region-cache.o sound.o atimer.o \
162 doprnt.o strftime.o intervals.o textprop.o composite.o md5.o 162 doprnt.o strftime.o intervals.o textprop.o composite.o md5.o
163 163
@@ -247,7 +247,7 @@ lisp2 = \
247 $(lispsource)language/slovak.el \ 247 $(lispsource)language/slovak.el \
248 $(lispsource)language/romanian.el \ 248 $(lispsource)language/romanian.el \
249 $(lispsource)language/greek.el \ 249 $(lispsource)language/greek.el \
250 $(lispsource)language/hebrew.el \ 250 $(lispsource)language/hebrew.elc \
251 $(lispsource)language/japanese.el \ 251 $(lispsource)language/japanese.el \
252 $(lispsource)language/korean.el \ 252 $(lispsource)language/korean.el \
253 $(lispsource)language/lao.el \ 253 $(lispsource)language/lao.el \
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index ea307241351..541edf545df 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -69,6 +69,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
69#ifdef HAVE_FCNTL_H 69#ifdef HAVE_FCNTL_H
70#include <fcntl.h> 70#include <fcntl.h>
71#endif 71#endif
72#ifdef HAVE_STRING_H
73#include <string.h>
74#endif
72#include "syswait.h" 75#include "syswait.h"
73#ifdef MAIL_USE_POP 76#ifdef MAIL_USE_POP
74#include "pop.h" 77#include "pop.h"
@@ -140,33 +143,29 @@ static char *mail_spool_name ();
140#endif 143#endif
141#endif 144#endif
142 145
143char *strerror (); 146#ifndef HAVE_STRERROR
144#ifdef HAVE_INDEX 147char *strerror (int);
145extern char *index __P ((const char *, int));
146#endif
147#ifdef HAVE_RINDEX
148extern char *rindex __P((const char *, int));
149#endif 148#endif
150 149
151void fatal (); 150static void fatal (char *s1, char *s2, char *s3);
152void error (); 151static void error (char *s1, char *s2, char *s3);
153void pfatal_with_name (); 152static void pfatal_with_name (char *name);
154void pfatal_and_delete (); 153static void pfatal_and_delete (char *name);
155char *concat (); 154static char *concat (char *s1, char *s2, char *s3);
156long *xmalloc (); 155static long *xmalloc (unsigned int size);
157int popmail (); 156#ifdef MAIL_USE_POP
158int pop_retr (); 157static int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order);
159int mbx_write (); 158static int pop_retr (popserver server, int msgno, FILE *arg);
160int mbx_delimit_begin (); 159static int mbx_write (char *line, int len, FILE *mbf);
161int mbx_delimit_end (); 160static int mbx_delimit_begin (FILE *mbf);
161static int mbx_delimit_end (FILE *mbf);
162#endif
162 163
163/* Nonzero means this is name of a lock file to delete on fatal error. */ 164/* Nonzero means this is name of a lock file to delete on fatal error. */
164char *delete_lockname; 165char *delete_lockname;
165 166
166int 167int
167main (argc, argv) 168main (int argc, char **argv)
168 int argc;
169 char **argv;
170{ 169{
171 char *inname, *outname; 170 char *inname, *outname;
172 int indesc, outdesc; 171 int indesc, outdesc;
@@ -559,7 +558,7 @@ mail_spool_name (inname)
559 char *indir, *fname; 558 char *indir, *fname;
560 int status; 559 int status;
561 560
562 if (! (fname = rindex (inname, '/'))) 561 if (! (fname = strrchr (inname, '/')))
563 return NULL; 562 return NULL;
564 563
565 fname++; 564 fname++;
@@ -589,9 +588,8 @@ mail_spool_name (inname)
589 588
590/* Print error message and exit. */ 589/* Print error message and exit. */
591 590
592void 591static void
593fatal (s1, s2, s3) 592fatal (char *s1, char *s2, char *s3)
594 char *s1, *s2, *s3;
595{ 593{
596 if (delete_lockname) 594 if (delete_lockname)
597 unlink (delete_lockname); 595 unlink (delete_lockname);
@@ -602,9 +600,8 @@ fatal (s1, s2, s3)
602/* Print error message. `s1' is printf control string, `s2' and `s3' 600/* Print error message. `s1' is printf control string, `s2' and `s3'
603 are args for it or null. */ 601 are args for it or null. */
604 602
605void 603static void
606error (s1, s2, s3) 604error (char *s1, char *s2, char *s3)
607 char *s1, *s2, *s3;
608{ 605{
609 fprintf (stderr, "movemail: "); 606 fprintf (stderr, "movemail: ");
610 if (s3) 607 if (s3)
@@ -612,20 +609,18 @@ error (s1, s2, s3)
612 else if (s2) 609 else if (s2)
613 fprintf (stderr, s1, s2); 610 fprintf (stderr, s1, s2);
614 else 611 else
615 fprintf (stderr, s1); 612 fprintf (stderr, "%s", s1);
616 fprintf (stderr, "\n"); 613 fprintf (stderr, "\n");
617} 614}
618 615
619void 616static void
620pfatal_with_name (name) 617pfatal_with_name (char *name)
621 char *name;
622{ 618{
623 fatal ("%s for %s", strerror (errno), name); 619 fatal ("%s for %s", strerror (errno), name);
624} 620}
625 621
626void 622static void
627pfatal_and_delete (name) 623pfatal_and_delete (char *name)
628 char *name;
629{ 624{
630 char *s = strerror (errno); 625 char *s = strerror (errno);
631 unlink (name); 626 unlink (name);
@@ -634,9 +629,8 @@ pfatal_and_delete (name)
634 629
635/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ 630/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
636 631
637char * 632static char *
638concat (s1, s2, s3) 633concat (char *s1, char *s2, char *s3)
639 char *s1, *s2, *s3;
640{ 634{
641 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); 635 int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
642 char *result = (char *) xmalloc (len1 + len2 + len3 + 1); 636 char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
@@ -651,9 +645,8 @@ concat (s1, s2, s3)
651 645
652/* Like malloc but get fatal error if memory is exhausted. */ 646/* Like malloc but get fatal error if memory is exhausted. */
653 647
654long * 648static long *
655xmalloc (size) 649xmalloc (unsigned int size)
656 unsigned size;
657{ 650{
658 long *result = (long *) malloc (size); 651 long *result = (long *) malloc (size);
659 if (!result) 652 if (!result)
@@ -702,25 +695,20 @@ char Errmsg[200]; /* POP errors, at least, can exceed
702 * Return a value suitable for passing to `exit'. 695 * Return a value suitable for passing to `exit'.
703 */ 696 */
704 697
705int 698static int
706popmail (mailbox, outfile, preserve, password, reverse_order) 699popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order)
707 char *mailbox;
708 char *outfile;
709 int preserve;
710 char *password;
711 int reverse_order;
712{ 700{
713 int nmsgs, nbytes; 701 int nmsgs, nbytes;
714 register int i; 702 register int i;
715 int mbfi; 703 int mbfi;
716 FILE *mbf; 704 FILE *mbf;
717 char *getenv (); 705 char *getenv (const char *);
718 popserver server; 706 popserver server;
719 int start, end, increment; 707 int start, end, increment;
720 char *user, *hostname; 708 char *user, *hostname;
721 709
722 user = mailbox; 710 user = mailbox;
723 if ((hostname = index(mailbox, ':'))) 711 if ((hostname = strchr (mailbox, ':')))
724 *hostname++ = '\0'; 712 *hostname++ = '\0';
725 713
726 server = pop_open (hostname, user, password, POP_NO_GETPASS); 714 server = pop_open (hostname, user, password, POP_NO_GETPASS);
@@ -833,13 +821,9 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
833 return EXIT_SUCCESS; 821 return EXIT_SUCCESS;
834} 822}
835 823
836int 824static int
837pop_retr (server, msgno, arg) 825pop_retr (popserver server, int msgno, FILE *arg)
838 popserver server;
839 int msgno;
840 FILE *arg;
841{ 826{
842 extern char *strerror ();
843 char *line; 827 char *line;
844 int ret; 828 int ret;
845 829
@@ -884,11 +868,8 @@ pop_retr (server, msgno, arg)
884 && (a[3] == 'm') \ 868 && (a[3] == 'm') \
885 && (a[4] == ' ')) 869 && (a[4] == ' '))
886 870
887int 871static int
888mbx_write (line, len, mbf) 872mbx_write (char *line, int len, FILE *mbf)
889 char *line;
890 int len;
891 FILE *mbf;
892{ 873{
893#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES 874#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
894 if (IS_FROM_LINE (line)) 875 if (IS_FROM_LINE (line))
@@ -911,9 +892,8 @@ mbx_write (line, len, mbf)
911 return (OK); 892 return (OK);
912} 893}
913 894
914int 895static int
915mbx_delimit_begin (mbf) 896mbx_delimit_begin (FILE *mbf)
916 FILE *mbf;
917{ 897{
918 time_t now; 898 time_t now;
919 struct tm *ltime; 899 struct tm *ltime;
@@ -929,9 +909,8 @@ mbx_delimit_begin (mbf)
929 return (OK); 909 return (OK);
930} 910}
931 911
932int 912static int
933mbx_delimit_end (mbf) 913mbx_delimit_end (FILE *mbf)
934 FILE *mbf;
935{ 914{
936 if (putc ('\n', mbf) == EOF) 915 if (putc ('\n', mbf) == EOF)
937 return (NOTOK); 916 return (NOTOK);
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index c815f32d51d..c24b35d9a19 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -38,7 +38,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
38 would necessitate including windows.h in the files that used it. 38 would necessitate including windows.h in the files that used it.
39 This is much easier. */ 39 This is much easier. */
40void 40void
41sleep(unsigned long seconds) 41sleep (unsigned long seconds)
42{ 42{
43 Sleep (seconds * 1000); 43 Sleep (seconds * 1000);
44} 44}
@@ -56,7 +56,7 @@ static HANDLE getppid_parent;
56static int getppid_ppid; 56static int getppid_ppid;
57 57
58int 58int
59getppid(void) 59getppid (void)
60{ 60{
61 char *ppid; 61 char *ppid;
62 DWORD result; 62 DWORD result;
@@ -64,7 +64,7 @@ getppid(void)
64 ppid = getenv ("EM_PARENT_PROCESS_ID"); 64 ppid = getenv ("EM_PARENT_PROCESS_ID");
65 if (!ppid) 65 if (!ppid)
66 { 66 {
67 printf("no pid.\n"); 67 printf ("no pid.\n");
68 return 0; 68 return 0;
69 } 69 }
70 else 70 else
@@ -74,11 +74,11 @@ getppid(void)
74 74
75 if (!getppid_parent) 75 if (!getppid_parent)
76 { 76 {
77 getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid)); 77 getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi (ppid));
78 if (!getppid_parent) 78 if (!getppid_parent)
79 { 79 {
80 printf ("Failed to open handle to parent process: %d\n", 80 printf ("Failed to open handle to parent process: %d\n",
81 GetLastError()); 81 GetLastError ());
82 exit (1); 82 exit (1);
83 } 83 }
84 } 84 }
@@ -94,13 +94,13 @@ getppid(void)
94 return 1; 94 return 1;
95 case WAIT_FAILED: 95 case WAIT_FAILED:
96 default: 96 default:
97 printf ("Checking parent status failed: %d\n", GetLastError()); 97 printf ("Checking parent status failed: %d\n", GetLastError ());
98 exit (1); 98 exit (1);
99 } 99 }
100} 100}
101 101
102char * 102char *
103getlogin () 103getlogin (void)
104{ 104{
105 static char user_name[256]; 105 static char user_name[256];
106 DWORD length = sizeof (user_name); 106 DWORD length = sizeof (user_name);
@@ -120,19 +120,19 @@ cuserid (char * s)
120} 120}
121 121
122unsigned 122unsigned
123getuid () 123getuid (void)
124{ 124{
125 return 0; 125 return 0;
126} 126}
127 127
128unsigned 128unsigned
129getgid () 129getgid (void)
130{ 130{
131 return 0; 131 return 0;
132} 132}
133 133
134unsigned 134unsigned
135getegid () 135getegid (void)
136{ 136{
137 return 0; 137 return 0;
138} 138}
@@ -219,7 +219,7 @@ sys_ctime (const time_t *t)
219} 219}
220 220
221FILE * 221FILE *
222sys_fopen(const char * path, const char * mode) 222sys_fopen (const char * path, const char * mode)
223{ 223{
224 return fopen (path, mode); 224 return fopen (path, mode);
225} 225}
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 64488e7e3ea..26a992fa0b0 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -108,24 +108,16 @@ extern int h_errno;
108#endif 108#endif
109#endif 109#endif
110 110
111#ifndef __P 111static int socket_connection (char *, int);
112# ifdef __STDC__ 112static int pop_getline (popserver, char **);
113# define __P(a) a 113static int sendline (popserver, char *);
114# else 114static int fullwrite (int, char *, int);
115# define __P(a) () 115static int getok (popserver);
116# endif /* __STDC__ */
117#endif /* ! __P */
118
119static int socket_connection __P((char *, int));
120static int pop_getline __P((popserver, char **));
121static int sendline __P((popserver, char *));
122static int fullwrite __P((int, char *, int));
123static int getok __P((popserver));
124#if 0 116#if 0
125static int gettermination __P((popserver)); 117static int gettermination (popserver);
126#endif 118#endif
127static void pop_trash __P((popserver)); 119static void pop_trash (popserver);
128static char *find_crlf __P((char *, int)); 120static char *find_crlf (char *, int);
129 121
130#define ERROR_MAX 160 /* a pretty arbitrary size, but needs 122#define ERROR_MAX 160 /* a pretty arbitrary size, but needs
131 to be bigger than the original 123 to be bigger than the original
@@ -174,11 +166,7 @@ int pop_debug = 0;
174 * explanation of the error. 166 * explanation of the error.
175 */ 167 */
176popserver 168popserver
177pop_open (host, username, password, flags) 169pop_open (char *host, char *username, char *password, int flags)
178 char *host;
179 char *username;
180 char *password;
181 int flags;
182{ 170{
183 int sock; 171 int sock;
184 popserver server; 172 popserver server;
@@ -345,10 +333,7 @@ pop_open (host, username, password, flags)
345 * connection impossible. 333 * connection impossible.
346 */ 334 */
347int 335int
348pop_stat (server, count, size) 336pop_stat (popserver server, int *count, int *size)
349 popserver server;
350 int *count;
351 int *size;
352{ 337{
353 char *fromserver; 338 char *fromserver;
354 char *end_ptr; 339 char *end_ptr;
@@ -421,11 +406,7 @@ pop_stat (server, count, size)
421 * connection impossible. 406 * connection impossible.
422 */ 407 */
423int 408int
424pop_list (server, message, IDs, sizes) 409pop_list (popserver server, int message, int **IDs, int **sizes)
425 popserver server;
426 int message;
427 int **IDs;
428 int **sizes;
429{ 410{
430 int how_many, i; 411 int how_many, i;
431 char *fromserver; 412 char *fromserver;
@@ -484,7 +465,7 @@ pop_list (server, message, IDs, sizes)
484 return (-1); 465 return (-1);
485 } 466 }
486 (*IDs)[0] = atoi (&fromserver[4]); 467 (*IDs)[0] = atoi (&fromserver[4]);
487 fromserver = index (&fromserver[4], ' '); 468 fromserver = strchr (&fromserver[4], ' ');
488 if (! fromserver) 469 if (! fromserver)
489 { 470 {
490 strcpy (pop_error, 471 strcpy (pop_error,
@@ -515,7 +496,7 @@ pop_list (server, message, IDs, sizes)
515 return (-1); 496 return (-1);
516 } 497 }
517 (*IDs)[i] = atoi (fromserver); 498 (*IDs)[i] = atoi (fromserver);
518 fromserver = index (fromserver, ' '); 499 fromserver = strchr (fromserver, ' ');
519 if (! fromserver) 500 if (! fromserver)
520 { 501 {
521 strcpy (pop_error, 502 strcpy (pop_error,
@@ -567,11 +548,7 @@ pop_list (server, message, IDs, sizes)
567 * Side effects: May kill connection on error. 548 * Side effects: May kill connection on error.
568 */ 549 */
569int 550int
570pop_retrieve (server, message, markfrom, msg_buf) 551pop_retrieve (popserver server, int message, int markfrom, char **msg_buf)
571 popserver server;
572 int message;
573 int markfrom;
574 char **msg_buf;
575{ 552{
576 int *IDs, *sizes, bufsize, fromcount = 0, cp = 0; 553 int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
577 char *ptr, *fromserver; 554 char *ptr, *fromserver;
@@ -635,7 +612,7 @@ pop_retrieve (server, message, markfrom, msg_buf)
635 } 612 }
636 ptr[cp++] = '>'; 613 ptr[cp++] = '>';
637 } 614 }
638 bcopy (fromserver, &ptr[cp], ret); 615 memcpy (&ptr[cp], fromserver, ret);
639 cp += ret; 616 cp += ret;
640 ptr[cp++] = '\n'; 617 ptr[cp++] = '\n';
641 } 618 }
@@ -645,10 +622,7 @@ pop_retrieve (server, message, markfrom, msg_buf)
645} 622}
646 623
647int 624int
648pop_retrieve_first (server, message, response) 625pop_retrieve_first (popserver server, int message, char **response)
649 popserver server;
650 int message;
651 char **response;
652{ 626{
653 sprintf (pop_error, "RETR %d", message); 627 sprintf (pop_error, "RETR %d", message);
654 return (pop_multi_first (server, pop_error, response)); 628 return (pop_multi_first (server, pop_error, response));
@@ -663,25 +637,19 @@ pop_retrieve_first (server, message, response)
663 */ 637 */
664 638
665int 639int
666pop_retrieve_next (server, line) 640pop_retrieve_next (popserver server, char **line)
667 popserver server;
668 char **line;
669{ 641{
670 return (pop_multi_next (server, line)); 642 return (pop_multi_next (server, line));
671} 643}
672 644
673int 645int
674pop_retrieve_flush (server) 646pop_retrieve_flush (popserver server)
675 popserver server;
676{ 647{
677 return (pop_multi_flush (server)); 648 return (pop_multi_flush (server));
678} 649}
679 650
680int 651int
681pop_top_first (server, message, lines, response) 652pop_top_first (popserver server, int message, int lines, char **response)
682 popserver server;
683 int message, lines;
684 char **response;
685{ 653{
686 sprintf (pop_error, "TOP %d %d", message, lines); 654 sprintf (pop_error, "TOP %d %d", message, lines);
687 return (pop_multi_first (server, pop_error, response)); 655 return (pop_multi_first (server, pop_error, response));
@@ -696,25 +664,19 @@ pop_top_first (server, message, lines, response)
696 */ 664 */
697 665
698int 666int
699pop_top_next (server, line) 667pop_top_next (popserver server, char **line)
700 popserver server;
701 char **line;
702{ 668{
703 return (pop_multi_next (server, line)); 669 return (pop_multi_next (server, line));
704} 670}
705 671
706int 672int
707pop_top_flush (server) 673pop_top_flush (popserver server)
708 popserver server;
709{ 674{
710 return (pop_multi_flush (server)); 675 return (pop_multi_flush (server));
711} 676}
712 677
713int 678int
714pop_multi_first (server, command, response) 679pop_multi_first (popserver server, char *command, char **response)
715 popserver server;
716 char *command;
717 char **response;
718{ 680{
719 if (server->in_multi) 681 if (server->in_multi)
720 { 682 {
@@ -757,9 +719,7 @@ pop_multi_first (server, command, response)
757 0, LINE is set to null. */ 719 0, LINE is set to null. */
758 720
759int 721int
760pop_multi_next (server, line) 722pop_multi_next (popserver server, char **line)
761 popserver server;
762 char **line;
763{ 723{
764 char *fromserver; 724 char *fromserver;
765 int ret; 725 int ret;
@@ -797,8 +757,7 @@ pop_multi_next (server, line)
797} 757}
798 758
799int 759int
800pop_multi_flush (server) 760pop_multi_flush (popserver server)
801 popserver server;
802{ 761{
803 char *line; 762 char *line;
804 int ret; 763 int ret;
@@ -829,9 +788,7 @@ pop_multi_flush (server)
829 * otherwise. 788 * otherwise.
830 */ 789 */
831int 790int
832pop_delete (server, message) 791pop_delete (popserver server, int message)
833 popserver server;
834 int message;
835{ 792{
836 if (server->in_multi) 793 if (server->in_multi)
837 { 794 {
@@ -861,8 +818,7 @@ pop_delete (server, message)
861 * Side effects: Closes connection on error. 818 * Side effects: Closes connection on error.
862 */ 819 */
863int 820int
864pop_noop (server) 821pop_noop (popserver server)
865 popserver server;
866{ 822{
867 if (server->in_multi) 823 if (server->in_multi)
868 { 824 {
@@ -891,8 +847,7 @@ pop_noop (server)
891 * Side effects: Closes the connection on error. 847 * Side effects: Closes the connection on error.
892 */ 848 */
893int 849int
894pop_last (server) 850pop_last (popserver server)
895 popserver server;
896{ 851{
897 char *fromserver; 852 char *fromserver;
898 853
@@ -949,8 +904,7 @@ pop_last (server)
949 * Side effects: Closes the connection on error. 904 * Side effects: Closes the connection on error.
950 */ 905 */
951int 906int
952pop_reset (server) 907pop_reset (popserver server)
953 popserver server;
954{ 908{
955 if (pop_retrieve_flush (server)) 909 if (pop_retrieve_flush (server))
956 { 910 {
@@ -978,8 +932,7 @@ pop_reset (server)
978 * function is called, even if an error occurs. 932 * function is called, even if an error occurs.
979 */ 933 */
980int 934int
981pop_quit (server) 935pop_quit (popserver server)
982 popserver server;
983{ 936{
984 int ret = 0; 937 int ret = 0;
985 938
@@ -1023,9 +976,7 @@ static int have_winsock = 0;
1023 * into pop_error. 976 * into pop_error.
1024 */ 977 */
1025static int 978static int
1026socket_connection (host, flags) 979socket_connection (char *host, int flags)
1027 char *host;
1028 int flags;
1029{ 980{
1030#ifdef HAVE_GETADDRINFO 981#ifdef HAVE_GETADDRINFO
1031 struct addrinfo *res, *it; 982 struct addrinfo *res, *it;
@@ -1069,7 +1020,7 @@ socket_connection (host, flags)
1069 } 1020 }
1070#endif 1021#endif
1071 1022
1072 bzero ((char *) &addr, sizeof (addr)); 1023 memset (&addr, 0, sizeof (addr));
1073 addr.sin_family = AF_INET; 1024 addr.sin_family = AF_INET;
1074 1025
1075 /** "kpop" service is never used: look for 20060515 to see why **/ 1026 /** "kpop" service is never used: look for 20060515 to see why **/
@@ -1145,8 +1096,7 @@ socket_connection (host, flags)
1145 if (it->ai_addrlen == sizeof (addr)) 1096 if (it->ai_addrlen == sizeof (addr))
1146 { 1097 {
1147 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; 1098 struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
1148 bcopy (&in_a->sin_addr, (char *) &addr.sin_addr, 1099 memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr));
1149 sizeof (addr.sin_addr));
1150 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) 1100 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
1151 break; 1101 break;
1152 } 1102 }
@@ -1174,8 +1124,7 @@ socket_connection (host, flags)
1174 1124
1175 while (*hostent->h_addr_list) 1125 while (*hostent->h_addr_list)
1176 { 1126 {
1177 bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr, 1127 memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length);
1178 hostent->h_length);
1179 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) 1128 if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
1180 break; 1129 break;
1181 hostent->h_addr_list++; 1130 hostent->h_addr_list++;
@@ -1335,9 +1284,7 @@ socket_connection (host, flags)
1335 * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS! 1284 * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS!
1336 */ 1285 */
1337static int 1286static int
1338pop_getline (server, line) 1287pop_getline (popserver server, char **line)
1339 popserver server;
1340 char **line;
1341{ 1288{
1342#define GETLINE_ERROR "Error reading from server: " 1289#define GETLINE_ERROR "Error reading from server: "
1343 1290
@@ -1369,8 +1316,8 @@ pop_getline (server, line)
1369 } 1316 }
1370 else 1317 else
1371 { 1318 {
1372 bcopy (server->buffer + server->buffer_index, 1319 memmove (server->buffer, server->buffer + server->buffer_index,
1373 server->buffer, server->data); 1320 server->data);
1374 /* Record the fact that we've searched the data already in 1321 /* Record the fact that we've searched the data already in
1375 the buffer for a CRLF, so that when we search below, we 1322 the buffer for a CRLF, so that when we search below, we
1376 don't have to search the same data twice. There's a "- 1323 don't have to search the same data twice. There's a "-
@@ -1467,9 +1414,7 @@ pop_getline (server, line)
1467 * Side effects: Closes the connection on error. 1414 * Side effects: Closes the connection on error.
1468 */ 1415 */
1469static int 1416static int
1470sendline (server, line) 1417sendline (popserver server, char *line)
1471 popserver server;
1472 char *line;
1473{ 1418{
1474#define SENDLINE_ERROR "Error writing to POP server: " 1419#define SENDLINE_ERROR "Error writing to POP server: "
1475 int ret; 1420 int ret;
@@ -1516,10 +1461,7 @@ sendline (server, line)
1516 * Return value: Same as write. Pop_error is not set. 1461 * Return value: Same as write. Pop_error is not set.
1517 */ 1462 */
1518static int 1463static int
1519fullwrite (fd, buf, nbytes) 1464fullwrite (int fd, char *buf, int nbytes)
1520 int fd;
1521 char *buf;
1522 int nbytes;
1523{ 1465{
1524 char *cp; 1466 char *cp;
1525 int ret = 0; 1467 int ret = 0;
@@ -1549,8 +1491,7 @@ fullwrite (fd, buf, nbytes)
1549 * Side effects: On failure, may make the connection unusable. 1491 * Side effects: On failure, may make the connection unusable.
1550 */ 1492 */
1551static int 1493static int
1552getok (server) 1494getok (popserver server)
1553 popserver server;
1554{ 1495{
1555 char *fromline; 1496 char *fromline;
1556 1497
@@ -1621,8 +1562,7 @@ gettermination (server)
1621 * since the last pop_reset) may be lost. 1562 * since the last pop_reset) may be lost.
1622 */ 1563 */
1623void 1564void
1624pop_close (server) 1565pop_close (popserver server)
1625 popserver server;
1626{ 1566{
1627 pop_trash (server); 1567 pop_trash (server);
1628 free ((char *) server); 1568 free ((char *) server);
@@ -1638,8 +1578,7 @@ pop_close (server)
1638 * pop_close or pop_quit after this function has been called. 1578 * pop_close or pop_quit after this function has been called.
1639 */ 1579 */
1640static void 1580static void
1641pop_trash (server) 1581pop_trash (popserver server)
1642 popserver server;
1643{ 1582{
1644 if (server->file >= 0) 1583 if (server->file >= 0)
1645 { 1584 {
@@ -1671,9 +1610,7 @@ pop_trash (server)
1671 null, or 0 if it does not contain one. */ 1610 null, or 0 if it does not contain one. */
1672 1611
1673static char * 1612static char *
1674find_crlf (in_string, len) 1613find_crlf (char *in_string, int len)
1675 char *in_string;
1676 int len;
1677{ 1614{
1678 while (len--) 1615 while (len--)
1679 { 1616 {
diff --git a/lib-src/profile.c b/lib-src/profile.c
index 0347350a799..37653e63c49 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -40,7 +40,7 @@ static char time_string[30];
40/* Reset the stopwatch to zero. */ 40/* Reset the stopwatch to zero. */
41 41
42void 42void
43reset_watch () 43reset_watch (void)
44{ 44{
45 EMACS_GET_TIME (TV1); 45 EMACS_GET_TIME (TV1);
46 watch_not_started = 0; 46 watch_not_started = 0;
@@ -51,7 +51,7 @@ reset_watch ()
51 If reset_watch was not called yet, exit. */ 51 If reset_watch was not called yet, exit. */
52 52
53char * 53char *
54get_time () 54get_time (void)
55{ 55{
56 if (watch_not_started) 56 if (watch_not_started)
57 exit (EXIT_FAILURE); /* call reset_watch first ! */ 57 exit (EXIT_FAILURE); /* call reset_watch first ! */
@@ -79,7 +79,7 @@ gettimeofday (tp, tzp)
79#endif 79#endif
80 80
81int 81int
82main () 82main (void)
83{ 83{
84 int c; 84 int c;
85 while ((c = getchar ()) != EOF) 85 while ((c = getchar ()) != EOF)
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c
index ce58529193a..595633b76d8 100644
--- a/lib-src/sorted-doc.c
+++ b/lib-src/sorted-doc.c
@@ -65,8 +65,7 @@ struct docstr /* Allocated thing for an entry. */
65/* Print error message. `s1' is printf control string, `s2' is arg for it. */ 65/* Print error message. `s1' is printf control string, `s2' is arg for it. */
66 66
67void 67void
68error (s1, s2) 68error (char *s1, char *s2)
69 char *s1, *s2;
70{ 69{
71 fprintf (stderr, "sorted-doc: "); 70 fprintf (stderr, "sorted-doc: ");
72 fprintf (stderr, s1, s2); 71 fprintf (stderr, s1, s2);
@@ -76,8 +75,7 @@ error (s1, s2)
76/* Print error message and exit. */ 75/* Print error message and exit. */
77 76
78void 77void
79fatal (s1, s2) 78fatal (char *s1, char *s2)
80 char *s1, *s2;
81{ 79{
82 error (s1, s2); 80 error (s1, s2);
83 exit (EXIT_FAILURE); 81 exit (EXIT_FAILURE);
@@ -86,8 +84,7 @@ fatal (s1, s2)
86/* Like malloc but get fatal error if memory is exhausted. */ 84/* Like malloc but get fatal error if memory is exhausted. */
87 85
88char * 86char *
89xmalloc (size) 87xmalloc (int size)
90 int size;
91{ 88{
92 char *result = malloc ((unsigned)size); 89 char *result = malloc ((unsigned)size);
93 if (result == NULL) 90 if (result == NULL)
@@ -96,8 +93,7 @@ xmalloc (size)
96} 93}
97 94
98char * 95char *
99xstrdup (str) 96xstrdup (char *str)
100 char * str;
101{ 97{
102 char *buf = xmalloc (strlen (str) + 1); 98 char *buf = xmalloc (strlen (str) + 1);
103 (void) strcpy (buf, str); 99 (void) strcpy (buf, str);
@@ -107,16 +103,15 @@ xstrdup (str)
107/* Comparison function for qsort to call. */ 103/* Comparison function for qsort to call. */
108 104
109int 105int
110cmpdoc (a, b) 106cmpdoc (const void *va, const void *vb)
111 DOCSTR **a;
112 DOCSTR **b;
113{ 107{
108 DOCSTR *const *a = va;
109 DOCSTR *const *b = vb;
114 register int val = strcmp ((*a)->name, (*b)->name); 110 register int val = strcmp ((*a)->name, (*b)->name);
115 if (val) return val; 111 if (val) return val;
116 return (*a)->type - (*b)->type; 112 return (*a)->type - (*b)->type;
117} 113}
118 114
119
120enum state 115enum state
121{ 116{
122 WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET 117 WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET
@@ -128,7 +123,7 @@ char *states[] =
128}; 123};
129 124
130int 125int
131main () 126main (void)
132{ 127{
133 register DOCSTR *dp = NULL; /* allocated DOCSTR */ 128 register DOCSTR *dp = NULL; /* allocated DOCSTR */
134 register LINE *lp = NULL; /* allocated line */ 129 register LINE *lp = NULL; /* allocated line */
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c
index a6c7c187f8a..880bd115882 100644
--- a/lib-src/test-distrib.c
+++ b/lib-src/test-distrib.c
@@ -52,10 +52,7 @@ char buf[300];
52 52
53/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ 53/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */
54int 54int
55cool_read (fd, buf, size) 55cool_read (int fd, char *buf, int size)
56 int fd;
57 char *buf;
58 int size;
59{ 56{
60 int num, sofar = 0; 57 int num, sofar = 0;
61 58
@@ -70,9 +67,7 @@ cool_read (fd, buf, size)
70} 67}
71 68
72int 69int
73main (argc, argv) 70main (int argc, char **argv)
74 int argc;
75 char **argv;
76{ 71{
77 int fd; 72 int fd;
78 73
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 24fd45f72d3..a96422a09a9 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -64,21 +64,13 @@ extern int optind, opterr;
64#define MAX_SCORES 200 64#define MAX_SCORES 200
65#define MAX_DATA_LEN 1024 65#define MAX_DATA_LEN 1024
66 66
67/* Declare the prototype for a general external function. */
68#if defined (PROTOTYPES) || defined (WINDOWSNT)
69#define P_(proto) proto
70#else
71#define P_(proto) ()
72#endif
73
74#ifndef HAVE_DIFFTIME 67#ifndef HAVE_DIFFTIME
75/* OK on POSIX (time_t is arithmetic type) modulo overflow in subtraction. */ 68/* OK on POSIX (time_t is arithmetic type) modulo overflow in subtraction. */
76#define difftime(t1, t0) (double)((t1) - (t0)) 69#define difftime(t1, t0) (double)((t1) - (t0))
77#endif 70#endif
78 71
79int 72int
80usage (err) 73usage (int err)
81 int err;
82{ 74{
83 fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); 75 fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n");
84 fprintf (stdout, " update-game-score -h\n"); 76 fprintf (stdout, " update-game-score -h\n");
@@ -89,8 +81,8 @@ usage (err)
89 exit (err); 81 exit (err);
90} 82}
91 83
92int lock_file P_ ((const char *filename, void **state)); 84int lock_file (const char *filename, void **state);
93int unlock_file P_ ((const char *filename, void *state)); 85int unlock_file (const char *filename, void *state);
94 86
95struct score_entry 87struct score_entry
96{ 88{
@@ -99,25 +91,24 @@ struct score_entry
99 char *data; 91 char *data;
100}; 92};
101 93
102int read_scores P_ ((const char *filename, struct score_entry **scores, 94int read_scores (const char *filename, struct score_entry **scores,
103 int *count)); 95 int *count);
104int push_score P_ ((struct score_entry **scores, int *count, 96int push_score (struct score_entry **scores, int *count,
105 int newscore, char *username, char *newdata)); 97 int newscore, char *username, char *newdata);
106void sort_scores P_ ((struct score_entry *scores, int count, int reverse)); 98void sort_scores (struct score_entry *scores, int count, int reverse);
107int write_scores P_ ((const char *filename, const struct score_entry *scores, 99int write_scores (const char *filename, const struct score_entry *scores,
108 int count)); 100 int count);
109 101
110void lose P_ ((const char *msg)) NO_RETURN; 102void lose (const char *msg) NO_RETURN;
111 103
112void 104void
113lose (msg) 105lose (const char *msg)
114 const char *msg;
115{ 106{
116 fprintf (stderr, "%s\n", msg); 107 fprintf (stderr, "%s\n", msg);
117 exit (EXIT_FAILURE); 108 exit (EXIT_FAILURE);
118} 109}
119 110
120void lose_syserr P_ ((const char *msg)) NO_RETURN; 111void lose_syserr (const char *msg) NO_RETURN;
121 112
122/* Taken from sysdep.c. */ 113/* Taken from sysdep.c. */
123#ifndef HAVE_STRERROR 114#ifndef HAVE_STRERROR
@@ -137,15 +128,14 @@ strerror (errnum)
137#endif /* ! HAVE_STRERROR */ 128#endif /* ! HAVE_STRERROR */
138 129
139void 130void
140lose_syserr (msg) 131lose_syserr (const char *msg)
141 const char *msg;
142{ 132{
143 fprintf (stderr, "%s: %s\n", msg, strerror (errno)); 133 fprintf (stderr, "%s: %s\n", msg, strerror (errno));
144 exit (EXIT_FAILURE); 134 exit (EXIT_FAILURE);
145} 135}
146 136
147char * 137char *
148get_user_id P_ ((void)) 138get_user_id (void)
149{ 139{
150 char *name; 140 char *name;
151 struct passwd *buf = getpwuid (getuid ()); 141 struct passwd *buf = getpwuid (getuid ());
@@ -166,9 +156,7 @@ get_user_id P_ ((void))
166} 156}
167 157
168char * 158char *
169get_prefix (running_suid, user_prefix) 159get_prefix (int running_suid, char *user_prefix)
170 int running_suid;
171 char *user_prefix;
172{ 160{
173 if (!running_suid && user_prefix == NULL) 161 if (!running_suid && user_prefix == NULL)
174 lose ("Not using a shared game directory, and no prefix given."); 162 lose ("Not using a shared game directory, and no prefix given.");
@@ -184,9 +172,7 @@ get_prefix (running_suid, user_prefix)
184} 172}
185 173
186int 174int
187main (argc, argv) 175main (int argc, char **argv)
188 int argc;
189 char **argv;
190{ 176{
191 int c, running_suid; 177 int c, running_suid;
192 void *lockstate; 178 void *lockstate;
@@ -273,9 +259,7 @@ main (argc, argv)
273} 259}
274 260
275int 261int
276read_score (f, score) 262read_score (FILE *f, struct score_entry *score)
277 FILE *f;
278 struct score_entry *score;
279{ 263{
280 int c; 264 int c;
281 if (feof (f)) 265 if (feof (f))
@@ -359,10 +343,7 @@ read_score (f, score)
359} 343}
360 344
361int 345int
362read_scores (filename, scores, count) 346read_scores (const char *filename, struct score_entry **scores, int *count)
363 const char *filename;
364 struct score_entry **scores;
365 int *count;
366{ 347{
367 int readval, scorecount, cursize; 348 int readval, scorecount, cursize;
368 struct score_entry *ret; 349 struct score_entry *ret;
@@ -395,9 +376,7 @@ read_scores (filename, scores, count)
395} 376}
396 377
397int 378int
398score_compare (a, b) 379score_compare (const void *a, const void *b)
399 const void *a;
400 const void *b;
401{ 380{
402 const struct score_entry *sa = (const struct score_entry *) a; 381 const struct score_entry *sa = (const struct score_entry *) a;
403 const struct score_entry *sb = (const struct score_entry *) b; 382 const struct score_entry *sb = (const struct score_entry *) b;
@@ -405,9 +384,7 @@ score_compare (a, b)
405} 384}
406 385
407int 386int
408score_compare_reverse (a, b) 387score_compare_reverse (const void *a, const void *b)
409 const void *a;
410 const void *b;
411{ 388{
412 const struct score_entry *sa = (const struct score_entry *) a; 389 const struct score_entry *sa = (const struct score_entry *) a;
413 const struct score_entry *sb = (const struct score_entry *) b; 390 const struct score_entry *sb = (const struct score_entry *) b;
@@ -415,11 +392,7 @@ score_compare_reverse (a, b)
415} 392}
416 393
417int 394int
418push_score (scores, count, newscore, username, newdata) 395push_score (struct score_entry **scores, int *count, int newscore, char *username, char *newdata)
419 struct score_entry **scores;
420 int *count; int newscore;
421 char *username;
422 char *newdata;
423{ 396{
424 struct score_entry *newscores 397 struct score_entry *newscores
425 = (struct score_entry *) realloc (*scores, 398 = (struct score_entry *) realloc (*scores,
@@ -435,20 +408,14 @@ push_score (scores, count, newscore, username, newdata)
435} 408}
436 409
437void 410void
438sort_scores (scores, count, reverse) 411sort_scores (struct score_entry *scores, int count, int reverse)
439 struct score_entry *scores;
440 int count;
441 int reverse;
442{ 412{
443 qsort (scores, count, sizeof (struct score_entry), 413 qsort (scores, count, sizeof (struct score_entry),
444 reverse ? score_compare_reverse : score_compare); 414 reverse ? score_compare_reverse : score_compare);
445} 415}
446 416
447int 417int
448write_scores (filename, scores, count) 418write_scores (const char *filename, const struct score_entry *scores, int count)
449 const char *filename;
450 const struct score_entry * scores;
451 int count;
452{ 419{
453 FILE *f; 420 FILE *f;
454 int i; 421 int i;
@@ -477,9 +444,7 @@ write_scores (filename, scores, count)
477} 444}
478 445
479int 446int
480lock_file (filename, state) 447lock_file (const char *filename, void **state)
481 const char *filename;
482 void **state;
483{ 448{
484 int fd; 449 int fd;
485 struct stat buf; 450 struct stat buf;
@@ -520,9 +485,7 @@ lock_file (filename, state)
520} 485}
521 486
522int 487int
523unlock_file (filename, state) 488unlock_file (const char *filename, void *state)
524 const char *filename;
525 void *state;
526{ 489{
527 char *lockpath = (char *) state; 490 char *lockpath = (char *) state;
528 int ret = unlink (lockpath); 491 int ret = unlink (lockpath);