aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog52
-rw-r--r--lib-src/b2m.c2
-rw-r--r--lib-src/ebrowse.c3
-rw-r--r--lib-src/emacsclient.c52
-rw-r--r--lib-src/etags.c6
-rw-r--r--lib-src/fakemail.c2
-rw-r--r--lib-src/hexl.c2
-rw-r--r--lib-src/make-docfile.c11
-rw-r--r--lib-src/movemail.c6
-rw-r--r--lib-src/ntlib.h12
-rw-r--r--lib-src/update-game-score.c2
11 files changed, 96 insertions, 54 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 1b6a16dd524..6ac9bf19a24 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,47 @@
12010-08-07 Juanma Barranquero <lekktu@gmail.com>
2
3 * ebrowse.c (usage, version, mark_virtual):
4 Remove duplicate declarations.
5
62010-08-06 Dan Nicolaescu <dann@ics.uci.edu>
7
8 * emacsclient.c: Move socket related #includes together with the
9 rest of the #includes. Move a WINDOWSNT includes closer together.
10 (HAVE_CONFIG_H): Remove.
11 (NO_RETURN): Remove, defined in config.h.
12 (main): Convert definition to standard C.
13
142010-07-29 Juanma Barranquero <lekktu@gmail.com>
15
16 * make-docfile.c (write_c_args): Warn for old-style empty arglist ().
17
182010-07-25 Juanma Barranquero <lekktu@gmail.com>
19
20 * emacsclient.c (getcwd): Fix previous change: make getcwd
21 conditional on HAVE_GETCWD and declare with the correct POSIX
22 profile (for some reason MinGW headers define its 2nd arg as int,
23 not size_t; but getcwd is not used on Windows nonetheless).
24
252010-07-25 Juanma Barranquero <lekktu@gmail.com>
26
27 * emacsclient.c (getcwd, w32_getenv):
28 * ntlib.h (getlogin, getuid, getegid, getgid): Fix prototypes.
29
302010-07-24 Dan Nicolaescu <dann@ics.uci.edu>
31
32 * update-game-score.c (usage): Add NO_RETURN specifier.
33 * movemail.c (fatal, pfatal_with_name, pfatal_and_delete):
34 * make-docfile.c (fatal):
35 * hexl.c (usage):
36 * fakemail.c (fatal):
37 * etags.c (fatal, suggest_asking_for_help, pfatal):
38 * emacsclient.c (fatal):
39 * b2m.c (fatal): Likewise.
40
412010-07-23 Juanma Barranquero <lekktu@gmail.com>
42
43 * make-docfile.c (write_c_args): Correctly handle prefixes of "defalt".
44
12010-07-20 Juanma Barranquero <lekktu@gmail.com> 452010-07-20 Juanma Barranquero <lekktu@gmail.com>
2 46
3 * emacsclient.c (get_current_dir_name, w32_get_resource) 47 * emacsclient.c (get_current_dir_name, w32_get_resource)
@@ -775,7 +819,7 @@
775 819
7762008-02-01 Jason Rumney <jasonr@gnu.org> 8202008-02-01 Jason Rumney <jasonr@gnu.org>
777 821
778 * makefile.w32-in (obj): Sync with src/Makefile.in 822 * makefile.w32-in (obj): Sync with src/Makefile.in.
779 (TOOLTIP_SUPPORT, WINDOW_SUPPORT): New definitions. 823 (TOOLTIP_SUPPORT, WINDOW_SUPPORT): New definitions.
780 (WINNT_SUPPORT): Add term/w32-win.elc. 824 (WINNT_SUPPORT): Add term/w32-win.elc.
781 (lisp1, lisp2): Sync with lisp in src/Makefile.in. 825 (lisp1, lisp2): Sync with lisp in src/Makefile.in.
@@ -2471,7 +2515,7 @@
2471 2515
2472 * makefile.w32-in (WINNT_SUPPORT, MOUSE_SUPPORT, lisp): Revert to 2516 * makefile.w32-in (WINNT_SUPPORT, MOUSE_SUPPORT, lisp): Revert to
2473 using .elc files. 2517 using .elc files.
2474 (lisp): Sync with list in src/Makefile.in 2518 (lisp): Sync with list in src/Makefile.in.
2475 (VMS_SUPPORT, MSDOS_SUPPORT): Define, so DOC files can be shared. 2519 (VMS_SUPPORT, MSDOS_SUPPORT): Define, so DOC files can be shared.
2476 2520
24772002-02-10 Paul Eggert <eggert@twinsun.com> 25212002-02-10 Paul Eggert <eggert@twinsun.com>
@@ -6313,7 +6357,7 @@
6313 (TOKEN): Member linestart removed. 6357 (TOKEN): Member linestart removed.
6314 (linepos, prev_linepos, lb1): Deleted. 6358 (linepos, prev_linepos, lb1): Deleted.
6315 (main): Call initbuffer on lbs array instead of lb1. 6359 (main): Call initbuffer on lbs array instead of lb1.
6316 (init): Removed the initialisation of the logical _gd array; 6360 (init): Removed the initialisation of the logical _gd array.
6317 (find_entries): A .sa suffix means assembler file. 6361 (find_entries): A .sa suffix means assembler file.
6318 (C_create_stab): "auto", "void", "extern", "static" are st_C_typespec. 6362 (C_create_stab): "auto", "void", "extern", "static" are st_C_typespec.
6319 All C state machines rewritten. 6363 All C state machines rewritten.
@@ -7177,7 +7221,7 @@
7177 * etags.c: Changes for VMS. 7221 * etags.c: Changes for VMS.
7178 Always define ETAGS on VMS. 7222 Always define ETAGS on VMS.
7179 Define macros GOOD and BAD for success and failure exit codes. 7223 Define macros GOOD and BAD for success and failure exit codes.
7180 (begtk, intk): Allow `$' in identifiers 7224 (begtk, intk): Allow `$' in identifiers.
7181 (main): Don't support -B, -F or -u on VMS. 7225 (main): Don't support -B, -F or -u on VMS.
7182 Alternate loop for scanning filename arguments. 7226 Alternate loop for scanning filename arguments.
7183 (system): Delete definition of this function. 7227 (system): Delete definition of this function.
diff --git a/lib-src/b2m.c b/lib-src/b2m.c
index 733cd276653..f31b33f9780 100644
--- a/lib-src/b2m.c
+++ b/lib-src/b2m.c
@@ -70,7 +70,7 @@ long *xmalloc (unsigned int size);
70long *xrealloc (char *ptr, unsigned int size); 70long *xrealloc (char *ptr, unsigned int size);
71char *concat (char *s1, char *s2, char *s3); 71char *concat (char *s1, char *s2, char *s3);
72long readline (struct linebuffer *linebuffer, register FILE *stream); 72long readline (struct linebuffer *linebuffer, register FILE *stream);
73void fatal (char *message); 73void fatal (char *message) NO_RETURN;
74 74
75/* 75/*
76 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type); 76 * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type);
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index a9f7ba4f3a7..40e72939429 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -492,8 +492,6 @@ void register_namespace_alias (char *, struct link *);
492void insert_keyword (char *, int); 492void insert_keyword (char *, int);
493void re_init_scanner (void); 493void re_init_scanner (void);
494void init_scanner (void); 494void init_scanner (void);
495void usage (int);
496void version (void);
497void process_file (char *); 495void process_file (char *);
498void add_search_path (char *); 496void add_search_path (char *);
499FILE *open_file (char *); 497FILE *open_file (char *);
@@ -504,7 +502,6 @@ int dump_tree (FILE *, struct sym *);
504struct member *find_member (struct sym *, char *, int, int, unsigned); 502struct member *find_member (struct sym *, char *, int, int, unsigned);
505struct member *add_member (struct sym *, char *, int, int, unsigned); 503struct member *add_member (struct sym *, char *, int, int, unsigned);
506void mark_virtual (struct sym *); 504void mark_virtual (struct sym *);
507void mark_virtual (struct sym *);
508struct sym *make_namespace (char *, struct sym *); 505struct sym *make_namespace (char *, struct sym *);
509char *sym_scope (struct sym *); 506char *sym_scope (struct sym *);
510char *sym_scope_1 (struct sym *); 507char *sym_scope_1 (struct sym *);
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index bafc7e02720..cbc1dfe3f6a 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -18,9 +18,7 @@ You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 19
20 20
21#ifdef HAVE_CONFIG_H
22#include <config.h> 21#include <config.h>
23#endif
24 22
25#ifdef WINDOWSNT 23#ifdef WINDOWSNT
26 24
@@ -32,6 +30,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32# include <stdlib.h> 30# include <stdlib.h>
33# include <windows.h> 31# include <windows.h>
34# include <commctrl.h> 32# include <commctrl.h>
33# include <io.h>
34# include <winsock2.h>
35 35
36# define NO_SOCKETS_IN_FILE_SYSTEM 36# define NO_SOCKETS_IN_FILE_SYSTEM
37 37
@@ -45,8 +45,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45 45
46# ifdef HAVE_INET_SOCKETS 46# ifdef HAVE_INET_SOCKETS
47# include <netinet/in.h> 47# include <netinet/in.h>
48# ifdef HAVE_SOCKETS
49# include <sys/types.h>
50# include <sys/socket.h>
51# include <sys/un.h>
52# endif /* HAVE_SOCKETS */
48# endif 53# endif
49
50# include <arpa/inet.h> 54# include <arpa/inet.h>
51 55
52# define INVALID_SOCKET -1 56# define INVALID_SOCKET -1
@@ -67,25 +71,23 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67#include <stdio.h> 71#include <stdio.h>
68#include "getopt.h" 72#include "getopt.h"
69#ifdef HAVE_UNISTD_H 73#ifdef HAVE_UNISTD_H
70#include <unistd.h> 74# include <unistd.h>
71#endif 75#endif
72 76
73#ifdef WINDOWSNT 77#include <pwd.h>
74# include <io.h>
75#else /* not WINDOWSNT */
76# include <pwd.h>
77#endif /* not WINDOWSNT */
78#include <sys/stat.h> 78#include <sys/stat.h>
79
80#include <signal.h> 79#include <signal.h>
81#include <errno.h> 80#include <errno.h>
82 81
82
83 83
84char *getenv (const char *), *getwd (char *); 84char *getenv (const char *), *getwd (char *);
85char *(getcwd) (); 85#ifdef HAVE_GETCWD
86char *(getcwd) (char *, size_t);
87#endif
86 88
87#ifdef WINDOWSNT 89#ifdef WINDOWSNT
88char *w32_getenv (); 90char *w32_getenv (char *);
89#define egetenv(VAR) w32_getenv(VAR) 91#define egetenv(VAR) w32_getenv(VAR)
90#else 92#else
91#define egetenv(VAR) getenv(VAR) 93#define egetenv(VAR) getenv(VAR)
@@ -112,10 +114,6 @@ char *w32_getenv ();
112#define TRUE 1 114#define TRUE 1
113#endif 115#endif
114 116
115#ifndef NO_RETURN
116#define NO_RETURN
117#endif
118
119/* Additional space when allocating buffers for filenames, etc. */ 117/* Additional space when allocating buffers for filenames, etc. */
120#define EXTRA_SPACE 100 118#define EXTRA_SPACE 100
121 119
@@ -158,6 +156,8 @@ char *server_file = NULL;
158int emacs_pid = 0; 156int emacs_pid = 0;
159 157
160void print_help_and_exit (void) NO_RETURN; 158void print_help_and_exit (void) NO_RETURN;
159void fail (void) NO_RETURN;
160
161 161
162struct option longopts[] = 162struct option longopts[] =
163{ 163{
@@ -400,7 +400,7 @@ w32_set_user_model_id (void)
400 /* On Windows 7 and later, we need to set the user model ID 400 /* On Windows 7 and later, we need to set the user model ID
401 to associate emacsclient launched files with Emacs frames 401 to associate emacsclient launched files with Emacs frames
402 in the UI. */ 402 in the UI. */
403 shell = LoadLibrary("shell32.dll"); 403 shell = LoadLibrary ("shell32.dll");
404 if (shell) 404 if (shell)
405 { 405 {
406 set_user_model 406 set_user_model
@@ -430,7 +430,7 @@ w32_window_app (void)
430 nonconsole apps. Testing for the console title seems to work. */ 430 nonconsole apps. Testing for the console title seems to work. */
431 window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0); 431 window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0);
432 if (window_app) 432 if (window_app)
433 InitCommonControls(); 433 InitCommonControls ();
434 } 434 }
435 435
436 return window_app; 436 return window_app;
@@ -481,7 +481,7 @@ ttyname (int fd)
481void 481void
482message (int is_error, char *message, ...) 482message (int is_error, char *message, ...)
483{ 483{
484 char msg [2048]; 484 char msg[2048];
485 va_list args; 485 va_list args;
486 486
487 va_start (args, message); 487 va_start (args, message);
@@ -698,9 +698,7 @@ fail (void)
698#if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS) 698#if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS)
699 699
700int 700int
701main (argc, argv) 701main (int argc, char **argv)
702 int argc;
703 char **argv;
704{ 702{
705 main_argv = argv; 703 main_argv = argv;
706 progname = argv[0]; 704 progname = argv[0];
@@ -712,14 +710,6 @@ main (argc, argv)
712 710
713#else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ 711#else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
714 712
715#ifdef WINDOWSNT
716# include <winsock2.h>
717#else
718# include <sys/types.h>
719# include <sys/socket.h>
720# include <sys/un.h>
721#endif
722
723#define AUTH_KEY_LENGTH 64 713#define AUTH_KEY_LENGTH 64
724#define SEND_BUFFER_SIZE 4096 714#define SEND_BUFFER_SIZE 4096
725 715
@@ -1468,7 +1458,7 @@ start_daemon_and_retry_set_socket (void)
1468 pid_t w; 1458 pid_t w;
1469 w = waitpid (dpid, &status, WUNTRACED | WCONTINUED); 1459 w = waitpid (dpid, &status, WUNTRACED | WCONTINUED);
1470 1460
1471 if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS(status)) 1461 if ((w == -1) || !WIFEXITED (status) || WEXITSTATUS (status))
1472 { 1462 {
1473 message (TRUE, "Error: Could not start the Emacs daemon\n"); 1463 message (TRUE, "Error: Could not start the Emacs daemon\n");
1474 exit (EXIT_FAILURE); 1464 exit (EXIT_FAILURE);
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 79475fe9922..b78686dde57 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -406,9 +406,9 @@ static void analyse_regex (char *);
406static void free_regexps (void); 406static void free_regexps (void);
407static void regex_tag_multiline (void); 407static void regex_tag_multiline (void);
408static void error (const char *, const char *); 408static void error (const char *, const char *);
409static void suggest_asking_for_help (void); 409static void suggest_asking_for_help (void) NO_RETURN;
410void fatal (char *, char *); 410void fatal (char *, char *) NO_RETURN;
411static void pfatal (char *); 411static void pfatal (char *) NO_RETURN;
412static void add_node (node *, node **); 412static void add_node (node *, node **);
413 413
414static void init (void); 414static void init (void);
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index f4d978b7d11..72e1b7179c0 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -147,6 +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
150static void fatal (char *s1) NO_RETURN;
151
150extern FILE *popen (const char *, const char *); 152extern FILE *popen (const char *, const char *);
151extern int fclose (FILE *), pclose (FILE *); 153extern int fclose (FILE *), pclose (FILE *);
152 154
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index d730cac6814..b31ab812534 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -49,7 +49,7 @@ 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(void); 52void usage(void) NO_RETURN;
53 53
54int 54int
55main (int argc, char **argv) 55main (int argc, char **argv)
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 51c30f91d8f..7fe63bed506 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -70,6 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
70int scan_file (char *filename); 70int scan_file (char *filename);
71int scan_lisp_file (char *filename, char *mode); 71int scan_lisp_file (char *filename, char *mode);
72int scan_c_file (char *filename, char *mode); 72int scan_c_file (char *filename, char *mode);
73void fatal (char *s1, char *s2) NO_RETURN;
73 74
74#ifdef MSDOS 75#ifdef MSDOS
75/* s/msdos.h defines this as sys_chdir, but we're not linking with the 76/* s/msdos.h defines this as sys_chdir, but we're not linking with the
@@ -441,7 +442,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
441 register char *p; 442 register char *p;
442 int in_ident = 0; 443 int in_ident = 0;
443 char *ident_start; 444 char *ident_start;
444 int ident_length; 445 int ident_length = 0;
445 446
446 fprintf (out, "(fn"); 447 fprintf (out, "(fn");
447 448
@@ -475,6 +476,12 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
475 identifier. */ 476 identifier. */
476 if (c == ',' || c == ')') 477 if (c == ',' || c == ')')
477 { 478 {
479 if (ident_length == 0)
480 {
481 error ("empty arg list for `%s' should be (void), not ()", func);
482 continue;
483 }
484
478 if (strncmp (ident_start, "void", ident_length) == 0) 485 if (strncmp (ident_start, "void", ident_length) == 0)
479 continue; 486 continue;
480 487
@@ -488,7 +495,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
488 495
489 /* In C code, `default' is a reserved word, so we spell it 496 /* In C code, `default' is a reserved word, so we spell it
490 `defalt'; unmangle that here. */ 497 `defalt'; unmangle that here. */
491 if (strncmp (ident_start, "defalt", ident_length) == 0) 498 if (ident_length == 6 && strncmp (ident_start, "defalt", 6) == 0)
492 fprintf (out, "DEFAULT"); 499 fprintf (out, "DEFAULT");
493 else 500 else
494 while (ident_length-- > 0) 501 while (ident_length-- > 0)
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 541edf545df..bb4a922014c 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -147,10 +147,10 @@ static char *mail_spool_name ();
147char *strerror (int); 147char *strerror (int);
148#endif 148#endif
149 149
150static void fatal (char *s1, char *s2, char *s3); 150static void fatal (char *s1, char *s2, char *s3) NO_RETURN;
151static void error (char *s1, char *s2, char *s3); 151static void error (char *s1, char *s2, char *s3);
152static void pfatal_with_name (char *name); 152static void pfatal_with_name (char *name) NO_RETURN;
153static void pfatal_and_delete (char *name); 153static void pfatal_and_delete (char *name) NO_RETURN;
154static char *concat (char *s1, char *s2, char *s3); 154static char *concat (char *s1, char *s2, char *s3);
155static long *xmalloc (unsigned int size); 155static long *xmalloc (unsigned int size);
156#ifdef MAIL_USE_POP 156#ifdef MAIL_USE_POP
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h
index fd51269fdfd..4dd6a32ee32 100644
--- a/lib-src/ntlib.h
+++ b/lib-src/ntlib.h
@@ -30,14 +30,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#ifdef sleep 30#ifdef sleep
31#undef sleep 31#undef sleep
32#endif 32#endif
33void sleep(unsigned long seconds); 33void sleep (unsigned long seconds);
34char *getwd (char *dir); 34char *getwd (char *dir);
35int getppid(void); 35int getppid (void);
36char * getlogin (); 36char * getlogin (void);
37char * cuserid (char * s); 37char * cuserid (char * s);
38unsigned getuid (); 38unsigned getuid (void);
39unsigned getegid (); 39unsigned getegid (void);
40unsigned getgid (); 40unsigned getgid (void);
41int setuid (unsigned uid); 41int setuid (unsigned uid);
42int setegid (unsigned gid); 42int setegid (unsigned gid);
43char * getpass (const char * prompt); 43char * getpass (const char * prompt);
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index a96422a09a9..30208d5c8d2 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -60,6 +60,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
60extern char *optarg; 60extern char *optarg;
61extern int optind, opterr; 61extern int optind, opterr;
62 62
63int usage (int err) NO_RETURN;
64
63#define MAX_ATTEMPTS 5 65#define MAX_ATTEMPTS 5
64#define MAX_SCORES 200 66#define MAX_SCORES 200
65#define MAX_DATA_LEN 1024 67#define MAX_DATA_LEN 1024