/* Generate doc-string file for GNU Emacs from source files.
- Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012
- Free Software Foundation, Inc.
+
+Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2012
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <config.h>
-/* Defined to be emacs_main, sys_fopen, etc. in config.h. */
-#undef main
-#undef fopen
-#undef chdir
-
#include <stdio.h>
-#include <stdlib.h>
+#include <stdlib.h> /* config.h unconditionally includes this anyway */
#ifdef MSDOS
#include <fcntl.h>
#endif /* MSDOS */
#ifdef WINDOWSNT
+/* Defined to be sys_fopen in ms-w32.h, but only #ifdef emacs, so this
+ is really just insurance. */
+#undef fopen
#include <fcntl.h>
#include <direct.h>
#endif /* WINDOWSNT */
#ifdef DOS_NT
+/* Defined to be sys_chdir in ms-w32.h, but only #ifdef emacs, so this
+ is really just insurance.
+
+ Similarly, msdos defines this as sys_chdir, but we're not linking with the
+ file where that function is defined. */
+#undef chdir
#define READ_TEXT "rt"
#define READ_BINARY "rb"
#else /* not DOS_NT */
#define READ_BINARY "r"
#endif /* not DOS_NT */
-#ifndef DIRECTORY_SEP
-#define DIRECTORY_SEP '/'
-#endif
-
-#ifndef IS_DIRECTORY_SEP
-#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
-#endif
-
-/* Use this to suppress gcc's `...may be used before initialized' warnings. */
-#ifdef lint
-# define IF_LINT(Code) Code
-#else
-# define IF_LINT(Code) /* empty */
-#endif
-
static int scan_file (char *filename);
static int scan_lisp_file (const char *filename, const char *mode);
static int scan_c_file (char *filename, const char *mode);
static void start_globals (void);
static void write_globals (void);
-#ifdef MSDOS
-/* s/msdos.h defines this as sys_chdir, but we're not linking with the
- file where that function is defined. */
-#undef chdir
-#endif
-
#include <unistd.h>
/* Stdio stream for output to the DOC file. */
/* In C code, `default' is a reserved word, so we spell it
`defalt'; demangle that here. */
- if (ident_length == 6 && strncmp (ident_start, "defalt", 6) == 0)
+ if (ident_length == 6 && memcmp (ident_start, "defalt", 6) == 0)
fprintf (out, "DEFAULT");
else
while (ident_length-- > 0)
while (i + 1 < num_globals
&& !strcmp (globals[i].name, globals[i + 1].name))
- ++i;
+ {
+ if (globals[i].type == FUNCTION
+ && globals[i].value != globals[i + 1].value)
+ error ("function '%s' defined twice with differing signatures",
+ globals[i].name);
+ ++i;
+ }
}
if (!seen_defun)
int defvarperbufferflag = 0;
int defvarflag = 0;
enum global_type type = INVALID;
- char *name;
+ char *name IF_LINT (= 0);
if (c != '\n' && c != '\r')
{