merge trunk

This commit is contained in:
Kenichi Handa 2010-07-08 17:09:35 +09:00
commit 80d4189187
260 changed files with 9974 additions and 14622 deletions

View file

@ -1,3 +1,27 @@
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* configure.in (PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS): Remove.
* configure.in (UNEXEC_OBJ): Add comment about values for MSDOS
and MSWindows.
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* configure.in: Don't check for bcopy, bcmp, bzero. Don't include
<strings.h> and don't define bcopy, bzero, BCMP in config.h.
2010-07-07 Dan Nicolaescu <dann@ics.uci.edu>
* configure.in (getenv): Remove K&R declaration.
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
* configure.in: Remove define __P.
2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
* configure.in (--enable-use-lisp-union-type): New flag.
2010-06-30 Dan Nicolaescu <dann@ics.uci.edu>
Fix CFLAGS for non-GCC compilers.

View file

@ -79,8 +79,6 @@ USER_FULL_NAME If defined, overrides the default pw->pw_gecos for getting at t
AIX
AMPERSAND_FULL_NAME
BCOPY_DOWNWARD_SAFE
BCOPY_UPWARD_SAFE
BITS_PER_EMACS_INT
BITS_PER_LONG
BITS_PER_CHAR
@ -118,7 +116,6 @@ EMACS_UINT
FILE_SYSTEM_CASE
FLOAT_CHECK_DOMAIN
FSCALE
GAP_USE_BCOPY
GC_LISP_OBJECT_ALIGNMENT
GC_MARK_SECONDARY_STACK
GC_MARK_STACK
@ -128,8 +125,6 @@ GNU_LIBRARY_PENDING_OUTPUT_COUNT
GNU_LINUX
GNU_MALLOC
HAVE_AIX_SMT_EXP
HAVE_BCMP
HAVE_BCOPY
HAVE_CBRT
HAVE_CLOSEDIR
HAVE_DUP2
@ -191,7 +186,6 @@ HAVE_SYS_TIMEB_H
HAVE_SYS_TIME_H
HAVE_TCATTR
HAVE_TERMIOS_H
HAVE_TEXT_START
HAVE_TIMEVAL
HAVE_TM_ZONE
HAVE_TZSET
@ -267,7 +261,6 @@ SYSV_SYSTEM_DIR
TAB3
TABDLY
TERM
TEXT_START
THIS_IS_CONFIGURE
TIME_WITH_SYS_TIME
TIOCSIGSEND
@ -319,10 +312,7 @@ _start
abort
access
alloca
bcmp
bcopy
brk
bzero
calloc
chdir
chmod

View file

@ -1,3 +1,9 @@
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE)
(GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero):
Remove.
2010-06-12 Eli Zaretskii <eliz@gnu.org>
* unidata/bidimirror.awk: New file.

38
configure vendored
View file

@ -600,8 +600,6 @@ TOOLTIP_SUPPORT
MOUSE_SUPPORT
LIB_GCC
LINKER
POST_EDIT_LDFLAGS
PRE_EDIT_LDFLAGS
LD_SWITCH_SYSTEM_TEMACS
POST_ALLOC_OBJ
PRE_ALLOC_OBJ
@ -825,6 +823,7 @@ enable_asserts
enable_maintainer_mode
enable_locallisppath
enable_checking
enable_use_lisp_union_type
enable_profiling
enable_autodepend
enable_largefile
@ -1477,6 +1476,10 @@ Optional Features:
only specific categories of checks. Categories are:
all,yes,no. Flags are: stringbytes, stringoverrun,
stringfreelist, xmallocoverrun, conslist
--enable-use-lisp-union-type
use a union for the Lisp_Object data type. This is
only useful for development for catching certain
types of bugs.
--enable-profiling build emacs with profiling support. This might not
work on all platforms
--enable-autodepend automatically generate dependencies to .h-files.
@ -2978,6 +2981,17 @@ $as_echo "#define GC_CHECK_CONS_LIST 1" >>confdefs.h
fi
# Check whether --enable-use-lisp-union-type was given.
if test "${enable_use_lisp_union_type+set}" = set; then :
enableval=$enable_use_lisp_union_type; if test "${enableval}" != "no"; then
$as_echo "#define USE_LISP_UNION_TYPE 1" >>confdefs.h
fi
fi
# Check whether --enable-profiling was given.
if test "${enable_profiling+set}" = set; then :
enableval=$enable_profiling; ac_enable_profiling="${enableval}"
@ -4290,7 +4304,7 @@ if test x$GCC = xyes; then
C_OPTIMIZE_SWITCH=-O2
test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
else
C_OPTIMIZE_SWITCH=-O
C_OPTIMIZE_SWITCH=-O
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
@ -5468,6 +5482,8 @@ esac
UNEXEC_OBJ=unexelf.o
case "$opsys" in
# MSDOS uses unexec.o
# MSWindows uses unexw32.o
aix4-2)
UNEXEC_OBJ=unexaix.o
;;
@ -11152,12 +11168,12 @@ esac
for ac_func in gethostname getdomainname dup2 \
rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
random lrand48 logb frexp fmod rint cbrt ftime setsid \
strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
cfmakeraw cfsetspeed isnan copysign
do :
@ -14145,8 +14161,6 @@ case "$opsys" in
esac
PRE_EDIT_LDFLAGS=
POST_EDIT_LDFLAGS=
if test "x$ORDINARY_LINK" = "xyes"; then
LINKER="\$(CC)"
@ -14167,18 +14181,8 @@ elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then
## searching for libraries in its internal directories, so we have to
## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
LINKER="\$(CC) -nostdlib"
## GCC passes any argument prefixed with -Xlinker directly to the linker.
## See prefix-args.c for an explanation of why we do not do this with the
## shell''s ``for'' construct. Note that sane people do not have '.' in
## their paths, so we must use ./prefix-args.
## TODO either make prefix-args check ORDINARY_LINK internally,
## or remove it altogether (bug#6184), removing the need for this hack.
PRE_EDIT_LDFLAGS='`./prefix-args -Xlinker'
POST_EDIT_LDFLAGS='`'
fi
test "x$LINKER" = "x" && LINKER=ld
## FIXME? What setting of EDIT_LDFLAGS should this have?
test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic"

View file

@ -305,6 +305,16 @@ if test x$ac_gc_check_cons_list != x ; then
[Define this to check for errors in cons list.])
fi
AC_ARG_ENABLE(use-lisp-union-type,
[AS_HELP_STRING([--enable-use-lisp-union-type],
[use a union for the Lisp_Object data type.
This is only useful for development for catching certain types of bugs.])],
if test "${enableval}" != "no"; then
AC_DEFINE(USE_LISP_UNION_TYPE, 1,
[Define this to use a lisp union for the Lisp_Object data type.])
fi)
AC_ARG_ENABLE(profiling,
[AS_HELP_STRING([--enable-profiling],
[build emacs with profiling support.
@ -880,6 +890,8 @@ AC_SUBST(CANNOT_DUMP)
UNEXEC_OBJ=unexelf.o
case "$opsys" in
# MSDOS uses unexec.o
# MSWindows uses unexw32.o
aix4-2)
UNEXEC_OBJ=unexaix.o
;;
@ -2605,12 +2617,12 @@ AC_SUBST(BLESSMAIL_TARGET)
AC_CHECK_FUNCS(gethostname getdomainname dup2 \
rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
random lrand48 logb frexp fmod rint cbrt ftime setsid \
strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
sendto recvfrom getsockopt setsockopt getsockname getpeername \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
gai_strerror mkstemp getline getdelim mremap memmove fsync sync \
memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
cfmakeraw cfsetspeed isnan copysign)
@ -3348,8 +3360,6 @@ case "$opsys" in
esac
PRE_EDIT_LDFLAGS=
POST_EDIT_LDFLAGS=
if test "x$ORDINARY_LINK" = "xyes"; then
LINKER="\$(CC)"
@ -3368,17 +3378,7 @@ elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then
## searching for libraries in its internal directories, so we have to
## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
LINKER="\$(CC) -nostdlib"
## GCC passes any argument prefixed with -Xlinker directly to the linker.
## See prefix-args.c for an explanation of why we do not do this with the
## shell''s ``for'' construct. Note that sane people do not have '.' in
## their paths, so we must use ./prefix-args.
## TODO either make prefix-args check ORDINARY_LINK internally,
## or remove it altogether (bug#6184), removing the need for this hack.
PRE_EDIT_LDFLAGS='`./prefix-args -Xlinker'
POST_EDIT_LDFLAGS='`'
fi
AC_SUBST(PRE_EDIT_LDFLAGS)
AC_SUBST(POST_EDIT_LDFLAGS)
test "x$LINKER" = "x" && LINKER=ld
## FIXME? What setting of EDIT_LDFLAGS should this have?
@ -3530,11 +3530,6 @@ SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */
#define my_strftime nstrftime /* for strftime.c */
/* Some of the files of Emacs which are intended for use with other
programs assume that if you have a config.h file, you must declare
the type of getenv. */
extern char *getenv ();
/* These default definitions are good for almost all machines.
The exceptions override them in m/MACHINE.h. */
@ -3564,23 +3559,11 @@ extern char *getenv ();
/* Define if the compiler supports function prototypes. It may do so but
not define __STDC__ (e.g. DEC C by default) or may define it as zero. */
#undef PROTOTYPES
/* For mktime.c: */
#ifndef __P
# if defined PROTOTYPES
# define __P(args) args
# else
# define __P(args) ()
# endif /* GCC. */
#endif /* __P */
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h> /* May be needed for bcopy & al. */
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@ -3622,16 +3605,6 @@ typedef unsigned size_t;
# endif
#endif
#ifndef HAVE_BCOPY
#define bcopy(a,b,s) memcpy (b,a,s)
#endif
#ifndef HAVE_BZERO
#define bzero(a,s) memset (a,0,s)
#endif
#ifndef HAVE_BCMP
#define BCMP memcmp
#endif
#endif /* EMACS_CONFIG_H */
/*

View file

@ -1,3 +1,8 @@
2010-07-04 Michael Albinus <michael.albinus@gmx.de>
* dbus.texi (Receiving Method Calls): Add optional argument
EMITS-SIGNAL to `dbus-register-property'.
2010-06-10 Glenn Morris <rgm@gnu.org>
* idlwave.texi (Load-Path Shadows):

View file

@ -1359,7 +1359,7 @@ The test runs then
@end example
@end defun
@defun dbus-register-property bus service path interface property access value
@defun dbus-register-property bus service path interface property access value &optional emits-signal
With this function, an application declares a @var{property} on the D-Bus
@var{bus}.
@ -1387,7 +1387,11 @@ only way to change their values. Properties with access type
The interface @samp{org.freedesktop.DBus.Properties} is added to
@var{path}, including a default handler for the @samp{Get},
@samp{GetAll} and @samp{Set} methods of this interface. Example:
@samp{GetAll} and @samp{Set} methods of this interface. When
@var{emits-signal} is non-nil, the signal @samp{PropertiesChanged} is
sent when the property is changed by @code{dbus-set-property}.
@noindent Example:
@lisp
(dbus-register-property
@ -1399,7 +1403,7 @@ The interface @samp{org.freedesktop.DBus.Properties} is added to
(dbus-register-property
:session "org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
"org.freedesktop.TextEditor" "version" :readwrite emacs-version)
"org.freedesktop.TextEditor" "version" :readwrite emacs-version t)
@result{} ((:session "org.freedesktop.TextEditor" "version")
("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"))

View file

@ -47,6 +47,10 @@ to configure. Note that other libraries used by Emacs, RSVG and GConf,
also depend on Gtk+. You can disable them with --without-rsvg and
--without-gconf.
** There is a new configure option --enable-use-lisp-union-type.
This is only useful for Emacs developers to debug certain types of bugs.
These is not a new feature; only the configure flag is new.
* Startup Changes in Emacs 24.1
@ -309,6 +313,11 @@ determine whether to create a menu-bar or tool-bar, respectively.
If the alist entries are added, they override the value of
`menu-bar-mode'/`tool-bar-mode'.
** Regions created by mouse dragging are now normal active regions,
similar to the ones created by shift-selection. In previous Emacs
versions, these regions were delineated by `mouse-drag-overlay', which
has now been removed.
* Lisp changes in Emacs 24.1

View file

@ -1,3 +1,90 @@
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* update-game-score.c (P_): Remove macro.
* ebrowse.c: Remove include guards.
(P_): Remove macro.
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
memcpy, memmove, memset.
* pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
2010-07-06 Andreas Schwab <schwab@linux-m68k.org>
* movemail.c: Add MAIL_USE_POP around prototypes.
Include <string.h> if HAVE_STRING_H.
(strerror): Only declare if !HAVE_STRERROR.
(fatal): Make static.
(error): Likewise.
(pfatal_with_name): Likewise.
(pfatal_and_delete). Likewise.
(concat): Likewise.
(xmalloc): Likewise.
(popmail): Likewise.
(pop_retr): Likewise.
(mbx_write): Likewise.
(mbx_delimit_begin): Likewise.
(mbx_delimit_end): Likewise.
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* fakemail.c (action): Convert function definitions to standard C.
(add_a_stream):
* test-distrib.c (cool_read):
(main): Likewise.
2010-07-03 Andreas Schwab <schwab@linux-m68k.org>
* sorted-doc.c (cmpdoc): Fix signature.
(qsort_compare): Delete.
(main): Remove cast.
2010-07-03 Juanma Barranquero <lekktu@gmail.com>
* ebrowse.c (match_qualified_namespace_alias): Check for null pointer.
2010-07-03 Juanma Barranquero <lekktu@gmail.com>
Fix prototype warnings.
* ebrowse.c (match_qualified_namespace_alias):
Pass sym* to find_namespace, not link*.
* emacsclient.c (send_to_emacs, quote_argument): Arg s is HSOCKET.
* sorted-doc.c (qsort_compare): New typedef.
(main): Use it to cast cmpdoc.
2010-07-03 Dan Nicolaescu <dann@ics.uci.edu>
* update-game-score.c: Convert function definitions to standard C.
* sorted-doc.c:
* profile.c:
* pop.c:
* movemail.c:
* make-docfile.c:
* hexl.c:
* fakemail.c:
* etags.c:
* ebrowse.c:
* digest-doc.c:
* b2m.c: Likewise.
2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
* make-docfile.c (xmalloc, xrealloc, concat, readline, fatal):
* b2m.c (scan_file, scan_lisp_file, scan_c_file): Convert to
standard C prototypes.
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
* ebrowse.c: Remove P_ and __P.
* etags.c:
* movemail.c:
* pop.c:
* update-game-score.c: Likewise.
2010-06-24 Juanma Barranquero <lekktu@gmail.com>
* movemail.c (error): Avoid warning when there are no args.

View file

@ -64,12 +64,13 @@ struct linebuffer
char *buffer;
};
extern char *strtok();
extern char *strtok(char *, const char *);
long *xmalloc (), *xrealloc ();
char *concat ();
long readline ();
void fatal ();
long *xmalloc (unsigned int size);
long *xrealloc (char *ptr, unsigned int size);
char *concat (char *s1, char *s2, char *s3);
long readline (struct linebuffer *linebuffer, register FILE *stream);
void fatal (char *message);
/*
* xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type);
@ -90,9 +91,7 @@ struct option longopts[] =
extern int optind;
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
logical labels_saved, printing, header, first, last_was_blank_line;
time_t ltoday;
@ -219,8 +218,7 @@ main (argc, argv)
* concatenate those of s1, s2, s3.
*/
char *
concat (s1, s2, s3)
char *s1, *s2, *s3;
concat (char *s1, char *s2, char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = xnew (len1 + len2 + len3 + 1, char);
@ -239,9 +237,7 @@ concat (s1, s2, s3)
* which is the length of the line including the newline, if any.
*/
long
readline (linebuffer, stream)
struct linebuffer *linebuffer;
register FILE *stream;
readline (struct linebuffer *linebuffer, register FILE *stream)
{
char *buffer = linebuffer->buffer;
register char *p = linebuffer->buffer;
@ -291,8 +287,7 @@ readline (linebuffer, stream)
* Like malloc but get fatal error if memory is exhausted.
*/
long *
xmalloc (size)
unsigned int size;
xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (result == NULL)
@ -301,9 +296,7 @@ xmalloc (size)
}
long *
xrealloc (ptr, size)
char *ptr;
unsigned int size;
xrealloc (char *ptr, unsigned int size)
{
long *result = (long *) realloc (ptr, size);
if (result == NULL)
@ -312,8 +305,7 @@ xrealloc (ptr, size)
}
void
fatal (message)
char *message;
fatal (char *message)
{
fprintf (stderr, "%s: %s\n", progname, message);
exit (EXIT_FAILURE);

View file

@ -31,7 +31,7 @@ but in texinfo format and sorted by function/variable name. */
#endif
int
main ()
main (void)
{
register int ch;
register int notfirst = 0;

View file

@ -20,20 +20,14 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <ctype.h>
#include <assert.h>
#include "getopt.h"
@ -45,12 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Conditionalize function prototypes. */
#ifdef PROTOTYPES /* From config.h. */
#define P_(x) x
#else
#define P_(x) ()
#endif
/* Value is non-zero if strings X and Y compare equal. */
#define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0)
@ -479,62 +467,62 @@ struct search_path *search_path_tail;
/* Function prototypes. */
int yylex P_ ((void));
void yyparse P_ ((void));
void re_init_parser P_ ((void));
char *token_string P_ ((int));
char *matching_regexp P_ ((void));
void init_sym P_ ((void));
struct sym *add_sym P_ ((char *, struct sym *));
void add_link P_ ((struct sym *, struct sym *));
void add_member_defn P_ ((struct sym *, char *, char *,
int, unsigned, int, int, int));
void add_member_decl P_ ((struct sym *, char *, char *, int,
unsigned, int, int, int, int));
void dump_roots P_ ((FILE *));
void *xmalloc P_ ((int));
void xfree P_ ((void *));
void add_global_defn P_ ((char *, char *, int, unsigned, int, int, int));
void add_global_decl P_ ((char *, char *, int, unsigned, int, int, int));
void add_define P_ ((char *, char *, int));
void mark_inherited_virtual P_ ((void));
void leave_namespace P_ ((void));
void enter_namespace P_ ((char *));
void register_namespace_alias P_ ((char *, struct link *));
void insert_keyword P_ ((char *, int));
void re_init_scanner P_ ((void));
void init_scanner P_ ((void));
void usage P_ ((int));
void version P_ ((void));
void process_file P_ ((char *));
void add_search_path P_ ((char *));
FILE *open_file P_ ((char *));
int process_pp_line P_ ((void));
int dump_members P_ ((FILE *, struct member *));
void dump_sym P_ ((FILE *, struct sym *));
int dump_tree P_ ((FILE *, struct sym *));
struct member *find_member P_ ((struct sym *, char *, int, int, unsigned));
struct member *add_member P_ ((struct sym *, char *, int, int, unsigned));
void mark_virtual P_ ((struct sym *));
void mark_virtual P_ ((struct sym *));
struct sym *make_namespace P_ ((char *, struct sym *));
char *sym_scope P_ ((struct sym *));
char *sym_scope_1 P_ ((struct sym *));
int skip_to P_ ((int));
void skip_matching P_ ((void));
void member P_ ((struct sym *, int));
void class_body P_ ((struct sym *, int));
void class_definition P_ ((struct sym *, int, int, int));
void declaration P_ ((int));
unsigned parm_list P_ ((int *));
char *operator_name P_ ((int *));
struct sym *parse_classname P_ ((void));
struct sym *parse_qualified_ident_or_type P_ ((char **));
void parse_qualified_param_ident_or_type P_ ((char **));
int globals P_ ((int));
void yyerror P_ ((char *, char *));
void usage P_ ((int)) NO_RETURN;
void version P_ (()) NO_RETURN;
int yylex (void);
void yyparse (void);
void re_init_parser (void);
char *token_string (int);
char *matching_regexp (void);
void init_sym (void);
struct sym *add_sym (char *, struct sym *);
void add_link (struct sym *, struct sym *);
void add_member_defn (struct sym *, char *, char *,
int, unsigned, int, int, int);
void add_member_decl (struct sym *, char *, char *, int,
unsigned, int, int, int, int);
void dump_roots (FILE *);
void *xmalloc (int);
void xfree (void *);
void add_global_defn (char *, char *, int, unsigned, int, int, int);
void add_global_decl (char *, char *, int, unsigned, int, int, int);
void add_define (char *, char *, int);
void mark_inherited_virtual (void);
void leave_namespace (void);
void enter_namespace (char *);
void register_namespace_alias (char *, struct link *);
void insert_keyword (char *, int);
void re_init_scanner (void);
void init_scanner (void);
void usage (int);
void version (void);
void process_file (char *);
void add_search_path (char *);
FILE *open_file (char *);
int process_pp_line (void);
int dump_members (FILE *, struct member *);
void dump_sym (FILE *, struct sym *);
int dump_tree (FILE *, struct sym *);
struct member *find_member (struct sym *, char *, int, int, unsigned);
struct member *add_member (struct sym *, char *, int, int, unsigned);
void mark_virtual (struct sym *);
void mark_virtual (struct sym *);
struct sym *make_namespace (char *, struct sym *);
char *sym_scope (struct sym *);
char *sym_scope_1 (struct sym *);
int skip_to (int);
void skip_matching (void);
void member (struct sym *, int);
void class_body (struct sym *, int);
void class_definition (struct sym *, int, int, int);
void declaration (int);
unsigned parm_list (int *);
char *operator_name (int *);
struct sym *parse_classname (void);
struct sym *parse_qualified_ident_or_type (char **);
void parse_qualified_param_ident_or_type (char **);
int globals (int);
void yyerror (char *, char *);
void usage (int) NO_RETURN;
void version (void) NO_RETURN;
@ -546,8 +534,7 @@ void version P_ (()) NO_RETURN;
name and line number. */
void
yyerror (format, s)
char *format, *s;
yyerror (char *format, char *s)
{
fprintf (stderr, "%s:%d: ", filename, yyline);
fprintf (stderr, format, s);
@ -559,8 +546,7 @@ yyerror (format, s)
available. */
void *
xmalloc (nbytes)
int nbytes;
xmalloc (int nbytes)
{
void *p = malloc (nbytes);
if (p == NULL)
@ -575,9 +561,7 @@ xmalloc (nbytes)
/* Like realloc but print an error and exit if out of memory. */
void *
xrealloc (p, sz)
void *p;
int sz;
xrealloc (void *p, int sz)
{
p = realloc (p, sz);
if (p == NULL)
@ -593,8 +577,7 @@ xrealloc (p, sz)
available.. If S is null, return null. */
char *
xstrdup (s)
char *s;
xstrdup (char *s)
{
if (s)
s = strcpy (xmalloc (strlen (s) + 1), s);
@ -611,7 +594,7 @@ xstrdup (s)
special symbol for globals (`*Globals*'). */
void
init_sym ()
init_sym (void)
{
global_symbols = add_sym (GLOBALS_NAME, NULL);
}
@ -625,9 +608,7 @@ init_sym ()
create a new symbol and set it to default values. */
struct sym *
add_sym (name, nested_in_class)
char *name;
struct sym *nested_in_class;
add_sym (char *name, struct sym *nested_in_class)
{
struct sym *sym;
unsigned h;
@ -654,7 +635,7 @@ add_sym (name, nested_in_class)
}
sym = (struct sym *) xmalloc (sizeof *sym + strlen (name));
bzero (sym, sizeof *sym);
memset (sym, 0, sizeof *sym);
strcpy (sym->name, name);
sym->namesp = scope;
sym->next = class_table[h];
@ -668,8 +649,7 @@ add_sym (name, nested_in_class)
/* Add links between superclass SUPER and subclass SUB. */
void
add_link (super, sub)
struct sym *super, *sub;
add_link (struct sym *super, struct sym *sub)
{
struct link *lnk, *lnk2, *p, *prev;
@ -709,11 +689,7 @@ add_link (super, sub)
found or null if not found. */
struct member *
find_member (cls, name, var, sc, hash)
struct sym *cls;
char *name;
int var, sc;
unsigned hash;
find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
{
struct member **list;
struct member *p;
@ -763,16 +739,7 @@ find_member (cls, name, var, sc, hash)
F_* defines). */
void
add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags)
struct sym *cls;
char *name;
char *regexp;
int pos;
unsigned hash;
int var;
int sc;
int vis;
int flags;
add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags)
{
struct member *m;
@ -820,15 +787,7 @@ add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags)
F_* defines). */
void
add_member_defn (cls, name, regexp, pos, hash, var, sc, flags)
struct sym *cls;
char *name;
char *regexp;
int pos;
unsigned hash;
int var;
int sc;
int flags;
add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
struct member *m;
@ -870,9 +829,7 @@ add_member_defn (cls, name, regexp, pos, hash, var, sc, flags)
if it is non-null. POS is the position in the file. */
void
add_define (name, regexp, pos)
char *name, *regexp;
int pos;
add_define (char *name, char *regexp, int pos)
{
add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE);
@ -890,13 +847,7 @@ add_define (name, regexp, pos)
F_* defines). */
void
add_global_defn (name, regexp, pos, hash, var, sc, flags)
char *name, *regexp;
int pos;
unsigned hash;
int var;
int sc;
int flags;
add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
int i;
struct sym *sym;
@ -927,13 +878,7 @@ add_global_defn (name, regexp, pos, hash, var, sc, flags)
F_* defines). */
void
add_global_decl (name, regexp, pos, hash, var, sc, flags)
char *name, *regexp;
int pos;
unsigned hash;
int var;
int sc;
int flags;
add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags)
{
/* Add declaration only if not already declared. Header files must
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)
Value is a pointer to the member's structure. */
struct member *
add_member (cls, name, var, sc, hash)
struct sym *cls;
char *name;
int var;
int sc;
unsigned hash;
add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash)
{
struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name));
struct member **list;
@ -1048,8 +988,7 @@ add_member (cls, name, var, sc, hash)
in base classes. */
void
mark_virtual (r)
struct sym *r;
mark_virtual (struct sym *r)
{
struct link *p;
struct member *m, *m2;
@ -1073,7 +1012,7 @@ mark_virtual (r)
are virtual because of a virtual declaration in a base class. */
void
mark_inherited_virtual ()
mark_inherited_virtual (void)
{
struct sym *r;
int i;
@ -1088,12 +1027,10 @@ mark_inherited_virtual ()
/* Create and return a symbol for a namespace with name NAME. */
struct sym *
make_namespace (name, context)
char *name;
struct sym *context;
make_namespace (char *name, struct sym *context)
{
struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name));
bzero (s, sizeof *s);
memset (s, 0, sizeof *s);
strcpy (s->name, name);
s->next = all_namespaces;
s->namesp = context;
@ -1105,9 +1042,7 @@ make_namespace (name, context)
/* Find the symbol for namespace NAME. If not found, retrun NULL */
struct sym *
check_namespace (name, context)
char *name;
struct sym *context;
check_namespace (char *name, struct sym *context)
{
struct sym *p = NULL;
@ -1115,18 +1050,16 @@ check_namespace (name, context)
{
if (streq (p->name, name) && (p->namesp == context))
break;
}
}
return p;
}
}
/* Find the symbol for namespace NAME. If not found, add a new symbol
for NAME to all_namespaces. */
struct sym *
find_namespace (name, context)
char *name;
struct sym *context;
find_namespace (char *name, struct sym *context)
{
struct sym *p = check_namespace (name, context);
@ -1140,8 +1073,7 @@ find_namespace (name, context)
/* Find namespace alias with name NAME. If not found return NULL. */
struct link *
check_namespace_alias (name)
char *name;
check_namespace_alias (char *name)
{
struct link *p = NULL;
struct alias *al;
@ -1165,9 +1097,7 @@ check_namespace_alias (name)
/* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */
void
register_namespace_alias (new_name, old_name)
char *new_name;
struct link *old_name;
register_namespace_alias (char *new_name, struct link *old_name)
{
unsigned h;
char *s;
@ -1195,8 +1125,7 @@ register_namespace_alias (new_name, old_name)
/* Enter namespace with name NAME. */
void
enter_namespace (name)
char *name;
enter_namespace (char *name)
{
struct sym *p = find_namespace (name, current_namespace);
@ -1217,7 +1146,7 @@ enter_namespace (name)
/* Leave the current namespace. */
void
leave_namespace ()
leave_namespace (void)
{
assert (namespace_sp > 0);
current_namespace = namespace_stack[--namespace_sp];
@ -1259,8 +1188,7 @@ int scope_buffer_len;
/* Make sure scope_buffer has enough room to add LEN chars to it. */
void
ensure_scope_buffer_room (len)
int len;
ensure_scope_buffer_room (int len)
{
if (scope_buffer_len + len >= scope_buffer_size)
{
@ -1276,8 +1204,7 @@ ensure_scope_buffer_room (len)
scope name constructed. */
char *
sym_scope_1 (p)
struct sym *p;
sym_scope_1 (struct sym *p)
{
int len;
@ -1311,8 +1238,7 @@ sym_scope_1 (p)
as it would appear in a C*+ source file. */
char *
sym_scope (p)
struct sym *p;
sym_scope (struct sym *p)
{
if (!scope_buffer)
{
@ -1334,9 +1260,7 @@ sym_scope (p)
list. */
int
dump_members (fp, m)
FILE *fp;
struct member *m;
dump_members (FILE *fp, struct member *m)
{
int n;
@ -1369,9 +1293,7 @@ dump_members (fp, m)
/* Dump class ROOT to stream FP. */
void
dump_sym (fp, root)
FILE *fp;
struct sym *root;
dump_sym (FILE *fp, struct sym *root)
{
fputs (CLASS_STRUCT, fp);
PUTSTR (root->name, fp);
@ -1397,9 +1319,7 @@ dump_sym (fp, root)
number of classes written. */
int
dump_tree (fp, root)
FILE *fp;
struct sym *root;
dump_tree (FILE *fp, struct sym *root)
{
struct link *lk;
unsigned n = 0;
@ -1446,8 +1366,7 @@ dump_tree (fp, root)
/* Dump the entire class tree to file FP. */
void
dump_roots (fp)
FILE *fp;
dump_roots (FILE *fp)
{
int i, n = 0;
struct sym *r;
@ -1521,7 +1440,7 @@ do { \
input buffer not consumed. */
int
process_pp_line ()
process_pp_line (void)
{
int in_comment = 0, in_string = 0;
int c;
@ -1592,7 +1511,7 @@ process_pp_line ()
/* Value is the next token from the input buffer. */
int
yylex ()
yylex (void)
{
int c;
char end_char;
@ -2009,7 +1928,7 @@ static char *matching_regexp_buffer, *matching_regexp_end_buf;
shorter than min_regexp. */
char *
matching_regexp ()
matching_regexp (void)
{
char *p;
char *s;
@ -2060,8 +1979,7 @@ matching_regexp ()
/* Return a printable representation of token T. */
char *
token_string (t)
int t;
token_string (int t)
{
static char b[3];
@ -2178,7 +2096,7 @@ token_string (t)
/* Reinitialize the scanner for a new input file. */
void
re_init_scanner ()
re_init_scanner (void)
{
in = inbuffer;
yyline = 1;
@ -2196,9 +2114,7 @@ re_init_scanner ()
table. */
void
insert_keyword (name, tk)
char *name;
int tk;
insert_keyword (char *name, int tk)
{
char *s;
unsigned h = 0;
@ -2219,7 +2135,7 @@ insert_keyword (name, tk)
character class vectors and fills the keyword hash table. */
void
init_scanner ()
init_scanner (void)
{
int i;
@ -2363,8 +2279,7 @@ init_scanner ()
the current lookahead token after skipping. */
int
skip_to (token)
int token;
skip_to (int token)
{
while (!LOOKING_AT2 (YYEOF, token))
MATCH ();
@ -2375,7 +2290,7 @@ skip_to (token)
angle brackets, curly brackets) matching the current lookahead. */
void
skip_matching ()
skip_matching (void)
{
int open, close, n;
@ -2418,7 +2333,7 @@ skip_matching ()
}
void
skip_initializer ()
skip_initializer (void)
{
for (;;)
{
@ -2445,7 +2360,7 @@ skip_initializer ()
/* Build qualified namespace alias (A::B::c) and return it. */
struct link *
match_qualified_namespace_alias ()
match_qualified_namespace_alias (void)
{
struct link *head = NULL;
struct link *cur = NULL;
@ -2458,7 +2373,7 @@ match_qualified_namespace_alias ()
{
case IDENT:
tmp = (struct link *) xmalloc (sizeof *cur);
tmp->sym = find_namespace (yytext, cur);
tmp->sym = find_namespace (yytext, cur ? cur->sym : NULL);
tmp->next = NULL;
if (head)
{
@ -2482,7 +2397,7 @@ match_qualified_namespace_alias ()
/* Re-initialize the parser by resetting the lookahead token. */
void
re_init_parser ()
re_init_parser (void)
{
tk = -1;
}
@ -2495,8 +2410,7 @@ re_init_parser ()
distinguish between overloaded functions. */
unsigned
parm_list (flags)
int *flags;
parm_list (int *flags)
{
unsigned hash = 0;
int type_seen = 0;
@ -2609,7 +2523,7 @@ parm_list (flags)
/* Print position info to stdout. */
void
print_info ()
print_info (void)
{
if (info_position >= 0 && BUFFER_POS () <= info_position)
if (info_cls)
@ -2624,9 +2538,7 @@ print_info ()
public). */
void
member (cls, vis)
struct sym *cls;
int vis;
member (struct sym *cls, int vis)
{
char *id = NULL;
int sc = SC_MEMBER;
@ -2835,9 +2747,7 @@ member (cls, vis)
union, class). */
void
class_body (cls, tag)
struct sym *cls;
int tag;
class_body (struct sym *cls, int tag)
{
int vis = tag == CLASS ? PRIVATE : PUBLIC;
int temp;
@ -2898,7 +2808,7 @@ class_body (cls, tag)
symbol for that class. */
struct sym *
parse_classname ()
parse_classname (void)
{
struct sym *last_class = NULL;
@ -2928,8 +2838,7 @@ parse_classname ()
a static buffer holding the constructed operator name string. */
char *
operator_name (sc)
int *sc;
operator_name (int *sc)
{
static int id_size = 0;
static char *id = NULL;
@ -3019,8 +2928,7 @@ operator_name (sc)
symbol structure for the ident. */
struct sym *
parse_qualified_ident_or_type (last_id)
char **last_id;
parse_qualified_ident_or_type (char **last_id)
{
struct sym *cls = NULL;
char *id = NULL;
@ -3085,8 +2993,7 @@ parse_qualified_ident_or_type (last_id)
symbol structure for the ident. */
void
parse_qualified_param_ident_or_type (last_id)
char **last_id;
parse_qualified_param_ident_or_type (char **last_id)
{
struct sym *cls = NULL;
static char *id = NULL;
@ -3128,11 +3035,7 @@ parse_qualified_param_ident_or_type (last_id)
Current lookahead is the class name. */
void
class_definition (containing, tag, flags, nested)
struct sym *containing;
int tag;
int flags;
int nested;
class_definition (struct sym *containing, int tag, int flags, int nested)
{
struct sym *current;
struct sym *base_class;
@ -3229,10 +3132,7 @@ class_definition (containing, tag, flags, nested)
information about the member (see the F_* defines). */
void
add_declarator (cls, id, flags, sc)
struct sym **cls;
char **id;
int flags, sc;
add_declarator (struct sym **cls, char **id, int flags, int sc)
{
if (LOOKING_AT2 (';', ','))
{
@ -3275,8 +3175,7 @@ add_declarator (cls, id, flags, sc)
/* Parse a declaration. */
void
declaration (flags)
int flags;
declaration (int flags)
{
char *id = NULL;
struct sym *cls = NULL;
@ -3430,8 +3329,7 @@ declaration (flags)
otherwise. */
int
globals (start_flags)
int start_flags;
globals (int start_flags)
{
int anonymous;
int class_tk;
@ -3549,7 +3447,7 @@ globals (start_flags)
/* Parse the current input file. */
void
yyparse ()
yyparse (void)
{
while (globals (0) == 0)
MATCH_IF ('}');
@ -3565,8 +3463,7 @@ yyparse ()
input files. */
void
add_search_path (path_list)
char *path_list;
add_search_path (char *path_list)
{
while (*path_list)
{
@ -3601,8 +3498,7 @@ add_search_path (path_list)
unchanged file name. */
FILE *
open_file (file)
char *file;
open_file (char *file)
{
FILE *fp = NULL;
static char *buffer;
@ -3661,8 +3557,7 @@ Usage: ebrowse [options] {files}\n\
"
void
usage (error)
int error;
usage (int error)
{
puts (USAGE);
exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
@ -3677,7 +3572,7 @@ usage (error)
#endif
void
version ()
version (void)
{
/* Makes it easier to update automatically. */
char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
@ -3693,8 +3588,7 @@ version ()
table. */
void
process_file (file)
char *file;
process_file (char *file)
{
FILE *fp;
@ -3749,8 +3643,7 @@ process_file (file)
is null when EOF is reached. */
char *
read_line (fp)
FILE *fp;
read_line (FILE *fp)
{
static char *buffer;
static int buffer_size;
@ -3786,9 +3679,7 @@ read_line (fp)
/* Main entry point. */
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int i;
int any_inputfiles = 0;

View file

@ -81,7 +81,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <errno.h>
char *getenv (), *getwd ();
char *getenv (const char *), *getwd (char *);
char *(getcwd) ();
#ifdef WINDOWSNT
@ -157,7 +157,7 @@ char *server_file = NULL;
/* PID of the Emacs server process. */
int emacs_pid = 0;
void print_help_and_exit () NO_RETURN;
void print_help_and_exit (void) NO_RETURN;
struct option longopts[] =
{
@ -184,8 +184,7 @@ struct option longopts[] =
/* Like malloc but get fatal error if memory is exhausted. */
long *
xmalloc (size)
unsigned int size;
xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (result == NULL)
@ -517,9 +516,7 @@ message (int is_error, char *message, ...)
The global variable `optind' will say how many arguments we used up. */
void
decode_options (argc, argv)
int argc;
char **argv;
decode_options (int argc, char **argv)
{
alternate_editor = egetenv ("ALTERNATE_EDITOR");
@ -645,7 +642,7 @@ an empty string");
void
print_help_and_exit ()
print_help_and_exit (void)
{
/* Spaces and tabs are significant in this message; they're chosen so the
message aligns properly both in a tty and in a Windows message box.
@ -732,7 +729,7 @@ main (argc, argv)
#define AUTH_KEY_LENGTH 64
#define SEND_BUFFER_SIZE 4096
extern char *strerror ();
extern char *strerror (int);
/* Buffer to accumulate data to send in TCP connections. */
char send_buffer[SEND_BUFFER_SIZE + 1];
@ -743,8 +740,7 @@ HSOCKET emacs_socket = 0;
/* On Windows, the socket library was historically separate from the standard
C library, so errors are handled differently. */
void
sock_err_message (function_name)
char *function_name;
sock_err_message (char *function_name)
{
#ifdef WINDOWSNT
char* msg = NULL;
@ -768,9 +764,7 @@ sock_err_message (function_name)
- the buffer is full (but this shouldn't happen)
Otherwise, we just accumulate it. */
void
send_to_emacs (s, data)
HSOCKET s;
char *data;
send_to_emacs (HSOCKET s, char *data)
{
while (data)
{
@ -807,11 +801,9 @@ send_to_emacs (s, data)
any initial -. Change spaces to underscores, too, so that the
return value never contains a space.
Does not change the string. Outputs the result to STREAM. */
Does not change the string. Outputs the result to S. */
void
quote_argument (s, str)
HSOCKET s;
char *str;
quote_argument (HSOCKET s, char *str)
{
char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
char *p, *q;
@ -851,8 +843,7 @@ quote_argument (s, str)
modifying the string in place. Returns STR. */
char *
unquote_argument (str)
char *str;
unquote_argument (char *str)
{
char *p, *q;
@ -883,8 +874,7 @@ unquote_argument (str)
int
file_name_absolute_p (filename)
const unsigned char *filename;
file_name_absolute_p (const unsigned char *filename)
{
/* Sanity check, it shouldn't happen. */
if (! filename) return FALSE;
@ -938,9 +928,7 @@ initialize_sockets ()
* the Emacs server: host, port, pid and authentication string.
*/
int
get_server_config (server, authentication)
struct sockaddr_in *server;
char *authentication;
get_server_config (struct sockaddr_in *server, char *authentication)
{
char dotted[32];
char *port;
@ -1005,7 +993,7 @@ get_server_config (server, authentication)
}
HSOCKET
set_tcp_socket ()
set_tcp_socket (void)
{
HSOCKET s;
struct sockaddr_in server;
@ -1119,8 +1107,7 @@ find_tty (char **tty_type, char **tty_name, int noabort)
0 - success: none of the above */
static int
socket_status (socket_name)
char *socket_name;
socket_status (char *socket_name)
{
struct stat statbfr;
@ -1223,7 +1210,7 @@ init_signals (void)
HSOCKET
set_local_socket ()
set_local_socket (void)
{
HSOCKET s;
struct sockaddr_un server;
@ -1526,9 +1513,7 @@ start_daemon_and_retry_set_socket (void)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int i, rl, needlf = 0;
char *cwd, *str;

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,7 @@ typedef struct header_record *header;
struct stream_record
{
FILE *handle;
int (*action)();
int (*action)(FILE *);
struct stream_record *rest_streams;
};
typedef struct stream_record *stream_list;
@ -147,8 +147,8 @@ static line_list file_preface;
static stream_list the_streams;
static boolean no_problems = true;
extern FILE *popen ();
extern int fclose (), pclose ();
extern FILE *popen (const char *, const char *);
extern int fclose (FILE *), pclose (FILE *);
#ifdef CURRENT_USER
extern struct passwd *getpwuid ();
@ -164,8 +164,7 @@ static struct passwd *my_entry;
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
static void
error (s1, s2)
char *s1, *s2;
error (char *s1, char *s2)
{
printf ("%s: ", my_name);
printf (s1, s2);
@ -176,8 +175,7 @@ error (s1, s2)
/* Print error message and exit. */
static void
fatal (s1)
char *s1;
fatal (char *s1)
{
error ("%s", s1);
exit (EXIT_FAILURE);
@ -186,8 +184,7 @@ fatal (s1)
/* Like malloc but get fatal error if memory is exhausted. */
static long *
xmalloc (size)
int size;
xmalloc (int size)
{
long *result = (long *) malloc (((unsigned) size));
if (result == ((long *) NULL))
@ -196,9 +193,7 @@ xmalloc (size)
}
static long *
xrealloc (ptr, size)
long *ptr;
int size;
xrealloc (long int *ptr, int size)
{
long *result = (long *) realloc (ptr, ((unsigned) size));
if (result == ((long *) NULL))
@ -209,8 +204,7 @@ xrealloc (ptr, size)
/* Initialize a linebuffer for use */
void
init_linebuffer (linebuffer)
struct linebuffer *linebuffer;
init_linebuffer (struct linebuffer *linebuffer)
{
linebuffer->size = INITIAL_LINE_SIZE;
linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE));
@ -220,9 +214,7 @@ init_linebuffer (linebuffer)
Return the length of the line. */
long
readline (linebuffer, stream)
struct linebuffer *linebuffer;
FILE *stream;
readline (struct linebuffer *linebuffer, FILE *stream)
{
char *buffer = linebuffer->buffer;
char *p = linebuffer->buffer;
@ -257,9 +249,7 @@ readline (linebuffer, stream)
If there is no keyword, return NULL and don't alter *REST. */
char *
get_keyword (field, rest)
register char *field;
char **rest;
get_keyword (register char *field, char **rest)
{
static char keyword[KEYWORD_SIZE];
register char *ptr;
@ -284,8 +274,7 @@ get_keyword (field, rest)
/* Nonzero if the string FIELD starts with a colon-terminated keyword. */
boolean
has_keyword (field)
char *field;
has_keyword (char *field)
{
char *ignored;
return (get_keyword (field, &ignored) != ((char *) NULL));
@ -302,9 +291,7 @@ has_keyword (field)
the caller has to make it big enough. */
char *
add_field (the_list, field, where)
line_list the_list;
register char *field, *where;
add_field (line_list the_list, register char *field, register char *where)
{
register char c;
while (true)
@ -360,7 +347,7 @@ add_field (the_list, field, where)
}
line_list
make_file_preface ()
make_file_preface (void)
{
char *the_string, *temp;
long idiotic_interface;
@ -404,9 +391,7 @@ make_file_preface ()
}
void
write_line_list (the_list, the_stream)
register line_list the_list;
FILE *the_stream;
write_line_list (register line_list the_list, FILE *the_stream)
{
for ( ;
the_list != ((line_list) NULL) ;
@ -419,7 +404,7 @@ write_line_list (the_list, the_stream)
}
int
close_the_streams ()
close_the_streams (void)
{
register stream_list rem;
for (rem = the_streams;
@ -432,9 +417,7 @@ close_the_streams ()
}
void
add_a_stream (the_stream, closing_action)
FILE *the_stream;
int (*closing_action)();
add_a_stream (FILE *the_stream, int (*closing_action) (FILE *))
{
stream_list old = the_streams;
the_streams = new_stream ();
@ -445,8 +428,7 @@ add_a_stream (the_stream, closing_action)
}
int
my_fclose (the_file)
FILE *the_file;
my_fclose (FILE *the_file)
{
putc ('\n', the_file);
fflush (the_file);
@ -454,8 +436,7 @@ my_fclose (the_file)
}
boolean
open_a_file (name)
char *name;
open_a_file (char *name)
{
FILE *the_stream = fopen (name, "a");
if (the_stream != ((FILE *) NULL))
@ -470,8 +451,7 @@ open_a_file (name)
}
void
put_string (s)
char *s;
put_string (char *s)
{
register stream_list rem;
for (rem = the_streams;
@ -482,8 +462,7 @@ put_string (s)
}
void
put_line (string)
char *string;
put_line (char *string)
{
register stream_list rem;
for (rem = the_streams;
@ -543,9 +522,7 @@ put_line (string)
Call open_a_file for each file. */
void
setup_files (the_list, field)
register line_list the_list;
register char *field;
setup_files (register line_list the_list, register char *field)
{
register char *start;
register char c;
@ -581,8 +558,7 @@ setup_files (the_list, field)
The result says how big to make the buffer to pass to parse_header. */
int
args_size (the_header)
header the_header;
args_size (header the_header)
{
register header old = the_header;
register line_list rem;
@ -613,9 +589,7 @@ args_size (the_header)
Also, if the header has any FCC fields, call setup_files for each one. */
void
parse_header (the_header, where)
header the_header;
register char *where;
parse_header (header the_header, register char *where)
{
register header old = the_header;
do
@ -647,7 +621,7 @@ parse_header (the_header, where)
Continuation lines are grouped in the headers they continue. */
header
read_header ()
read_header (void)
{
register header the_header = ((header) NULL);
register line_list *next_line = ((line_list *) NULL);
@ -701,8 +675,7 @@ read_header ()
}
void
write_header (the_header)
header the_header;
write_header (header the_header)
{
register header old = the_header;
do
@ -719,9 +692,7 @@ write_header (the_header)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
char *command_line;
header the_header;
@ -731,7 +702,7 @@ main (argc, argv)
register int size;
FILE *the_pipe;
extern char *getenv ();
extern char *getenv (const char *);
mail_program_name = getenv ("FAKEMAILER");
if (!(mail_program_name && *mail_program_name))

View file

@ -49,12 +49,10 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
int group_by = DEFAULT_GROUPING;
char *progname;
void usage();
void usage(void);
int
main (argc, argv)
int argc;
char *argv[];
main (int argc, char **argv)
{
register long address;
char string[18];
@ -278,7 +276,7 @@ main (argc, argv)
}
void
usage ()
usage (void)
{
fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
exit (EXIT_FAILURE);

View file

@ -67,9 +67,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
#endif
int scan_file ();
int scan_lisp_file ();
int scan_c_file ();
int scan_file (char *filename);
int scan_lisp_file (char *filename, char *mode);
int scan_c_file (char *filename, char *mode);
#ifdef MSDOS
/* s/msdos.h defines this as sys_chdir, but we're not linking with the
@ -91,8 +91,7 @@ char *progname;
/* VARARGS1 */
void
error (s1, s2)
char *s1, *s2;
error (char *s1, char *s2)
{
fprintf (stderr, "%s: ", progname);
fprintf (stderr, s1, s2);
@ -103,8 +102,7 @@ error (s1, s2)
/* VARARGS1 */
void
fatal (s1, s2)
char *s1, *s2;
fatal (char *s1, char *s2)
{
error (s1, s2);
exit (EXIT_FAILURE);
@ -113,8 +111,7 @@ fatal (s1, s2)
/* Like malloc but get fatal error if memory is exhausted. */
void *
xmalloc (size)
unsigned int size;
xmalloc (unsigned int size)
{
void *result = (void *) malloc (size);
if (result == NULL)
@ -123,9 +120,7 @@ xmalloc (size)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int i;
int err_count = 0;
@ -187,8 +182,7 @@ main (argc, argv)
/* Add a source file name boundary marker in the output file. */
void
put_filename (filename)
char *filename;
put_filename (char *filename)
{
char *tmp;
@ -207,8 +201,7 @@ put_filename (filename)
/* Return 1 if file is not found, 0 if it is found. */
int
scan_file (filename)
char *filename;
scan_file (char *filename)
{
int len = strlen (filename);
@ -251,9 +244,7 @@ struct rcsoc_state
spaces are output first. */
static INLINE void
put_char (ch, state)
int ch;
struct rcsoc_state *state;
put_char (int ch, struct rcsoc_state *state)
{
int out_ch;
do
@ -286,9 +277,7 @@ put_char (ch, state)
keyword, but were in fact not. */
static void
scan_keyword_or_put_char (ch, state)
int ch;
struct rcsoc_state *state;
scan_keyword_or_put_char (int ch, struct rcsoc_state *state)
{
if (state->keyword
&& *state->cur_keyword_ptr == ch
@ -359,11 +348,7 @@ scan_keyword_or_put_char (ch, state)
true if any were encountered. */
int
read_c_string_or_comment (infile, printflag, comment, saw_usage)
FILE *infile;
int printflag;
int *saw_usage;
int comment;
read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage)
{
register int c;
struct rcsoc_state state;
@ -451,10 +436,7 @@ read_c_string_or_comment (infile, printflag, comment, saw_usage)
MINARGS and MAXARGS are the minimum and maximum number of arguments. */
void
write_c_args (out, func, buf, minargs, maxargs)
FILE *out;
char *func, *buf;
int minargs, maxargs;
write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
{
register char *p;
int in_ident = 0;
@ -538,8 +520,7 @@ write_c_args (out, func, buf, minargs, maxargs)
Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */
int
scan_c_file (filename, mode)
char *filename, *mode;
scan_c_file (char *filename, char *mode)
{
FILE *infile;
register int c;
@ -815,8 +796,7 @@ scan_c_file (filename, mode)
*/
void
skip_white (infile)
FILE *infile;
skip_white (FILE *infile)
{
char c = ' ';
while (c == ' ' || c == '\t' || c == '\n' || c == '\r')
@ -825,9 +805,7 @@ skip_white (infile)
}
void
read_lisp_symbol (infile, buffer)
FILE *infile;
char *buffer;
read_lisp_symbol (FILE *infile, char *buffer)
{
char c;
char *fillp = buffer;
@ -855,8 +833,7 @@ read_lisp_symbol (infile, buffer)
}
int
scan_lisp_file (filename, mode)
char *filename, *mode;
scan_lisp_file (char *filename, char *mode)
{
FILE *infile;
register int c;

View file

@ -69,6 +69,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "syswait.h"
#ifdef MAIL_USE_POP
#include "pop.h"
@ -140,33 +143,35 @@ static char *mail_spool_name ();
#endif
#endif
char *strerror ();
#ifndef HAVE_STRERROR
char *strerror (int);
#endif
#ifdef HAVE_INDEX
extern char *index __P ((const char *, int));
extern char *index (const char *, int);
#endif
#ifdef HAVE_RINDEX
extern char *rindex __P((const char *, int));
extern char *rindex (const char *, int);
#endif
void fatal ();
void error ();
void pfatal_with_name ();
void pfatal_and_delete ();
char *concat ();
long *xmalloc ();
int popmail ();
int pop_retr ();
int mbx_write ();
int mbx_delimit_begin ();
int mbx_delimit_end ();
static void fatal (char *s1, char *s2, char *s3);
static void error (char *s1, char *s2, char *s3);
static void pfatal_with_name (char *name);
static void pfatal_and_delete (char *name);
static char *concat (char *s1, char *s2, char *s3);
static long *xmalloc (unsigned int size);
#ifdef MAIL_USE_POP
static int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order);
static int pop_retr (popserver server, int msgno, FILE *arg);
static int mbx_write (char *line, int len, FILE *mbf);
static int mbx_delimit_begin (FILE *mbf);
static int mbx_delimit_end (FILE *mbf);
#endif
/* Nonzero means this is name of a lock file to delete on fatal error. */
char *delete_lockname;
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
char *inname, *outname;
int indesc, outdesc;
@ -589,9 +594,8 @@ mail_spool_name (inname)
/* Print error message and exit. */
void
fatal (s1, s2, s3)
char *s1, *s2, *s3;
static void
fatal (char *s1, char *s2, char *s3)
{
if (delete_lockname)
unlink (delete_lockname);
@ -602,9 +606,8 @@ fatal (s1, s2, s3)
/* Print error message. `s1' is printf control string, `s2' and `s3'
are args for it or null. */
void
error (s1, s2, s3)
char *s1, *s2, *s3;
static void
error (char *s1, char *s2, char *s3)
{
fprintf (stderr, "movemail: ");
if (s3)
@ -616,16 +619,14 @@ error (s1, s2, s3)
fprintf (stderr, "\n");
}
void
pfatal_with_name (name)
char *name;
static void
pfatal_with_name (char *name)
{
fatal ("%s for %s", strerror (errno), name);
}
void
pfatal_and_delete (name)
char *name;
static void
pfatal_and_delete (char *name)
{
char *s = strerror (errno);
unlink (name);
@ -634,9 +635,8 @@ pfatal_and_delete (name)
/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
char *
concat (s1, s2, s3)
char *s1, *s2, *s3;
static char *
concat (char *s1, char *s2, char *s3)
{
int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
@ -651,9 +651,8 @@ concat (s1, s2, s3)
/* Like malloc but get fatal error if memory is exhausted. */
long *
xmalloc (size)
unsigned size;
static long *
xmalloc (unsigned int size)
{
long *result = (long *) malloc (size);
if (!result)
@ -702,19 +701,14 @@ char Errmsg[200]; /* POP errors, at least, can exceed
* Return a value suitable for passing to `exit'.
*/
int
popmail (mailbox, outfile, preserve, password, reverse_order)
char *mailbox;
char *outfile;
int preserve;
char *password;
int reverse_order;
static int
popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order)
{
int nmsgs, nbytes;
register int i;
int mbfi;
FILE *mbf;
char *getenv ();
char *getenv (const char *);
popserver server;
int start, end, increment;
char *user, *hostname;
@ -833,13 +827,9 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
return EXIT_SUCCESS;
}
int
pop_retr (server, msgno, arg)
popserver server;
int msgno;
FILE *arg;
static int
pop_retr (popserver server, int msgno, FILE *arg)
{
extern char *strerror ();
char *line;
int ret;
@ -884,11 +874,8 @@ pop_retr (server, msgno, arg)
&& (a[3] == 'm') \
&& (a[4] == ' '))
int
mbx_write (line, len, mbf)
char *line;
int len;
FILE *mbf;
static int
mbx_write (char *line, int len, FILE *mbf)
{
#ifdef MOVEMAIL_QUOTE_POP_FROM_LINES
if (IS_FROM_LINE (line))
@ -911,9 +898,8 @@ mbx_write (line, len, mbf)
return (OK);
}
int
mbx_delimit_begin (mbf)
FILE *mbf;
static int
mbx_delimit_begin (FILE *mbf)
{
time_t now;
struct tm *ltime;
@ -929,9 +915,8 @@ mbx_delimit_begin (mbf)
return (OK);
}
int
mbx_delimit_end (mbf)
FILE *mbf;
static int
mbx_delimit_end (FILE *mbf)
{
if (putc ('\n', mbf) == EOF)
return (NOTOK);

View file

@ -108,24 +108,16 @@ extern int h_errno;
#endif
#endif
#ifndef __P
# ifdef __STDC__
# define __P(a) a
# else
# define __P(a) ()
# endif /* __STDC__ */
#endif /* ! __P */
static int socket_connection __P((char *, int));
static int pop_getline __P((popserver, char **));
static int sendline __P((popserver, char *));
static int fullwrite __P((int, char *, int));
static int getok __P((popserver));
static int socket_connection (char *, int);
static int pop_getline (popserver, char **);
static int sendline (popserver, char *);
static int fullwrite (int, char *, int);
static int getok (popserver);
#if 0
static int gettermination __P((popserver));
static int gettermination (popserver);
#endif
static void pop_trash __P((popserver));
static char *find_crlf __P((char *, int));
static void pop_trash (popserver);
static char *find_crlf (char *, int);
#define ERROR_MAX 160 /* a pretty arbitrary size, but needs
to be bigger than the original
@ -174,11 +166,7 @@ int pop_debug = 0;
* explanation of the error.
*/
popserver
pop_open (host, username, password, flags)
char *host;
char *username;
char *password;
int flags;
pop_open (char *host, char *username, char *password, int flags)
{
int sock;
popserver server;
@ -345,10 +333,7 @@ pop_open (host, username, password, flags)
* connection impossible.
*/
int
pop_stat (server, count, size)
popserver server;
int *count;
int *size;
pop_stat (popserver server, int *count, int *size)
{
char *fromserver;
char *end_ptr;
@ -421,11 +406,7 @@ pop_stat (server, count, size)
* connection impossible.
*/
int
pop_list (server, message, IDs, sizes)
popserver server;
int message;
int **IDs;
int **sizes;
pop_list (popserver server, int message, int **IDs, int **sizes)
{
int how_many, i;
char *fromserver;
@ -567,11 +548,7 @@ pop_list (server, message, IDs, sizes)
* Side effects: May kill connection on error.
*/
int
pop_retrieve (server, message, markfrom, msg_buf)
popserver server;
int message;
int markfrom;
char **msg_buf;
pop_retrieve (popserver server, int message, int markfrom, char **msg_buf)
{
int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
char *ptr, *fromserver;
@ -635,7 +612,7 @@ pop_retrieve (server, message, markfrom, msg_buf)
}
ptr[cp++] = '>';
}
bcopy (fromserver, &ptr[cp], ret);
memcpy (&ptr[cp], fromserver, ret);
cp += ret;
ptr[cp++] = '\n';
}
@ -645,10 +622,7 @@ pop_retrieve (server, message, markfrom, msg_buf)
}
int
pop_retrieve_first (server, message, response)
popserver server;
int message;
char **response;
pop_retrieve_first (popserver server, int message, char **response)
{
sprintf (pop_error, "RETR %d", message);
return (pop_multi_first (server, pop_error, response));
@ -663,25 +637,19 @@ pop_retrieve_first (server, message, response)
*/
int
pop_retrieve_next (server, line)
popserver server;
char **line;
pop_retrieve_next (popserver server, char **line)
{
return (pop_multi_next (server, line));
}
int
pop_retrieve_flush (server)
popserver server;
pop_retrieve_flush (popserver server)
{
return (pop_multi_flush (server));
}
int
pop_top_first (server, message, lines, response)
popserver server;
int message, lines;
char **response;
pop_top_first (popserver server, int message, int lines, char **response)
{
sprintf (pop_error, "TOP %d %d", message, lines);
return (pop_multi_first (server, pop_error, response));
@ -696,25 +664,19 @@ pop_top_first (server, message, lines, response)
*/
int
pop_top_next (server, line)
popserver server;
char **line;
pop_top_next (popserver server, char **line)
{
return (pop_multi_next (server, line));
}
int
pop_top_flush (server)
popserver server;
pop_top_flush (popserver server)
{
return (pop_multi_flush (server));
}
int
pop_multi_first (server, command, response)
popserver server;
char *command;
char **response;
pop_multi_first (popserver server, char *command, char **response)
{
if (server->in_multi)
{
@ -757,9 +719,7 @@ pop_multi_first (server, command, response)
0, LINE is set to null. */
int
pop_multi_next (server, line)
popserver server;
char **line;
pop_multi_next (popserver server, char **line)
{
char *fromserver;
int ret;
@ -797,8 +757,7 @@ pop_multi_next (server, line)
}
int
pop_multi_flush (server)
popserver server;
pop_multi_flush (popserver server)
{
char *line;
int ret;
@ -829,9 +788,7 @@ pop_multi_flush (server)
* otherwise.
*/
int
pop_delete (server, message)
popserver server;
int message;
pop_delete (popserver server, int message)
{
if (server->in_multi)
{
@ -861,8 +818,7 @@ pop_delete (server, message)
* Side effects: Closes connection on error.
*/
int
pop_noop (server)
popserver server;
pop_noop (popserver server)
{
if (server->in_multi)
{
@ -891,8 +847,7 @@ pop_noop (server)
* Side effects: Closes the connection on error.
*/
int
pop_last (server)
popserver server;
pop_last (popserver server)
{
char *fromserver;
@ -949,8 +904,7 @@ pop_last (server)
* Side effects: Closes the connection on error.
*/
int
pop_reset (server)
popserver server;
pop_reset (popserver server)
{
if (pop_retrieve_flush (server))
{
@ -978,8 +932,7 @@ pop_reset (server)
* function is called, even if an error occurs.
*/
int
pop_quit (server)
popserver server;
pop_quit (popserver server)
{
int ret = 0;
@ -1023,9 +976,7 @@ static int have_winsock = 0;
* into pop_error.
*/
static int
socket_connection (host, flags)
char *host;
int flags;
socket_connection (char *host, int flags)
{
#ifdef HAVE_GETADDRINFO
struct addrinfo *res, *it;
@ -1069,7 +1020,7 @@ socket_connection (host, flags)
}
#endif
bzero ((char *) &addr, sizeof (addr));
memset (&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
/** "kpop" service is never used: look for 20060515 to see why **/
@ -1145,8 +1096,7 @@ socket_connection (host, flags)
if (it->ai_addrlen == sizeof (addr))
{
struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr;
bcopy (&in_a->sin_addr, (char *) &addr.sin_addr,
sizeof (addr.sin_addr));
memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr));
if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
break;
}
@ -1174,8 +1124,7 @@ socket_connection (host, flags)
while (*hostent->h_addr_list)
{
bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr,
hostent->h_length);
memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length);
if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
break;
hostent->h_addr_list++;
@ -1335,9 +1284,7 @@ socket_connection (host, flags)
* THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS!
*/
static int
pop_getline (server, line)
popserver server;
char **line;
pop_getline (popserver server, char **line)
{
#define GETLINE_ERROR "Error reading from server: "
@ -1369,8 +1316,8 @@ pop_getline (server, line)
}
else
{
bcopy (server->buffer + server->buffer_index,
server->buffer, server->data);
memmove (server->buffer, server->buffer + server->buffer_index,
server->data);
/* Record the fact that we've searched the data already in
the buffer for a CRLF, so that when we search below, we
don't have to search the same data twice. There's a "-
@ -1467,9 +1414,7 @@ pop_getline (server, line)
* Side effects: Closes the connection on error.
*/
static int
sendline (server, line)
popserver server;
char *line;
sendline (popserver server, char *line)
{
#define SENDLINE_ERROR "Error writing to POP server: "
int ret;
@ -1516,10 +1461,7 @@ sendline (server, line)
* Return value: Same as write. Pop_error is not set.
*/
static int
fullwrite (fd, buf, nbytes)
int fd;
char *buf;
int nbytes;
fullwrite (int fd, char *buf, int nbytes)
{
char *cp;
int ret = 0;
@ -1549,8 +1491,7 @@ fullwrite (fd, buf, nbytes)
* Side effects: On failure, may make the connection unusable.
*/
static int
getok (server)
popserver server;
getok (popserver server)
{
char *fromline;
@ -1621,8 +1562,7 @@ gettermination (server)
* since the last pop_reset) may be lost.
*/
void
pop_close (server)
popserver server;
pop_close (popserver server)
{
pop_trash (server);
free ((char *) server);
@ -1638,8 +1578,7 @@ pop_close (server)
* pop_close or pop_quit after this function has been called.
*/
static void
pop_trash (server)
popserver server;
pop_trash (popserver server)
{
if (server->file >= 0)
{
@ -1671,9 +1610,7 @@ pop_trash (server)
null, or 0 if it does not contain one. */
static char *
find_crlf (in_string, len)
char *in_string;
int len;
find_crlf (char *in_string, int len)
{
while (len--)
{

View file

@ -40,7 +40,7 @@ static char time_string[30];
/* Reset the stopwatch to zero. */
void
reset_watch ()
reset_watch (void)
{
EMACS_GET_TIME (TV1);
watch_not_started = 0;
@ -51,7 +51,7 @@ reset_watch ()
If reset_watch was not called yet, exit. */
char *
get_time ()
get_time (void)
{
if (watch_not_started)
exit (EXIT_FAILURE); /* call reset_watch first ! */
@ -79,7 +79,7 @@ gettimeofday (tp, tzp)
#endif
int
main ()
main (void)
{
int c;
while ((c = getchar ()) != EOF)

View file

@ -65,8 +65,7 @@ struct docstr /* Allocated thing for an entry. */
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
void
error (s1, s2)
char *s1, *s2;
error (char *s1, char *s2)
{
fprintf (stderr, "sorted-doc: ");
fprintf (stderr, s1, s2);
@ -76,8 +75,7 @@ error (s1, s2)
/* Print error message and exit. */
void
fatal (s1, s2)
char *s1, *s2;
fatal (char *s1, char *s2)
{
error (s1, s2);
exit (EXIT_FAILURE);
@ -86,8 +84,7 @@ fatal (s1, s2)
/* Like malloc but get fatal error if memory is exhausted. */
char *
xmalloc (size)
int size;
xmalloc (int size)
{
char *result = malloc ((unsigned)size);
if (result == NULL)
@ -96,8 +93,7 @@ xmalloc (size)
}
char *
xstrdup (str)
char * str;
xstrdup (char *str)
{
char *buf = xmalloc (strlen (str) + 1);
(void) strcpy (buf, str);
@ -107,16 +103,15 @@ xstrdup (str)
/* Comparison function for qsort to call. */
int
cmpdoc (a, b)
DOCSTR **a;
DOCSTR **b;
cmpdoc (const void *va, const void *vb)
{
DOCSTR *const *a = va;
DOCSTR *const *b = vb;
register int val = strcmp ((*a)->name, (*b)->name);
if (val) return val;
return (*a)->type - (*b)->type;
}
enum state
{
WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET
@ -128,7 +123,7 @@ char *states[] =
};
int
main ()
main (void)
{
register DOCSTR *dp = NULL; /* allocated DOCSTR */
register LINE *lp = NULL; /* allocated line */

View file

@ -52,10 +52,7 @@ char buf[300];
/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */
int
cool_read (fd, buf, size)
int fd;
char *buf;
int size;
cool_read (int fd, char *buf, int size)
{
int num, sofar = 0;
@ -70,9 +67,7 @@ cool_read (fd, buf, size)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int fd;

View file

@ -64,21 +64,13 @@ extern int optind, opterr;
#define MAX_SCORES 200
#define MAX_DATA_LEN 1024
/* Declare the prototype for a general external function. */
#if defined (PROTOTYPES) || defined (WINDOWSNT)
#define P_(proto) proto
#else
#define P_(proto) ()
#endif
#ifndef HAVE_DIFFTIME
/* OK on POSIX (time_t is arithmetic type) modulo overflow in subtraction. */
#define difftime(t1, t0) (double)((t1) - (t0))
#endif
int
usage (err)
int err;
usage (int err)
{
fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n");
fprintf (stdout, " update-game-score -h\n");
@ -89,8 +81,8 @@ usage (err)
exit (err);
}
int lock_file P_ ((const char *filename, void **state));
int unlock_file P_ ((const char *filename, void *state));
int lock_file (const char *filename, void **state);
int unlock_file (const char *filename, void *state);
struct score_entry
{
@ -99,25 +91,24 @@ struct score_entry
char *data;
};
int read_scores P_ ((const char *filename, struct score_entry **scores,
int *count));
int push_score P_ ((struct score_entry **scores, int *count,
int newscore, char *username, char *newdata));
void sort_scores P_ ((struct score_entry *scores, int count, int reverse));
int write_scores P_ ((const char *filename, const struct score_entry *scores,
int count));
int read_scores (const char *filename, struct score_entry **scores,
int *count);
int push_score (struct score_entry **scores, int *count,
int newscore, char *username, char *newdata);
void sort_scores (struct score_entry *scores, int count, int reverse);
int write_scores (const char *filename, const struct score_entry *scores,
int count);
void lose P_ ((const char *msg)) NO_RETURN;
void lose (const char *msg) NO_RETURN;
void
lose (msg)
const char *msg;
lose (const char *msg)
{
fprintf (stderr, "%s\n", msg);
exit (EXIT_FAILURE);
}
void lose_syserr P_ ((const char *msg)) NO_RETURN;
void lose_syserr (const char *msg) NO_RETURN;
/* Taken from sysdep.c. */
#ifndef HAVE_STRERROR
@ -137,15 +128,14 @@ strerror (errnum)
#endif /* ! HAVE_STRERROR */
void
lose_syserr (msg)
const char *msg;
lose_syserr (const char *msg)
{
fprintf (stderr, "%s: %s\n", msg, strerror (errno));
exit (EXIT_FAILURE);
}
char *
get_user_id P_ ((void))
get_user_id (void)
{
char *name;
struct passwd *buf = getpwuid (getuid ());
@ -166,9 +156,7 @@ get_user_id P_ ((void))
}
char *
get_prefix (running_suid, user_prefix)
int running_suid;
char *user_prefix;
get_prefix (int running_suid, char *user_prefix)
{
if (!running_suid && user_prefix == NULL)
lose ("Not using a shared game directory, and no prefix given.");
@ -184,9 +172,7 @@ get_prefix (running_suid, user_prefix)
}
int
main (argc, argv)
int argc;
char **argv;
main (int argc, char **argv)
{
int c, running_suid;
void *lockstate;
@ -273,9 +259,7 @@ main (argc, argv)
}
int
read_score (f, score)
FILE *f;
struct score_entry *score;
read_score (FILE *f, struct score_entry *score)
{
int c;
if (feof (f))
@ -359,10 +343,7 @@ read_score (f, score)
}
int
read_scores (filename, scores, count)
const char *filename;
struct score_entry **scores;
int *count;
read_scores (const char *filename, struct score_entry **scores, int *count)
{
int readval, scorecount, cursize;
struct score_entry *ret;
@ -395,9 +376,7 @@ read_scores (filename, scores, count)
}
int
score_compare (a, b)
const void *a;
const void *b;
score_compare (const void *a, const void *b)
{
const struct score_entry *sa = (const struct score_entry *) a;
const struct score_entry *sb = (const struct score_entry *) b;
@ -405,9 +384,7 @@ score_compare (a, b)
}
int
score_compare_reverse (a, b)
const void *a;
const void *b;
score_compare_reverse (const void *a, const void *b)
{
const struct score_entry *sa = (const struct score_entry *) a;
const struct score_entry *sb = (const struct score_entry *) b;
@ -415,11 +392,7 @@ score_compare_reverse (a, b)
}
int
push_score (scores, count, newscore, username, newdata)
struct score_entry **scores;
int *count; int newscore;
char *username;
char *newdata;
push_score (struct score_entry **scores, int *count, int newscore, char *username, char *newdata)
{
struct score_entry *newscores
= (struct score_entry *) realloc (*scores,
@ -435,20 +408,14 @@ push_score (scores, count, newscore, username, newdata)
}
void
sort_scores (scores, count, reverse)
struct score_entry *scores;
int count;
int reverse;
sort_scores (struct score_entry *scores, int count, int reverse)
{
qsort (scores, count, sizeof (struct score_entry),
reverse ? score_compare_reverse : score_compare);
}
int
write_scores (filename, scores, count)
const char *filename;
const struct score_entry * scores;
int count;
write_scores (const char *filename, const struct score_entry *scores, int count)
{
FILE *f;
int i;
@ -477,9 +444,7 @@ write_scores (filename, scores, count)
}
int
lock_file (filename, state)
const char *filename;
void **state;
lock_file (const char *filename, void **state)
{
int fd;
struct stat buf;
@ -520,9 +485,7 @@ lock_file (filename, state)
}
int
unlock_file (filename, state)
const char *filename;
void *state;
unlock_file (const char *filename, void *state)
{
char *lockpath = (char *) state;
int ret = unlink (lockpath);

View file

@ -1,3 +1,90 @@
2010-07-08 Daiki Ueno <ueno@unixuser.org>
* epa-file.el (epa-file-error, epa-file--find-file-not-found-function)
(epa-file-insert-file-contents): Hack to prevent
find-file from opening empty buffer when decryptin failed
(bug#6568).
2010-07-07 Agustín Martín <agustin.martin@hispalinux.es>
* ispell.el (ispell-alternate-dictionary): Use file-readable-p.
Return nil if no word-list is found at default locations.
(ispell-complete-word-dict): Default to nil.
(ispell-command-loop): Use 'word-list' when using lookup-words.
(lookup-words): Use ispell-complete-word-dict or
ispell-alternate-dictionary. Check for word-list availability
and handle errors if needed with better messages (Bug#6539).
(ispell-complete-word): Use ispell-complete-word-dict or
ispell-alternate-dictionary.
2010-07-07 Glenn Morris <rgm@gnu.org>
* play/zone.el (top-level): Do not require timer, tabify, or cl.
(zone-shift-left): Ignore intangibility, and any errors from
forward-char.
(zone-shift-right): Remove no-op end-of-line. Ignore intangibility.
(zone-pgm-putz-with-case): Use upcase-region rather than inserting,
deleting, and copying text properties.
(zone-line-specs, zone-pgm-stress): Check forward-line exit status.
(zone-pgm-rotate): Handle odd buffers like that of gomoku, where getting
to point-max is hard.
(zone-fret, zone-fill-out-screen): Replace cl's do with dotimes.
(zone-fill-out-screen): Ignore intangibility.
2010-07-05 Chong Yidong <cyd@stupidchicken.com>
* menu-bar.el (menu-bar-mode):
* tool-bar.el (tool-bar-mode): Replace default-frame-alist element
if it has been set.
* mouse.el (mouse-drag-track): Call mouse-start-end to handle
word/line selection (Bug#6565).
2010-07-04 Juanma Barranquero <lekktu@gmail.com>
* net/dbus.el (dbus-send-signal): Declare function.
2010-07-04 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el: Implement signal "PropertiesChanged" (from D-Bus 1.3.1).
(dbus-register-property): New optional argument EMITS-SIGNAL.
(dbus-property-handler): Send signal "PropertiesChanged" if requested.
2010-07-03 Chong Yidong <cyd@stupidchicken.com>
* mouse.el (mouse-drag-overlay): Variable deleted.
(mouse-move-drag-overlay, mouse-show-mark): Functions deleted.
(mouse--remap-link-click-p): New function.
(mouse-drag-track): Handle dragging by using temporary Transient
Mark mode, instead of a special overlay.
(mouse-kill-ring-save, mouse-save-then-kill): Don't call
mouse-show-mark.
* mouse-sel.el (mouse-sel-selection-alist): mouse-drag-overlay
deleted.
2010-07-02 Juri Linkov <juri@jurta.org>
* autoinsert.el (auto-insert-alist): Fix readability
by using dotted pair notation for lambda.
2010-07-02 Juri Linkov <juri@jurta.org>
* faces.el (read-face-name): Rename arg `string-describing-default'
to `default'. Doc fix. Display the default value in quotes
in the prompt. With empty input, return the `default' arg,
unless the default value is a string (in which case return nil).
(describe-face): Replace the string `default' arg of `read-face-name'
with the symbol `default'.
2010-07-02 Chong Yidong <cyd@stupidchicken.com>
* emulation/viper-cmd.el (viper-delete-backward-char)
(viper-del-backward-char-in-insert)
(viper-del-backward-char-in-replace, viper-change)
(viper-backward-indent): Replace delete-backward-char with
delete-char (Bug#6552).
2010-07-01 Chong Yidong <cyd@stupidchicken.com>
* ruler-mode.el (ruler--save-header-line-format): Fix typos.

View file

@ -126,10 +126,10 @@ If this contains a %s, that will be replaced by the matching rule."
_ "\n\\begin{document}\n" _
"\n\\end{document}")
(("/bin/.*[^/]\\'" . "Shell-Script mode magic number")
lambda ()
(("/bin/.*[^/]\\'" . "Shell-Script mode magic number") .
(lambda ()
(if (eq major-mode (default-value 'major-mode))
(sh-mode)))
(sh-mode))))
(ada-mode . ada-header)

View file

@ -1860,8 +1860,7 @@ With a prefix arg, prompts for a file to save them in."
(pop-up-windows t))
(delete-other-windows)
(switch-to-buffer (other-buffer))
(let ((bookmark-automatically-show-annotations nil)) ;FIXME: needed?
(bookmark--jump-via bmrk 'pop-to-buffer))
(bookmark--jump-via bmrk 'pop-to-buffer)
(bury-buffer menu)))
@ -1875,8 +1874,7 @@ With a prefix arg, prompts for a file to save them in."
"Select this line's bookmark in other window, leaving bookmark menu visible."
(interactive)
(let ((bookmark (bookmark-bmenu-bookmark)))
(let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
(bookmark--jump-via bookmark 'switch-to-buffer-other-window))))
(bookmark--jump-via bookmark 'switch-to-buffer-other-window)))
(defun bookmark-bmenu-switch-other-window ()
@ -1887,8 +1885,7 @@ The current window remains selected."
(pop-up-windows t)
same-window-buffer-names
same-window-regexps)
(let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
(bookmark--jump-via bookmark 'display-buffer))))
(bookmark--jump-via bookmark 'display-buffer)))
(defun bookmark-bmenu-other-window-with-mouse (event)
"Select bookmark at the mouse pointer in other window, leaving bookmark menu visible."

View file

@ -4247,7 +4247,7 @@ Null string will repeat previous search."
(setq viper-use-register nil)))
(if (and (bolp) viper-ex-style-editing)
(ding))
(delete-backward-char val t)))
(delete-char (- val) t)))
(defun viper-del-backward-char-in-insert ()
@ -4256,7 +4256,7 @@ Null string will repeat previous search."
(if (and viper-ex-style-editing (bolp))
(beep 1)
;; don't put on kill ring
(delete-backward-char 1 nil)))
(delete-char -1 nil)))
(defun viper-del-backward-char-in-replace ()
@ -4269,14 +4269,14 @@ cursor move past the beginning of line."
(cond (viper-delete-backwards-in-replace
(cond ((not (bolp))
;; don't put on kill ring
(delete-backward-char 1 nil))
(delete-char -1 nil))
(viper-ex-style-editing
(beep 1))
((bobp)
(beep 1))
(t
;; don't put on kill ring
(delete-backward-char 1 nil))))
(delete-char -1 nil))))
(viper-ex-style-editing
(if (bolp)
(beep 1)
@ -4344,7 +4344,7 @@ cursor move past the beginning of line."
(insert-before-markers "@") ; put placeholder after the TAB
(untabify (viper-replace-start) (point))
;; del @, don't put on kill ring
(delete-backward-char 1)
(delete-char -1)
(viper-set-replace-overlay-glyphs
viper-replace-region-start-delimiter
@ -4622,7 +4622,7 @@ One can use `` and '' to temporarily jump 1 step back."
(progn
(if (eq ?^ (preceding-char))
(setq viper-preserve-indent t))
(delete-backward-char 1)
(delete-char -1)
(setq p (point))
(setq indent nil)))
(save-excursion

View file

@ -101,6 +101,14 @@ way."
(insert (epa-file--decode-coding-string string (or coding-system-for-read
'undecided)))))
(defvar epa-file-error nil)
(defun epa-file--find-file-not-found-function ()
(let ((error epa-file-error))
(save-window-excursion
(kill-buffer))
(signal 'file-error
(cons "Opening input file" (cdr error)))))
(defvar last-coding-system-used)
(defun epa-file-insert-file-contents (file &optional visit beg end replace)
(barf-if-buffer-read-only)
@ -131,6 +139,15 @@ way."
(error
(if (setq entry (assoc file epa-file-passphrase-alist))
(setcdr entry nil))
;; Hack to prevent find-file from opening empty buffer
;; when decryption failed (bug#6568). See the place
;; where `find-file-not-found-functions' are called in
;; `find-file-noselect-1'.
(make-local-variable 'epa-file-error)
(setq epa-file-error error)
(add-hook 'find-file-not-found-functions
'epa-file--find-file-not-found-function
nil t)
(signal 'file-error
(cons "Opening input file" (cdr error)))))
(make-local-variable 'epa-file-encrypt-to)

View file

@ -915,13 +915,14 @@ of the default face. Value is FACE."
;;; Interactively modifying faces.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun read-face-name (prompt &optional string-describing-default multiple)
(defun read-face-name (prompt &optional default multiple)
"Read a face, defaulting to the face or faces on the char after point.
If it has the property `read-face-name', that overrides the `face' property.
PROMPT should be a string that describes what the caller will do with the face;
it should not end in a space.
STRING-DESCRIBING-DEFAULT should describe what default the caller will use if
the user just types RET; you can omit it.
The optional argument DEFAULT provides the value to display in the
minibuffer prompt that is returned if the user just types RET
unless DEFAULT is a string (in which case nil is returned).
If MULTIPLE is non-nil, return a list of faces (possibly only one).
Otherwise, return a single face."
(let ((faceprop (or (get-char-property (point) 'read-face-name)
@ -960,10 +961,10 @@ Otherwise, return a single face."
(let* ((input
;; Read the input.
(completing-read-multiple
(if (or faces string-describing-default)
(format "%s (default %s): " prompt
(if (or faces default)
(format "%s (default `%s'): " prompt
(if faces (mapconcat 'symbol-name faces ",")
string-describing-default))
default))
(format "%s: " prompt))
(completion-table-in-turn nonaliasfaces aliasfaces)
nil t nil 'face-name-history
@ -971,7 +972,7 @@ Otherwise, return a single face."
;; Canonicalize the output.
(output
(cond ((or (equal input "") (equal input '("")))
faces)
(or faces (unless (stringp default) default)))
((stringp input)
(mapcar 'intern (split-string input ", *" t)))
((listp input)
@ -1334,7 +1335,7 @@ and FRAME defaults to the selected frame.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame."
(interactive (list (read-face-name "Describe face" "= `default' face" t)))
(interactive (list (read-face-name "Describe face" 'default t)))
(let* ((attrs '((:family . "Family")
(:foundry . "Foundry")
(:width . "Width")

View file

@ -1937,15 +1937,20 @@ turn on menu bars; otherwise, turn off menu bars."
;; Turn the menu-bars on all frames on or off.
(let ((val (if menu-bar-mode 1 0)))
(dolist (frame (frame-list))
(set-frame-parameter frame 'menu-bar-lines val)))
(set-frame-parameter frame 'menu-bar-lines val))
;; If the user has given `default-frame-alist' a `menu-bar-lines'
;; parameter, replace it.
(if (assq 'menu-bar-lines default-frame-alist)
(setq default-frame-alist
(cons (cons 'menu-bar-lines val)
(assq-delete-all 'menu-bar-lines
default-frame-alist)))))
;; Make the message appear when Emacs is idle. We can not call message
;; directly. The minor-mode message "Menu-bar mode disabled" comes
;; after this function returns, overwriting any message we do here.
(when (and (called-interactively-p 'interactive) (not menu-bar-mode))
(run-with-idle-timer 0 nil 'message
"Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))
menu-bar-mode)
"Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear.")))
(defun toggle-menu-bar-mode-from-frame (&optional arg)
"Toggle menu bar on or off, based on the status of the current frame.

View file

@ -129,11 +129,6 @@
;; that the X primary selection is used. Under other windowing systems,
;; alternate functions are used, which simply store the selection value
;; in a variable.
;;
;; * You can change the selection highlight face by altering the properties
;; of mouse-drag-overlay, eg.
;;
;; (overlay-put mouse-drag-overlay 'face 'bold)
;;; Code:
@ -293,8 +288,7 @@ primary selection and region."
(overlay-put mouse-secondary-overlay 'face 'secondary-selection))
(defconst mouse-sel-selection-alist
'((PRIMARY mouse-drag-overlay mouse-sel-primary-thing)
(SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
'((SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))
"Alist associating selections with variables.
Each element is of the form:

View file

@ -772,13 +772,6 @@ Upon exit, point is at the far edge of the newly visible text."
(or (eq window (selected-window))
(goto-char opoint))))
;; Create an overlay and immediately delete it, to get "overlay in no buffer".
(defconst mouse-drag-overlay
(let ((ol (make-overlay (point-min) (point-min))))
(delete-overlay ol)
(overlay-put ol 'face 'region)
ol))
(defvar mouse-selection-click-count 0)
(defvar mouse-selection-click-count-buffer nil)
@ -905,27 +898,12 @@ at the same position."
"mouse-1" (substring msg 7)))))))
msg)
(defun mouse-move-drag-overlay (ol start end mode)
(unless (= start end)
;; Go to START first, so that when we move to END, if it's in the middle
;; of intangible text, point jumps in the direction away from START.
;; Don't do it if START=END otherwise a single click risks selecting
;; a region if it's on intangible text. This exception was originally
;; only applied on entry to mouse-drag-region, which had the problem
;; that a tiny move during a single-click would cause the intangible
;; text to be selected.
(goto-char start)
(goto-char end)
(setq end (point)))
(let ((range (mouse-start-end start end mode)))
(move-overlay ol (car range) (nth 1 range))))
(defun mouse-drag-track (start-event &optional
do-mouse-drag-region-post-process)
"Track mouse drags by highlighting area between point and cursor.
The region will be defined with mark and point, and the overlay
will be deleted after return. DO-MOUSE-DRAG-REGION-POST-PROCESS
should only be used by mouse-drag-region."
The region will be defined with mark and point.
DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
`mouse-drag-region'."
(mouse-minibuffer-check start-event)
(setq mouse-selection-click-count-buffer (current-buffer))
;; We must call deactivate-mark before repositioning point.
@ -959,171 +937,138 @@ should only be used by mouse-drag-region."
;; intangible text.
(mouse-on-link-p start-posn)))
(click-count (1- (event-click-count start-event)))
(remap-double-click (and on-link
(eq mouse-1-click-follows-link 'double)
(= click-count 1)))
;; Suppress automatic hscrolling, because that is a nuisance
;; when setting point near the right fringe (but see below).
(automatic-hscrolling-saved automatic-hscrolling)
(automatic-hscrolling nil))
(automatic-hscrolling nil)
event end end-point)
(setq mouse-selection-click-count click-count)
;; In case the down click is in the middle of some intangible text,
;; use the end of that text, and put it in START-POINT.
(if (< (point) start-point)
(goto-char start-point))
(setq start-point (point))
(if remap-double-click ;; Don't expand mouse overlay in links
(setq click-count 0))
(mouse-move-drag-overlay mouse-drag-overlay start-point start-point
click-count)
(overlay-put mouse-drag-overlay 'window start-window)
(let (event end end-point last-end-point)
(track-mouse
(while (progn
(setq event (read-event))
(or (mouse-movement-p event)
(memq (car-safe event) '(switch-frame select-window))))
(if (memq (car-safe event) '(switch-frame select-window))
nil
;; Automatic hscrolling did not occur during the call to
;; `read-event'; but if the user subsequently drags the
;; mouse, go ahead and hscroll.
(let ((automatic-hscrolling automatic-hscrolling-saved))
(redisplay))
(setq end (event-end event)
end-point (posn-point end))
(if (numberp end-point)
(setq last-end-point end-point))
(cond
;; Are we moving within the original window?
((and (eq (posn-window end) start-window)
;; Activate the region, using `mouse-start-end' to determine where
;; to put point and mark (e.g., double-click will select a word).
(setq transient-mark-mode
(if (eq transient-mark-mode 'lambda)
'(only)
(cons 'only transient-mark-mode)))
(let ((range (mouse-start-end start-point start-point click-count)))
(goto-char (nth 0 range))
(push-mark nil nil t)
(goto-char (nth 1 range)))
;; Track the mouse until we get a non-movement event.
(track-mouse
(while (progn
(setq event (read-event))
(or (mouse-movement-p event)
(memq (car-safe event) '(switch-frame select-window))))
(unless (memq (car-safe event) '(switch-frame select-window))
;; Automatic hscrolling did not occur during the call to
;; `read-event'; but if the user subsequently drags the
;; mouse, go ahead and hscroll.
(let ((automatic-hscrolling automatic-hscrolling-saved))
(redisplay))
(setq end (event-end event)
end-point (posn-point end))
(if (and (eq (posn-window end) start-window)
(integer-or-marker-p end-point))
(mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
;; If moving in the original window, move point by going
;; to start first, so that if end is in intangible text,
;; point jumps away from start. Don't do it if
;; start=end, or a single click would select a region if
;; it's on intangible text.
(unless (= start-point end-point)
(goto-char start-point)
(goto-char end-point))
(let ((mouse-row (cdr (cdr (mouse-position)))))
(cond
((null mouse-row))
((< mouse-row top)
(mouse-scroll-subr start-window (- mouse-row top)
nil start-point))
((>= mouse-row bottom)
(mouse-scroll-subr start-window (1+ (- mouse-row bottom))
nil start-point))))))))
(t
(let ((mouse-row (cdr (cdr (mouse-position)))))
(cond
((null mouse-row))
((< mouse-row top)
(mouse-scroll-subr start-window (- mouse-row top)
mouse-drag-overlay start-point))
((>= mouse-row bottom)
(mouse-scroll-subr start-window (1+ (- mouse-row bottom))
mouse-drag-overlay start-point)))))))))
;; In case we did not get a mouse-motion event
;; for the final move of the mouse before a drag event
;; pretend that we did get one.
(when (and (memq 'drag (event-modifiers (car-safe event)))
(setq end (event-end event)
end-point (posn-point end))
;; Handle the terminating event if possible.
(when (consp event)
;; Ensure that point is on the end of the last event.
(when (and (setq end-point (posn-point (event-end event)))
(eq (posn-window end) start-window)
(integer-or-marker-p end-point))
(mouse-move-drag-overlay mouse-drag-overlay start-point end-point click-count))
(integer-or-marker-p end-point)
(/= start-point end-point))
(goto-char start-point)
(goto-char end-point))
;; Find its binding.
(let* ((fun (key-binding (vector (car event))))
(do-multi-click (and (> (event-click-count event) 0)
(functionp fun)
(not (memq fun '(mouse-set-point
mouse-set-region))))))
(if (and (/= (mark) (point))
(not do-multi-click))
;; If point has moved, finish the drag.
(let* (last-command this-command)
;; Copy the region so that `select-active-regions' can
;; override `copy-region-as-kill'.
(and mouse-drag-copy-region
do-mouse-drag-region-post-process
(let (deactivate-mark)
(copy-region-as-kill (mark) (point)))))
;; If point hasn't moved, run the binding of the
;; terminating up-event.
(if do-multi-click
(goto-char start-point)
(deactivate-mark))
(when (and (functionp fun)
(= start-hscroll (window-hscroll start-window))
;; Don't run the up-event handler if the window
;; start changed in a redisplay after the
;; mouse-set-point for the down-mouse event at
;; the beginning of this function. When the
;; window start has changed, the up-mouse event
;; contains a different position due to the new
;; window contents, and point is set again.
(or end-point
(= (window-start start-window)
start-window-start)))
(when (and on-link
(= start-point (point))
(mouse--remap-link-click-p start-event event))
;; If we rebind to mouse-2, reselect previous selected
;; window, so that the mouse-2 event runs in the same
;; situation as if user had clicked it directly. Fixes
;; the bug reported by juri@jurta.org on 2005-12-27.
(if (or (vectorp on-link) (stringp on-link))
(setq event (aref on-link 0))
(select-window original-window)
(setcar event 'mouse-2)
;; If this mouse click has never been done by the
;; user, it doesn't have the necessary property to be
;; interpreted correctly.
(put 'mouse-2 'event-kind 'mouse-click)))
(push event unread-command-events)))))))
;; Handle the terminating event
(if (consp event)
(let* ((fun (key-binding (vector (car event))))
(do-multi-click (and (> (event-click-count event) 0)
(functionp fun)
(not (memq fun
'(mouse-set-point
mouse-set-region))))))
;; Run the binding of the terminating up-event, if possible.
(if (and (not (= (overlay-start mouse-drag-overlay)
(overlay-end mouse-drag-overlay)))
(not do-multi-click))
(let* ((stop-point
(if (numberp (posn-point (event-end event)))
(posn-point (event-end event))
last-end-point))
;; The end that comes from where we ended the drag.
;; Point goes here.
(region-termination
(if (and stop-point (< stop-point start-point))
(overlay-start mouse-drag-overlay)
(overlay-end mouse-drag-overlay)))
;; The end that comes from where we started the drag.
;; Mark goes there.
(region-commencement
(- (+ (overlay-end mouse-drag-overlay)
(overlay-start mouse-drag-overlay))
region-termination))
last-command this-command)
;; We copy the region before setting the mark so
;; that `select-active-regions' can override
;; `copy-region-as-kill'.
(and mouse-drag-copy-region
do-mouse-drag-region-post-process
(let (deactivate-mark)
(copy-region-as-kill region-commencement
region-termination)))
(push-mark region-commencement t t)
(goto-char region-termination)
(if (not do-mouse-drag-region-post-process)
;; Skip all post-event handling, return immediately.
(delete-overlay mouse-drag-overlay)
(let ((buffer (current-buffer)))
(mouse-show-mark)
;; mouse-show-mark can call read-event,
;; and that means the Emacs server could switch buffers
;; under us. If that happened,
;; avoid trying to use the region.
(and (mark t) mark-active
(eq buffer (current-buffer))
(mouse-set-region-1)))))
;; Run the binding of the terminating up-event.
;; If a multiple click is not bound to mouse-set-point,
;; cancel the effects of mouse-move-drag-overlay to
;; avoid producing wrong results.
(if do-multi-click (goto-char start-point))
(delete-overlay mouse-drag-overlay)
(when (and (functionp fun)
(= start-hscroll (window-hscroll start-window))
;; Don't run the up-event handler if the
;; window start changed in a redisplay after
;; the mouse-set-point for the down-mouse
;; event at the beginning of this function.
;; When the window start has changed, the
;; up-mouse event will contain a different
;; position due to the new window contents,
;; and point is set again.
(or end-point
(= (window-start start-window)
start-window-start)))
(when (and on-link
(or (not end-point) (= end-point start-point))
(consp event)
(or remap-double-click
(and
(not (eq mouse-1-click-follows-link 'double))
(= click-count 0)
(= (event-click-count event) 1)
(or (not (integerp mouse-1-click-follows-link))
(let ((t0 (posn-timestamp (event-start start-event)))
(t1 (posn-timestamp (event-end event))))
(and (integerp t0) (integerp t1)
(if (> mouse-1-click-follows-link 0)
(<= (- t1 t0) mouse-1-click-follows-link)
(< (- t0 t1) mouse-1-click-follows-link))))))))
;; If we rebind to mouse-2, reselect previous selected window,
;; so that the mouse-2 event runs in the same
;; situation as if user had clicked it directly.
;; Fixes the bug reported by juri@jurta.org on 2005-12-27.
(if (or (vectorp on-link) (stringp on-link))
(setq event (aref on-link 0))
(select-window original-window)
(setcar event 'mouse-2)
;; If this mouse click has never been done by
;; the user, it doesn't have the necessary
;; property to be interpreted correctly.
(put 'mouse-2 'event-kind 'mouse-click)))
(push event unread-command-events))))
(defun mouse--remap-link-click-p (start-event end-event)
(or (and (eq mouse-1-click-follows-link 'double)
(= (event-click-count start-event) 2))
(and
(not (eq mouse-1-click-follows-link 'double))
(= (event-click-count start-event) 1)
(= (event-click-count end-event) 1)
(or (not (integerp mouse-1-click-follows-link))
(let ((t0 (posn-timestamp (event-start start-event)))
(t1 (posn-timestamp (event-end end-event))))
(and (integerp t0) (integerp t1)
(if (> mouse-1-click-follows-link 0)
(<= (- t1 t0) mouse-1-click-follows-link)
(< (- t0 t1) mouse-1-click-follows-link))))))))
;; Case where the end-event is not a cons cell (it's just a boring
;; char-key-press).
(delete-overlay mouse-drag-overlay)))))
;; Commands to handle xterm-style multiple clicks.
(defun mouse-skip-word (dir)
@ -1263,55 +1208,6 @@ If MODE is 2 then do the same for lines."
;; Momentarily show where the mark is, if highlighting doesn't show it.
(defun mouse-show-mark ()
(let ((inhibit-quit t)
(echo-keystrokes 0)
event events key ignore
(x-lost-selection-functions
(when (boundp 'x-lost-selection-functions)
(copy-sequence x-lost-selection-functions))))
(add-hook 'x-lost-selection-functions
(lambda (seltype)
(when (eq seltype 'PRIMARY)
(setq ignore t)
(throw 'mouse-show-mark t))))
(if transient-mark-mode
(delete-overlay mouse-drag-overlay)
(move-overlay mouse-drag-overlay (point) (mark t)))
(catch 'mouse-show-mark
;; In this loop, execute scroll bar and switch-frame events.
;; Should we similarly handle `select-window' events? --Stef
;; Also ignore down-events that are undefined.
(while (progn (setq event (read-event))
(setq events (append events (list event)))
(setq key (apply 'vector events))
(or (and (consp event)
(eq (car event) 'switch-frame))
(and (consp event)
(eq (posn-point (event-end event))
'vertical-scroll-bar))
(and (memq 'down (event-modifiers event))
(not (key-binding key))
(not (mouse-undouble-last-event events)))))
(and (consp event)
(or (eq (car event) 'switch-frame)
(eq (posn-point (event-end event))
'vertical-scroll-bar))
(let ((keys (vector 'vertical-scroll-bar event)))
(and (key-binding keys)
(progn
(call-interactively (key-binding keys)
nil keys)
(setq events nil)))))))
;; If we lost the selection, just turn off the highlighting.
(unless ignore
;; Unread the key so it gets executed normally.
(setq unread-command-events
(nconc events unread-command-events)))
(setq quit-flag nil)
(unless transient-mark-mode
(delete-overlay mouse-drag-overlay))))
(defun mouse-set-mark (click)
"Set mark at the position clicked on with the mouse.
Display cursor at that position for a second.
@ -1385,8 +1281,7 @@ This does not delete the region; it acts like \\[kill-ring-save]."
(interactive "e")
(mouse-set-mark-fast click)
(let (this-command last-command)
(kill-ring-save (point) (mark t)))
(mouse-show-mark))
(kill-ring-save (point) (mark t))))
;; This function used to delete the text between point and the mouse
;; whenever it was equal to the front of the kill ring, but some
@ -1476,8 +1371,7 @@ If you do this twice in the same position, the selection is killed."
(mouse-set-region-1)
;; Arrange for a repeated mouse-3 to kill this region.
(setq mouse-save-then-kill-posn
(list (car kill-ring) (point) click-posn))
(mouse-show-mark))
(list (car kill-ring) (point) click-posn)))
;; If we click this button again without moving it,
;; that time kill.
(mouse-save-then-kill-delete-region (mark) (point))
@ -1521,7 +1415,6 @@ If you do this twice in the same position, the selection is killed."
(goto-char before-scroll))
(exchange-point-and-mark) ;Why??? --Stef
(kill-new (buffer-substring (point) (mark t))))
(mouse-show-mark)
(mouse-set-region-1)
(setq mouse-save-then-kill-posn
(list (car kill-ring) (point) click-posn)))))))

View file

@ -39,6 +39,7 @@
(declare-function dbus-method-error-internal "dbusbind.c")
(declare-function dbus-register-signal "dbusbind.c")
(declare-function dbus-register-method "dbusbind.c")
(declare-function dbus-send-signal "dbusbind.c")
(defvar dbus-debug)
(defvar dbus-registered-objects-table)
@ -869,7 +870,7 @@ name of the property, and its value. If there are no properties,
(add-to-list 'result (cons (car dict) (caadr dict)) 'append)))))
(defun dbus-register-property
(bus service path interface property access value)
(bus service path interface property access value &optional emits-signal)
"Register property PROPERTY on the D-Bus BUS.
BUS is either the symbol `:system' or the symbol `:session'.
@ -892,7 +893,9 @@ can be changed by `dbus-set-property'.
The interface \"org.freedesktop.DBus.Properties\" is added to
PATH, including a default handler for the \"Get\", \"GetAll\" and
\"Set\" methods of this interface."
\"Set\" methods of this interface. When EMITS-SIGNAL is non-nil,
the signal \"PropertiesChanged\" is sent when the property is
changed by `dbus-set-property'."
(unless (member access '(:read :readwrite))
(signal 'dbus-error (list "Access type invalid" access)))
@ -911,10 +914,23 @@ PATH, including a default handler for the \"Get\", \"GetAll\" and
(dbus-register-method
bus service path dbus-interface-properties "Set" 'dbus-property-handler)
;; Send the PropertiesChanged signal.
(when emits-signal
(dbus-send-signal
bus service path dbus-interface-properties "PropertiesChanged"
(list (list :dict-entry property (list :variant value)))
'(:array)))
;; Create a hash table entry. We use nil for the unique name,
;; because the property might be accessed from anybody.
(let ((key (list bus interface property))
(val (list (list nil service path (cons access value)))))
(val
(list
(list
nil service path
(cons
(if emits-signal (list access :emits-signal) (list access))
value)))))
(puthash key val dbus-registered-objects-table)
;; Return the object.
@ -924,6 +940,7 @@ PATH, including a default handler for the \"Get\", \"GetAll\" and
"Default handler for the \"org.freedesktop.DBus.Properties\" interface.
It will be registered for all objects created by `dbus-register-object'."
(let ((bus (dbus-event-bus-name last-input-event))
(service (dbus-event-service-name last-input-event))
(path (dbus-event-path-name last-input-event))
(method (dbus-event-member-name last-input-event))
(interface (car args))
@ -931,25 +948,40 @@ It will be registered for all objects created by `dbus-register-object'."
(cond
;; "Get" returns a variant.
((string-equal method "Get")
(let ((val (gethash (list bus interface property)
dbus-registered-objects-table)))
(when (string-equal path (nth 2 (car val)))
(list (list :variant (cdar (last (car val))))))))
(let ((entry (gethash (list bus interface property)
dbus-registered-objects-table)))
(when (string-equal path (nth 2 (car entry)))
(list (list :variant (cdar (last (car entry))))))))
;; "Set" expects a variant.
((string-equal method "Set")
(let ((val (gethash (list bus interface property)
dbus-registered-objects-table)))
(unless (consp (car (last (car val))))
(let* ((value (caar (cddr args)))
(entry (gethash (list bus interface property)
dbus-registered-objects-table))
;; The value of the hash table is a list; in case of
;; properties it contains just one element (UNAME SERVICE
;; PATH OBJECT). OBJECT is a cons cell of a list, which
;; contains a list of annotations (like :read,
;; :read-write, :emits-signal), and the value of the
;; property.
(object (car (last (car entry)))))
(unless (consp object)
(signal 'dbus-error
(list "Property not registered at path" property path)))
(unless (equal (caar (last (car val))) :readwrite)
(unless (member :readwrite (car object))
(signal 'dbus-error
(list "Property not writable at path" property path)))
(puthash (list bus interface property)
(list (append (butlast (car val))
(list (cons :readwrite (caar (cddr args))))))
(list (append (butlast (car entry))
(list (cons (car object) value))))
dbus-registered-objects-table)
;; Send the "PropertiesChanged" signal.
(when (member :emits-signal (car object))
(dbus-send-signal
bus service path dbus-interface-properties "PropertiesChanged"
(list (list :dict-entry property (list :variant value)))
'(:array)))
;; Return empty reply.
:ignore))
;; "GetAll" returns "a{sv}".

View file

@ -1,7 +1,7 @@
;;; zone.el --- idle display hacks
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
;; 2009, 2010 Free Software Foundation, Inc.
;; Author: Victor Zandy <zandy@cs.wisc.edu>
;; Maintainer: Thien-Thi Nguyen <ttn@gnu.org>
@ -40,10 +40,6 @@
;;; Code:
(require 'timer)
(require 'tabify)
(eval-when-compile (require 'cl))
(defvar zone-timer nil
"The timer we use to decide when to zone out, or nil if none.")
@ -210,19 +206,20 @@ If the element is a function or a list of a function and a number,
(insert s)))
(defun zone-shift-left ()
(let (s)
(let ((inhibit-point-motion-hooks t)
s)
(while (not (eobp))
(unless (eolp)
(setq s (buffer-substring (point) (1+ (point))))
(delete-char 1)
(end-of-line)
(insert s))
(forward-char 1))))
(ignore-errors (forward-char 1)))))
(defun zone-shift-right ()
(goto-char (point-max))
(end-of-line)
(let (s)
(let ((inhibit-point-motion-hooks t)
s)
(while (not (bobp))
(unless (bolp)
(setq s (buffer-substring (1- (point)) (point)))
@ -348,15 +345,8 @@ If the element is a function or a list of a function and a number,
(let ((np (+ 2 (random 5)))
(pm (point-max)))
(while (< np pm)
(goto-char np)
(let ((prec (preceding-char))
(props (text-properties-at (1- (point)))))
(insert (if (zerop (random 2))
(upcase prec)
(downcase prec)))
(set-text-properties (1- (point)) (point) props))
(backward-char 2)
(delete-char 1)
(funcall (if (zerop (random 2)) 'upcase-region
'downcase-region) (1- np) np)
(setq np (+ np (1+ (random 5))))))
(goto-char (point-min))
(sit-for 0 2)))
@ -365,13 +355,14 @@ If the element is a function or a list of a function and a number,
;;;; rotating
(defun zone-line-specs ()
(let (ret)
(let ((ok t)
ret)
(save-excursion
(goto-char (window-start))
(while (< (point) (window-end))
(while (and ok (< (point) (window-end)))
(when (looking-at "[\t ]*\\([^\n]+\\)")
(setq ret (cons (cons (match-beginning 1) (match-end 1)) ret)))
(forward-line 1)))
(setq ok (zerop (forward-line 1)))))
ret))
(defun zone-pgm-rotate (&optional random-style)
@ -404,6 +395,7 @@ If the element is a function or a list of a function and a number,
(setq cut 1 paste 2)
(setq cut 2 paste 1))
(goto-char (aref ent cut))
(setq aamt (min aamt (- (point-max) (point))))
(setq txt (buffer-substring (point) (+ (point) aamt)))
(delete-char aamt)
(goto-char (aref ent paste))
@ -447,19 +439,19 @@ If the element is a function or a list of a function and a number,
(hmm (cond
((string-match "[a-z]" c-string) (upcase c-string))
((string-match "[A-Z]" c-string) (downcase c-string))
(t (propertize " " 'display `(space :width ,cw-ceil))))))
(do ((i 0 (1+ i))
(wait 0.5 (* wait 0.8)))
((= i 20))
(t (propertize " " 'display `(space :width ,cw-ceil)))))
(wait 0.5))
(dotimes (i 20)
(goto-char pos)
(delete-char 1)
(insert (if (= 0 (% i 2)) hmm c-string))
(zone-park/sit-for wbeg wait))
(zone-park/sit-for wbeg (setq wait (* wait 0.8))))
(delete-char -1) (insert c-string)))
(defun zone-fill-out-screen (width height)
(let ((start (window-start))
(line (make-string width 32)))
(line (make-string width 32))
(inhibit-point-motion-hooks t))
(goto-char start)
;; fill out rectangular ws block
(while (progn (end-of-line)
@ -473,8 +465,7 @@ If the element is a function or a list of a function and a number,
(let ((nl (- height (count-lines (point-min) (point)))))
(when (> nl 0)
(setq line (concat line "\n"))
(do ((i 0 (1+ i)))
((= i nl))
(dotimes (i nl)
(insert line))))
(goto-char start)
(recenter 0)
@ -587,11 +578,12 @@ If the element is a function or a list of a function and a number,
(defun zone-pgm-stress ()
(goto-char (point-min))
(let (lines)
(while (< (point) (point-max))
(let ((ok t)
lines)
(while (and ok (< (point) (point-max)))
(let ((p (point)))
(forward-line 1)
(setq lines (cons (buffer-substring p (point)) lines))))
(setq ok (zerop (forward-line 1))
lines (cons (buffer-substring p (point)) lines))))
(sit-for 5)
(zone-hiding-modeline
(let ((msg "Zoning... (zone-pgm-stress)"))
@ -671,7 +663,8 @@ If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).")
(setq c (point))
(move-to-column 9)
(setq col (cons (buffer-substring (point) c) col))
(end-of-line 0)
; (let ((inhibit-point-motion-hooks t))
(end-of-line 0);)
(forward-char -10))
(let ((life-patterns (vector
(if (and col (search-forward "@" max t))

View file

@ -357,21 +357,21 @@ Must be greater than 1."
:group 'ispell)
(defcustom ispell-alternate-dictionary
(cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2")
((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2")
((file-exists-p "/usr/dict/words") "/usr/dict/words")
((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words")
((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words")
((file-exists-p "/usr/share/lib/dict/words")
(cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2")
((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2")
((file-readable-p "/usr/dict/words") "/usr/dict/words")
((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words")
((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words")
((file-readable-p "/usr/share/lib/dict/words")
"/usr/share/lib/dict/words")
((file-exists-p "/sys/dict") "/sys/dict")
(t "/usr/dict/words"))
"*Alternate dictionary for spelling help."
((file-readable-p "/sys/dict") "/sys/dict"))
"*Alternate plain word-list dictionary for spelling help."
:type '(choice file (const :tag "None" nil))
:group 'ispell)
(defcustom ispell-complete-word-dict ispell-alternate-dictionary
"*Dictionary used for word completion."
(defcustom ispell-complete-word-dict nil
"*Plain word-list dictionary used for word completion if
different from `ispell-alternate-dictionary'."
:type '(choice file (const :tag "None" nil))
:group 'ispell)
@ -2049,10 +2049,11 @@ Global `ispell-quit' set to start location to continue spell session."
(erase-buffer)
(setq count ?0
skipped 0
mode-line-format
mode-line-format ;; setup the *Choices* buffer with valid data.
(concat "-- %b -- word: " new-word
" -- dict: "
ispell-alternate-dictionary)
" -- word-list: "
(or ispell-complete-word-dict
ispell-alternate-dictionary))
miss (lookup-words new-word)
choices miss
line ispell-choices-win-default-height)
@ -2267,11 +2268,20 @@ Otherwise the variable `ispell-grep-command' contains the command used to
search for the words (usually egrep).
Optional second argument contains the dictionary to use; the default is
`ispell-alternate-dictionary'."
`ispell-alternate-dictionary', overriden by `ispell-complete-word-dict'
if defined."
;; We don't use the filter for this function, rather the result is written
;; into a buffer. Hence there is no need to save the filter values.
(if (null lookup-dict)
(setq lookup-dict ispell-alternate-dictionary))
(setq lookup-dict (or ispell-complete-word-dict
ispell-alternate-dictionary)))
(if lookup-dict
(unless (file-readable-p lookup-dict)
(error "lookup-words error: Unreadable or missing plain word-list %s."
lookup-dict))
(error (concat "lookup-words error: No plain word-list found at system default "
"locations. Customize `ispell-alternate-dictionary' to set yours.")))
(let* ((process-connection-type ispell-use-ptys-p)
(wild-p (string-match "\\*" word))
@ -3342,7 +3352,8 @@ Standard ispell choices are then available."
(lookup-words (concat (and interior-frag "*") word
(if (or interior-frag (null ispell-look-p))
"*"))
ispell-complete-word-dict)))
(or ispell-complete-word-dict
ispell-alternate-dictionary))))
(cond ((eq possibilities t)
(message "No word to complete"))
((null possibilities)

View file

@ -52,13 +52,19 @@ conveniently adding tool bar items."
:global t
:group 'mouse
:group 'frames
;; Make tool-bar even if terminal is non-graphical (Bug#1754).
(let ((val (if tool-bar-mode 1 0)))
(dolist (frame (frame-list))
(set-frame-parameter frame 'tool-bar-lines val)))
(when tool-bar-mode
(if (= 1 (length (default-value 'tool-bar-map))) ; not yet setup
(tool-bar-setup))))
(set-frame-parameter frame 'tool-bar-lines val))
;; If the user has given `default-frame-alist' a `tool-bar-lines'
;; parameter, replace it.
(if (assq 'tool-bar-lines default-frame-alist)
(setq default-frame-alist
(cons (cons 'tool-bar-lines val)
(assq-delete-all 'tool-bar-lines
default-frame-alist)))))
(and tool-bar-mode
(= 1 (length (default-value 'tool-bar-map))) ; not yet setup
(tool-bar-setup)))
;;;###autoload
;; Used in the Show/Hide menu, to have the toggle reflect the current frame.

View file

@ -1,3 +1,9 @@
2010-07-01 Mark A. Hershberger <mah@everybody.org>
* url-http.el (url-http-create-request): Add a CRLF on the end so
that POSTs with content to https urls work. See
<https://bugs.launchpad.net/mediawiki-el/+bug/540759>
2010-06-22 Mark A. Hershberger <mah@everybody.org>
* url-parse.el (url-user-for-url, url-password-for-url):

View file

@ -339,7 +339,7 @@ request.")
;; End request
"\r\n"
;; Any data
url-http-data))
url-http-data "\r\n"))
""))
(url-http-debug "Request is: \n%s" request)
request))

View file

@ -1,3 +1,66 @@
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* lwlib.c (allocate_widget_instance, get_widget_info)
(get_widget_instance, find_instance, set_one_value)
(update_one_widget_instance, update_all_widget_values)
(lw_modify_all_widgets, lw_get_widget, lw_make_widget)
(lw_create_widget, lw_pop_all_widgets, lw_show_busy)
(lw_refigure_widget, lw_allow_resizing): Remove alternative K&R
declarations.
* lwlib-Xlw.c (xlw_update_one_widget):
(xlw_pop_instance): Likewise.
* lwlib-Xaw.c (xaw_update_one_widget, xaw_pop_instance):
Likewise.
* lwlib-Xm.c (P_): Remove.
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* lwlib.c (lwlib_memset, lwlib_bcopy): Remove.
(malloc_widget_value, free_widget_info, allocate_widget_instance)
(lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by
memset, memcpy, memcmp.
* lwlib-utils.c (XtApplyToWidgets): Likewise.
* xlwmenu.c (XlwMenuInitialize): Likewise.
* lwlib.h (lwlib_bcopy): Remove declaration.
2010-07-05 Jan Djärv <jan.h.d@swipnet.se>
* xlwmenu.c (XlwMenuSetValues, XlwMenuInitialize): Correct prototype.
(display_menu_item): Remove unused variable gi.
(make_windows_if_needed): Remove unused variable screen.
(XlwMenuRedisplay): Remove unused variable i.
* lwlib-Xaw.c: Include <ctype.h> for isdigit.
(fill_xft_data, set_text): Remove unused variable screen.
(draw_text): Cast bp to FcChar8*.
(find_xft_data): Return 0 if inst or xft_data is not set.
(wm_delete_window): Correct prototype. Initialize widget to 0
and return if widget is still 0 after loop.
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* lwlib-Xaw.c: Convert function definitions to standard C.
* lwlib-Xlw.c:
* lwlib-utils.c:
* lwlib.c:
* lwlib.h:
* xlwmenu.c: Likewise.
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
* lwlib-Xm.c: Remove __P and P_ from .c and .m files.
* lwlib-Xm.c:
* lwlib.c:
* xlwmenu.c: Likewise.
Remove P_ and __P macros.
* lwlib-Xaw.h: Remove P_ and __P macros.
* lwlib-Xlw.h:
* lwlib-Xm.h:
* lwlib-int.h:
* lwlib-utils.h:
* lwlib.h: Likewise.
2010-05-15 Glenn Morris <rgm@gnu.org>
* Makefile.in (mostlyclean): Remove references to non-existent files.

View file

@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <setjmp.h>
#include <ctype.h>
#include "../src/lisp.h"
@ -70,12 +71,11 @@ struct widget_xft_data
#endif
static void xaw_generic_callback (/*Widget, XtPointer, XtPointer*/);
static void xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data);
Boolean
lw_xaw_widget_p (widget)
Widget widget;
lw_xaw_widget_p (Widget widget)
{
return (XtIsSubclass (widget, scrollbarWidgetClass) ||
XtIsSubclass (widget, dialogWidgetClass));
@ -152,7 +152,6 @@ fill_xft_data (struct widget_xft_data *data, Widget widget, XftFont *font)
{
Pixel bg, fg;
XColor colors[2];
int screen = XScreenNumberOfScreen (XtScreen (widget));
data->widget = widget;
data->xft_font = font;
@ -253,7 +252,9 @@ draw_text (struct widget_xft_data *data, char *lbl, int inverse)
char *cp = strchr (bp, '\n');
XftDrawStringUtf8 (data->xft_draw,
inverse ? &data->xft_bg : &data->xft_fg,
data->xft_font, x, y, bp, cp ? cp - bp : strlen (bp));
data->xft_font, x, y,
(FcChar8 *) bp,
cp ? cp - bp : strlen (bp));
bp = cp ? cp + 1 : NULL;
/* 1.2 gives reasonable line spacing. */
y += data->xft_font->height * 1.2;
@ -265,7 +266,6 @@ draw_text (struct widget_xft_data *data, char *lbl, int inverse)
static void
set_text (struct widget_xft_data *data, Widget toplevel, char *lbl, int margin)
{
int screen = XScreenNumberOfScreen (XtScreen (data->widget));
int width, height;
width = get_text_width_and_height (data->widget, lbl, data->xft_font,
@ -294,7 +294,7 @@ find_xft_data (Widget widget)
inst = lw_get_widget_instance (parent);
parent = XtParent (parent);
}
if (!inst || !inst->xft_data || !inst->xft_data[0].xft_font) return;
if (!inst || !inst->xft_data || !inst->xft_data[0].xft_font) return 0;
for (nr = 0; data == NULL && nr < inst->nr_xft_data; ++nr)
{
@ -348,16 +348,8 @@ command_reset (Widget widget,
#endif
void
#ifdef PROTOTYPES
xaw_update_one_widget (widget_instance *instance, Widget widget,
widget_value *val, Boolean deep_p)
#else
xaw_update_one_widget (instance, widget, val, deep_p)
widget_instance *instance;
Widget widget;
widget_value *val;
Boolean deep_p;
#endif
{
#if 0
if (XtIsSubclass (widget, scrollbarWidgetClass))
@ -427,10 +419,7 @@ xaw_update_one_widget (instance, widget, val, deep_p)
}
void
xaw_update_one_value (instance, widget, val)
widget_instance *instance;
Widget widget;
widget_value *val;
xaw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
{
/* This function is not used by the scrollbars and those are the only
Athena widget implemented at the moment so do nothing. */
@ -438,8 +427,7 @@ xaw_update_one_value (instance, widget, val)
}
void
xaw_destroy_instance (instance)
widget_instance *instance;
xaw_destroy_instance (widget_instance *instance)
{
#ifdef HAVE_XFT
if (instance->xft_data)
@ -471,22 +459,14 @@ xaw_destroy_instance (instance)
}
void
xaw_popup_menu (widget, event)
Widget widget;
XEvent *event;
xaw_popup_menu (Widget widget, XEvent *event)
{
/* An Athena menubar has not been implemented. */
return;
}
void
#ifdef PROTOTYPES
xaw_pop_instance (widget_instance *instance, Boolean up)
#else
xaw_pop_instance (instance, up)
widget_instance *instance;
Boolean up;
#endif
{
Widget widget = instance->widget;
@ -557,7 +537,10 @@ static char overrideTrans[] =
/* Dialogs pop down on any key press */
static char dialogOverride[] =
"<KeyPress>Escape: lwlib_delete_dialog()";
static void wm_delete_window();
static void wm_delete_window (Widget w,
XEvent *event,
String *params,
Cardinal *num_params);
static XtActionsRec xaw_actions [] = {
{"lwlib_delete_dialog", wm_delete_window}
};
@ -748,8 +731,7 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot,
}
Widget
xaw_create_dialog (instance)
widget_instance* instance;
xaw_create_dialog (widget_instance *instance)
{
char *name = instance->info->type;
Widget parent = instance->parent;
@ -813,10 +795,7 @@ xaw_create_dialog (instance)
static void
xaw_generic_callback (widget, closure, call_data)
Widget widget;
XtPointer closure;
XtPointer call_data;
xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
{
widget_instance *instance = (widget_instance *) closure;
Widget instance_widget;
@ -862,16 +841,16 @@ xaw_generic_callback (widget, closure, call_data)
}
static void
wm_delete_window (w, closure, call_data)
Widget w;
XtPointer closure;
XtPointer call_data;
wm_delete_window (Widget w,
XEvent *event,
String *params,
Cardinal *num_params)
{
LWLIB_ID id;
Cardinal nkids;
int i;
Widget *kids = 0;
Widget widget, shell;
Widget widget = 0, shell;
if (XtIsSubclass (w, dialogWidgetClass))
shell = XtParent (w);
@ -890,6 +869,8 @@ wm_delete_window (w, closure, call_data)
if (XtIsSubclass (widget, dialogWidgetClass))
break;
}
if (! widget) return;
id = lw_get_widget_id (widget);
if (! id) abort ();
@ -966,8 +947,7 @@ xaw_scrollbar_jump (widget, closure, call_data)
#endif
static Widget
xaw_create_scrollbar (instance)
widget_instance *instance;
xaw_create_scrollbar (widget_instance *instance)
{
#if 0
Arg av[20];
@ -1007,8 +987,7 @@ xaw_create_scrollbar (instance)
}
static Widget
xaw_create_main (instance)
widget_instance *instance;
xaw_create_main (widget_instance *instance)
{
Arg al[1];
int ac;

View file

@ -6,25 +6,25 @@
extern widget_creation_entry xaw_creation_table [];
Widget
xaw_create_dialog __P ((widget_instance*));
xaw_create_dialog (widget_instance*);
Boolean
lw_xaw_widget_p __P ((Widget));
lw_xaw_widget_p (Widget);
void
xaw_update_one_widget __P ((widget_instance *, Widget, widget_value *, Boolean));
xaw_update_one_widget (widget_instance *, Widget, widget_value *, Boolean);
void
xaw_update_one_value __P ((widget_instance *, Widget, widget_value *));
xaw_update_one_value (widget_instance *, Widget, widget_value *);
void
xaw_destroy_instance __P ((widget_instance *));
xaw_destroy_instance (widget_instance *);
void
xaw_popup_menu __P ((Widget, XEvent *));
xaw_popup_menu (Widget, XEvent *);
void
xaw_pop_instance __P ((widget_instance *, Boolean));
xaw_pop_instance (widget_instance *, Boolean);
#endif /* LWLIB_XAW_H */

View file

@ -72,10 +72,7 @@ x_print_complete_resource_name (widget)
if there isn't any highlighted menu item. */
static void
highlight_hook (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
highlight_hook (Widget w, XtPointer client_data, XtPointer call_data)
{
widget_instance *instance = (widget_instance *) client_data;
@ -85,29 +82,20 @@ highlight_hook (w, client_data, call_data)
}
static void
enter_hook (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
enter_hook (Widget w, XtPointer client_data, XtPointer call_data)
{
highlight_hook (w, client_data, call_data);
}
static void
leave_hook (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
leave_hook (Widget w, XtPointer client_data, XtPointer call_data)
{
highlight_hook (w, client_data, NULL);
}
static void
pre_hook (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
pre_hook (Widget w, XtPointer client_data, XtPointer call_data)
{
widget_instance* instance = (widget_instance*)client_data;
widget_value* val;
@ -122,10 +110,7 @@ pre_hook (w, client_data, call_data)
}
static void
pick_hook (w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
pick_hook (Widget w, XtPointer client_data, XtPointer call_data)
{
widget_instance* instance = (widget_instance*)client_data;
widget_value* contents_val = (widget_value*)call_data;
@ -150,8 +135,7 @@ pick_hook (w, client_data, call_data)
/* creation functions */
static Widget
xlw_create_menubar (instance)
widget_instance* instance;
xlw_create_menubar (widget_instance *instance)
{
Widget widget;
Arg al[5];
@ -178,8 +162,7 @@ xlw_create_menubar (instance)
}
static Widget
xlw_create_popup_menu (instance)
widget_instance* instance;
xlw_create_popup_menu (widget_instance *instance)
{
Widget popup_shell
= XtCreatePopupShell (instance->info->name, overrideShellWidgetClass,
@ -214,8 +197,7 @@ xlw_creation_table [] =
};
Boolean
lw_lucid_widget_p (widget)
Widget widget;
lw_lucid_widget_p (Widget widget)
{
WidgetClass the_class = XtClass (widget);
@ -228,16 +210,8 @@ lw_lucid_widget_p (widget)
}
void
#ifdef PROTOTYPES
xlw_update_one_widget (widget_instance* instance, Widget widget,
widget_value* val, Boolean deep_p)
#else
xlw_update_one_widget (instance, widget, val, deep_p)
widget_instance* instance;
Widget widget;
widget_value* val;
Boolean deep_p;
#endif
{
Arg al[1];
@ -249,29 +223,18 @@ xlw_update_one_widget (instance, widget, val, deep_p)
}
void
xlw_update_one_value (instance, widget, val)
widget_instance* instance;
Widget widget;
widget_value* val;
xlw_update_one_value (widget_instance *instance, Widget widget, widget_value *val)
{
return;
}
void
#ifdef PROTOTYPES
xlw_pop_instance (widget_instance* instance, Boolean up)
#else
xlw_pop_instance (instance, up)
widget_instance* instance;
Boolean up;
#endif
{
}
void
xlw_popup_menu (widget, event)
Widget widget;
XEvent *event;
xlw_popup_menu (Widget widget, XEvent *event)
{
XlwMenuWidget mw;
@ -304,8 +267,7 @@ xlw_popup_menu (widget, event)
/* Destruction of instances */
void
xlw_destroy_instance (instance)
widget_instance* instance;
xlw_destroy_instance (widget_instance *instance)
{
if (instance->widget)
XtDestroyWidget (instance->widget);

View file

@ -7,24 +7,24 @@ extern widget_creation_entry xlw_creation_table [];
extern widget_creation_function xlw_create_dialog;
Boolean
lw_lucid_widget_p __P ((Widget widget));
lw_lucid_widget_p (Widget widget);
void
xlw_update_one_widget __P ((widget_instance* instance, Widget widget,
widget_value* val, Boolean deep_p));
xlw_update_one_widget (widget_instance* instance, Widget widget,
widget_value* val, Boolean deep_p);
void
xlw_update_one_value __P ((widget_instance* instance, Widget widget,
widget_value* val));
xlw_update_one_value (widget_instance* instance, Widget widget,
widget_value* val);
void
xlw_destroy_instance __P ((widget_instance* instance));
xlw_destroy_instance (widget_instance* instance);
void
xlw_pop_instance __P ((widget_instance* instance, Boolean up));
xlw_pop_instance (widget_instance* instance, Boolean up);
void
xlw_popup_menu __P ((Widget widget, XEvent * event));
xlw_popup_menu (Widget widget, XEvent * event);
#endif /* LWLIB_XLW_H */

View file

@ -65,13 +65,6 @@ Boston, MA 02110-1301, USA. */
#include <Xm/DialogS.h>
#include <Xm/Form.h>
#undef P_
#if defined __STDC__ || defined PROTOTYPES
#define P_(X) X
#else
#define P_(X) ()
#endif
enum do_call_type { pre_activate, selection, no_selection, post_activate };
@ -86,63 +79,63 @@ typedef struct _destroyed_instance
struct _destroyed_instance* next;
} destroyed_instance;
static destroyed_instance *make_destroyed_instance P_ ((char *, char *,
Widget, Widget,
Boolean));
static void free_destroyed_instance P_ ((destroyed_instance*));
Widget first_child P_ ((Widget));
Boolean lw_motif_widget_p P_ ((Widget));
static XmString resource_motif_string P_ ((Widget, char *));
static void destroy_all_children P_ ((Widget, int));
static void xm_update_label P_ ((widget_instance *, Widget, widget_value *));
static void xm_update_list P_ ((widget_instance *, Widget, widget_value *));
static void xm_update_pushbutton P_ ((widget_instance *, Widget,
widget_value *));
static void xm_update_cascadebutton P_ ((widget_instance *, Widget,
widget_value *));
static void xm_update_toggle P_ ((widget_instance *, Widget, widget_value *));
static void xm_update_radiobox P_ ((widget_instance *, Widget, widget_value *));
static void make_menu_in_widget P_ ((widget_instance *, Widget,
widget_value *, int));
static void update_one_menu_entry P_ ((widget_instance *, Widget,
widget_value *, Boolean));
static void xm_update_menu P_ ((widget_instance *, Widget, widget_value *,
Boolean));
static void xm_update_text P_ ((widget_instance *, Widget, widget_value *));
static void xm_update_text_field P_ ((widget_instance *, Widget,
widget_value *));
void xm_update_one_value P_ ((widget_instance *, Widget, widget_value *));
static void activate_button P_ ((Widget, XtPointer, XtPointer));
static Widget make_dialog P_ ((char *, Widget, Boolean, char *, char *,
Boolean, Boolean, Boolean, int, int));
static destroyed_instance* find_matching_instance P_ ((widget_instance*));
static void mark_dead_instance_destroyed P_ ((Widget, XtPointer, XtPointer));
static void recenter_widget P_ ((Widget));
static Widget recycle_instance P_ ((destroyed_instance*));
Widget xm_create_dialog P_ ((widget_instance*));
static Widget make_menubar P_ ((widget_instance*));
static void remove_grabs P_ ((Widget, XtPointer, XtPointer));
static Widget make_popup_menu P_ ((widget_instance*));
static Widget make_main P_ ((widget_instance*));
void xm_destroy_instance P_ ((widget_instance*));
void xm_popup_menu P_ ((Widget, XEvent *));
static void set_min_dialog_size P_ ((Widget));
static void do_call P_ ((Widget, XtPointer, enum do_call_type));
static void xm_generic_callback P_ ((Widget, XtPointer, XtPointer));
static void xm_nosel_callback P_ ((Widget, XtPointer, XtPointer));
static void xm_pull_down_callback P_ ((Widget, XtPointer, XtPointer));
static void xm_pop_down_callback P_ ((Widget, XtPointer, XtPointer));
void xm_set_keyboard_focus P_ ((Widget, Widget));
void xm_set_main_areas P_ ((Widget, Widget, Widget));
static void xm_internal_update_other_instances P_ ((Widget, XtPointer,
XtPointer));
static void xm_arm_callback P_ ((Widget, XtPointer, XtPointer));
static destroyed_instance *make_destroyed_instance (char *, char *,
Widget, Widget,
Boolean);
static void free_destroyed_instance (destroyed_instance*);
Widget first_child (Widget);
Boolean lw_motif_widget_p (Widget);
static XmString resource_motif_string (Widget, char *);
static void destroy_all_children (Widget, int);
static void xm_update_label (widget_instance *, Widget, widget_value *);
static void xm_update_list (widget_instance *, Widget, widget_value *);
static void xm_update_pushbutton (widget_instance *, Widget,
widget_value *);
static void xm_update_cascadebutton (widget_instance *, Widget,
widget_value *);
static void xm_update_toggle (widget_instance *, Widget, widget_value *);
static void xm_update_radiobox (widget_instance *, Widget, widget_value *);
static void make_menu_in_widget (widget_instance *, Widget,
widget_value *, int);
static void update_one_menu_entry (widget_instance *, Widget,
widget_value *, Boolean);
static void xm_update_menu (widget_instance *, Widget, widget_value *,
Boolean);
static void xm_update_text (widget_instance *, Widget, widget_value *);
static void xm_update_text_field (widget_instance *, Widget,
widget_value *);
void xm_update_one_value (widget_instance *, Widget, widget_value *);
static void activate_button (Widget, XtPointer, XtPointer);
static Widget make_dialog (char *, Widget, Boolean, char *, char *,
Boolean, Boolean, Boolean, int, int);
static destroyed_instance* find_matching_instance (widget_instance*);
static void mark_dead_instance_destroyed (Widget, XtPointer, XtPointer);
static void recenter_widget (Widget);
static Widget recycle_instance (destroyed_instance*);
Widget xm_create_dialog (widget_instance*);
static Widget make_menubar (widget_instance*);
static void remove_grabs (Widget, XtPointer, XtPointer);
static Widget make_popup_menu (widget_instance*);
static Widget make_main (widget_instance*);
void xm_destroy_instance (widget_instance*);
void xm_popup_menu (Widget, XEvent *);
static void set_min_dialog_size (Widget);
static void do_call (Widget, XtPointer, enum do_call_type);
static void xm_generic_callback (Widget, XtPointer, XtPointer);
static void xm_nosel_callback (Widget, XtPointer, XtPointer);
static void xm_pull_down_callback (Widget, XtPointer, XtPointer);
static void xm_pop_down_callback (Widget, XtPointer, XtPointer);
void xm_set_keyboard_focus (Widget, Widget);
void xm_set_main_areas (Widget, Widget, Widget);
static void xm_internal_update_other_instances (Widget, XtPointer,
XtPointer);
static void xm_arm_callback (Widget, XtPointer, XtPointer);
#if 0
void xm_update_one_widget P_ ((widget_instance *, Widget, widget_value *,
Boolean));
void xm_pop_instance P_ ((widget_instance*, Boolean));
void xm_manage_resizing P_ ((Widget, Boolean));
void xm_update_one_widget (widget_instance *, Widget, widget_value *,
Boolean);
void xm_pop_instance (widget_instance*, Boolean);
void xm_manage_resizing (Widget, Boolean);
#endif

View file

@ -26,36 +26,36 @@ Boston, MA 02110-1301, USA. */
extern widget_creation_entry xm_creation_table [];
Widget
xm_create_dialog __P ((widget_instance* instance));
xm_create_dialog (widget_instance* instance);
Boolean
lw_motif_widget_p __P ((Widget widget));
lw_motif_widget_p (Widget widget);
void
xm_update_one_widget __P ((widget_instance* instance, Widget widget,
widget_value* val, Boolean deep_p));
xm_update_one_widget (widget_instance* instance, Widget widget,
widget_value* val, Boolean deep_p);
void
xm_update_one_value __P ((widget_instance* instance, Widget widget,
widget_value* val));
xm_update_one_value (widget_instance* instance, Widget widget,
widget_value* val);
void
xm_destroy_instance __P ((widget_instance* instance));
xm_destroy_instance (widget_instance* instance);
void
xm_set_keyboard_focus __P ((Widget parent, Widget w));
xm_set_keyboard_focus (Widget parent, Widget w);
void
xm_popup_menu __P ((Widget widget, XEvent *event));
xm_popup_menu (Widget widget, XEvent *event);
void
xm_pop_instance __P ((widget_instance* instance, Boolean up));
xm_pop_instance (widget_instance* instance, Boolean up);
void
xm_set_main_areas __P ((Widget parent, Widget menubar, Widget work_area));
xm_set_main_areas (Widget parent, Widget menubar, Widget work_area);
void
xm_manage_resizing __P ((Widget w, Boolean flag));
xm_manage_resizing (Widget w, Boolean flag);
#endif /* LWLIB_XM_H */

View file

@ -26,7 +26,7 @@ Boston, MA 02110-1301, USA. */
#include "lwlib.h"
extern char *safe_strdup __P ((const char *));
extern char *safe_strdup (const char *);
struct widget_xft_data;
@ -70,14 +70,14 @@ typedef struct _widget_creation_entry
/* update all other instances of a widget. Can be used in a callback when
a widget has been used by the user */
void
lw_internal_update_other_instances __P ((Widget, XtPointer, XtPointer));
lw_internal_update_other_instances (Widget, XtPointer, XtPointer);
/* get the widget_value for a widget in a given instance */
widget_value*
lw_get_widget_value_for_widget __P ((widget_instance *, Widget));
lw_get_widget_value_for_widget (widget_instance *, Widget);
widget_info *lw_get_widget_info __P ((LWLIB_ID));
widget_instance * lw_get_widget_instance __P ((Widget));
widget_info *lw_get_widget_info (LWLIB_ID);
widget_instance * lw_get_widget_instance (Widget);
#endif /* LWLIB_INTERNAL_H */

View file

@ -42,8 +42,7 @@ Boston, MA 02110-1301, USA. */
/* Redisplay the contents of the widget, without first clearing it. */
void
XtNoClearRefreshWidget (widget)
Widget widget;
XtNoClearRefreshWidget (Widget widget)
{
XEvent event;
@ -67,10 +66,7 @@ XtNoClearRefreshWidget (widget)
* Apply a function to all the subwidgets of a given widget recursively.
*/
void
XtApplyToWidgets (w, proc, arg)
Widget w;
XtApplyToWidgetsProc proc;
XtPointer arg;
XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg)
{
if (XtIsComposite (w))
{
@ -81,8 +77,8 @@ XtApplyToWidgets (w, proc, arg)
int nkids = cw->composite.num_children;
Widget *kids = (Widget *) malloc (sizeof (Widget) * nkids);
int i;
lwlib_bcopy ((char *) cw->composite.children, (char *) kids,
sizeof (Widget) * nkids);
memcpy ((char *) kids, (char *) cw->composite.children,
sizeof (Widget) * nkids);
for (i = 0; i < nkids; i++)
/* This prevent us from using gadgets, why is it here? */
/* if (XtIsWidget (kids [i])) */
@ -101,10 +97,7 @@ XtApplyToWidgets (w, proc, arg)
* Stop as soon as the function returns non NULL and returns this as a value.
*/
void *
XtApplyUntilToWidgets (w, proc, arg)
Widget w;
XtApplyUntilToWidgetsProc proc;
XtPointer arg;
XtApplyUntilToWidgets (Widget w, XtApplyUntilToWidgetsProc proc, XtPointer arg)
{
void* result;
if (XtIsComposite (w))
@ -130,9 +123,7 @@ XtApplyUntilToWidgets (w, proc, arg)
* Returns a copy of the list of all children of a composite widget
*/
Widget *
XtCompositeChildren (widget, number)
Widget widget;
unsigned int* number;
XtCompositeChildren (Widget widget, unsigned int *number)
{
CompositeWidget cw = (CompositeWidget)widget;
Widget* result;
@ -153,15 +144,13 @@ XtCompositeChildren (widget, number)
}
Boolean
XtWidgetBeingDestroyedP (widget)
Widget widget;
XtWidgetBeingDestroyedP (Widget widget)
{
return widget->core.being_destroyed;
}
void
XtSafelyDestroyWidget (widget)
Widget widget;
XtSafelyDestroyWidget (Widget widget)
{
#if 0

View file

@ -1,21 +1,21 @@
#ifndef _LWLIB_UTILS_H_
#define _LWLIB_UTILS_H_
void XtNoClearRefreshWidget __P ((Widget));
void XtNoClearRefreshWidget (Widget);
typedef void (*XtApplyToWidgetsProc) __P ((Widget, XtPointer));
typedef void* (*XtApplyUntilToWidgetsProc) __P ((Widget, XtPointer));
typedef void (*XtApplyToWidgetsProc) (Widget, XtPointer);
typedef void* (*XtApplyUntilToWidgetsProc) (Widget, XtPointer);
void XtApplyToWidgets __P ((Widget, XtApplyToWidgetsProc, XtPointer));
void *XtApplyUntilToWidgets __P ((Widget, XtApplyUntilToWidgetsProc, XtPointer));
void XtApplyToWidgets (Widget, XtApplyToWidgetsProc, XtPointer);
void *XtApplyUntilToWidgets (Widget, XtApplyUntilToWidgetsProc, XtPointer);
Widget *XtCompositeChildren __P ((Widget, unsigned int *));
Widget *XtCompositeChildren (Widget, unsigned int *);
/* returns True is the widget is being destroyed, False otherwise */
Boolean
XtWidgetBeingDestroyedP __P ((Widget widget));
XtWidgetBeingDestroyedP (Widget widget);
void XtSafelyDestroyWidget __P ((Widget));
void XtSafelyDestroyWidget (Widget);
#endif /* _LWLIB_UTILS_H_ */

View file

@ -71,67 +71,42 @@ char *lwlib_toolkit_type = "motif";
char *lwlib_toolkit_type = "lucid";
#endif
static widget_value *merge_widget_value P_ ((widget_value *,
widget_value *,
int, int *));
static void instantiate_widget_instance P_ ((widget_instance *));
static int my_strcasecmp P_ ((char *, char *));
static void safe_free_str P_ ((char *));
static void free_widget_value_tree P_ ((widget_value *));
static widget_value *copy_widget_value_tree P_ ((widget_value *,
change_type));
static widget_info *allocate_widget_info P_ ((char *, char *, LWLIB_ID,
widget_value *,
lw_callback, lw_callback,
lw_callback, lw_callback));
static void free_widget_info P_ ((widget_info *));
static void mark_widget_destroyed P_ ((Widget, XtPointer, XtPointer));
static widget_instance *allocate_widget_instance P_ ((widget_info *,
Widget, Boolean));
static void free_widget_instance P_ ((widget_instance *));
static widget_info *get_widget_info P_ ((LWLIB_ID, Boolean));
static widget_instance *get_widget_instance P_ ((Widget, Boolean));
static widget_instance *find_instance P_ ((LWLIB_ID, Widget, Boolean));
static Boolean safe_strcmp P_ ((char *, char *));
static Widget name_to_widget P_ ((widget_instance *, char *));
static void set_one_value P_ ((widget_instance *, widget_value *, Boolean));
static void update_one_widget_instance P_ ((widget_instance *, Boolean));
static void update_all_widget_values P_ ((widget_info *, Boolean));
static void initialize_widget_instance P_ ((widget_instance *));
static widget_creation_function find_in_table P_ ((char *, widget_creation_entry *));
static Boolean dialog_spec_p P_ ((char *));
static void destroy_one_instance P_ ((widget_instance *));
static void lw_pop_all_widgets P_ ((LWLIB_ID, Boolean));
static Boolean get_one_value P_ ((widget_instance *, widget_value *));
static void show_one_widget_busy P_ ((Widget, Boolean));
void
lwlib_memset (address, value, length)
char *address;
int value;
size_t length;
{
int i;
for (i = 0; i < length; i++)
address[i] = value;
}
void
lwlib_bcopy (from, to, length)
char *from;
char *to;
int length;
{
int i;
for (i = 0; i < length; i++)
to[i] = from[i];
}
static widget_value *merge_widget_value (widget_value *,
widget_value *,
int, int *);
static void instantiate_widget_instance (widget_instance *);
static int my_strcasecmp (char *, char *);
static void safe_free_str (char *);
static void free_widget_value_tree (widget_value *);
static widget_value *copy_widget_value_tree (widget_value *,
change_type);
static widget_info *allocate_widget_info (char *, char *, LWLIB_ID,
widget_value *,
lw_callback, lw_callback,
lw_callback, lw_callback);
static void free_widget_info (widget_info *);
static void mark_widget_destroyed (Widget, XtPointer, XtPointer);
static widget_instance *allocate_widget_instance (widget_info *,
Widget, Boolean);
static void free_widget_instance (widget_instance *);
static widget_info *get_widget_info (LWLIB_ID, Boolean);
static widget_instance *get_widget_instance (Widget, Boolean);
static widget_instance *find_instance (LWLIB_ID, Widget, Boolean);
static Boolean safe_strcmp (char *, char *);
static Widget name_to_widget (widget_instance *, char *);
static void set_one_value (widget_instance *, widget_value *, Boolean);
static void update_one_widget_instance (widget_instance *, Boolean);
static void update_all_widget_values (widget_info *, Boolean);
static void initialize_widget_instance (widget_instance *);
static widget_creation_function find_in_table (char *, widget_creation_entry *);
static Boolean dialog_spec_p (char *);
static void destroy_one_instance (widget_instance *);
static void lw_pop_all_widgets (LWLIB_ID, Boolean);
static Boolean get_one_value (widget_instance *, widget_value *);
static void show_one_widget_busy (Widget, Boolean);
/* utility functions for widget_instance and widget_info */
char *
safe_strdup (s)
const char *s;
safe_strdup (const char *s)
{
char *result;
if (! s) return 0;
@ -145,8 +120,7 @@ safe_strdup (s)
/* Like strcmp but ignore differences in case. */
static int
my_strcasecmp (s1, s2)
char *s1, *s2;
my_strcasecmp (char *s1, char *s2)
{
while (1)
{
@ -164,8 +138,7 @@ my_strcasecmp (s1, s2)
}
static void
safe_free_str (s)
char *s;
safe_free_str (char *s)
{
free (s);
}
@ -174,7 +147,7 @@ static widget_value *widget_value_free_list = 0;
static int malloc_cpt = 0;
widget_value *
malloc_widget_value ()
malloc_widget_value (void)
{
widget_value *wv;
if (widget_value_free_list)
@ -188,7 +161,7 @@ malloc_widget_value ()
wv = (widget_value *) malloc (sizeof (widget_value));
malloc_cpt++;
}
lwlib_memset ((void*) wv, 0, sizeof (widget_value));
memset ((void*) wv, 0, sizeof (widget_value));
return wv;
}
@ -196,8 +169,7 @@ malloc_widget_value ()
by malloc_widget_value(), and no substructures.
*/
void
free_widget_value (wv)
widget_value *wv;
free_widget_value (widget_value *wv)
{
if (wv->free_list)
abort ();
@ -217,8 +189,7 @@ free_widget_value (wv)
}
static void
free_widget_value_tree (wv)
widget_value *wv;
free_widget_value_tree (widget_value *wv)
{
if (!wv)
return;
@ -249,9 +220,7 @@ free_widget_value_tree (wv)
}
static widget_value *
copy_widget_value_tree (val, change)
widget_value* val;
change_type change;
copy_widget_value_tree (widget_value *val, change_type change)
{
widget_value* copy;
@ -310,21 +279,17 @@ allocate_widget_info (type, name, id, val, pre_activate_cb,
}
static void
free_widget_info (info)
widget_info* info;
free_widget_info (widget_info *info)
{
safe_free_str (info->type);
safe_free_str (info->name);
free_widget_value_tree (info->val);
lwlib_memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
free (info);
}
static void
mark_widget_destroyed (widget, closure, call_data)
Widget widget;
XtPointer closure;
XtPointer call_data;
mark_widget_destroyed (Widget widget, XtPointer closure, XtPointer call_data)
{
widget_instance* instance = (widget_instance*)closure;
@ -333,22 +298,12 @@ mark_widget_destroyed (widget, closure, call_data)
instance->widget = NULL;
}
/* The messy #ifdef PROTOTYPES here and elsewhere are prompted by a
flood of warnings about argument promotion from proprietary ISO C
compilers. (etags still only makes one entry for each function.) */
static widget_instance *
#ifdef PROTOTYPES
allocate_widget_instance (widget_info* info, Widget parent, Boolean pop_up_p)
#else
allocate_widget_instance (info, parent, pop_up_p)
widget_info* info;
Widget parent;
Boolean pop_up_p;
#endif
{
widget_instance* instance =
(widget_instance*)malloc (sizeof (widget_instance));
bzero (instance, sizeof *instance);
memset (instance, 0, sizeof *instance);
instance->parent = parent;
instance->pop_up_p = pop_up_p;
instance->info = info;
@ -363,21 +318,14 @@ allocate_widget_instance (info, parent, pop_up_p)
}
static void
free_widget_instance (instance)
widget_instance* instance;
free_widget_instance (widget_instance *instance)
{
lwlib_memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance));
free (instance);
}
static widget_info *
#ifdef PROTOTYPES
get_widget_info (LWLIB_ID id, Boolean remove_p)
#else
get_widget_info (id, remove_p)
LWLIB_ID id;
Boolean remove_p;
#endif
{
widget_info* info;
widget_info* prev;
@ -401,20 +349,13 @@ get_widget_info (id, remove_p)
/* Internal function used by the library dependent implementation to get the
widget_value for a given widget in an instance */
widget_info *
lw_get_widget_info (id)
LWLIB_ID id;
lw_get_widget_info (LWLIB_ID id)
{
return get_widget_info (id, 0);
}
static widget_instance *
#ifdef PROTOTYPES
get_widget_instance (Widget widget, Boolean remove_p)
#else
get_widget_instance (widget, remove_p)
Widget widget;
Boolean remove_p;
#endif
{
widget_info* info;
widget_instance* instance;
@ -441,21 +382,13 @@ get_widget_instance (widget, remove_p)
WIDGET, or null if WIDGET is not a lwlib widget. */
widget_instance *
lw_get_widget_instance (widget)
Widget widget;
lw_get_widget_instance (Widget widget)
{
return get_widget_instance (widget, False);
}
static widget_instance*
#ifdef PROTOTYPES
find_instance (LWLIB_ID id, Widget parent, Boolean pop_up_p)
#else
find_instance (id, parent, pop_up_p)
LWLIB_ID id;
Widget parent;
Boolean pop_up_p;
#endif
{
widget_info* info = get_widget_info (id, False);
widget_instance* instance;
@ -471,9 +404,7 @@ find_instance (id, parent, pop_up_p)
/* utility function for widget_value */
static Boolean
safe_strcmp (s1, s2)
char* s1;
char* s2;
safe_strcmp (char *s1, char *s2)
{
if (!!s1 ^ !!s2) return True;
return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2;
@ -500,11 +431,7 @@ safe_strcmp (s1, s2)
static widget_value *
merge_widget_value (val1, val2, level, change_p)
widget_value* val1;
widget_value* val2;
int level;
int *change_p;
merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p)
{
change_type change, this_one_change;
widget_value* merged_next;
@ -658,9 +585,7 @@ merge_widget_value (val1, val2, level, change_p)
/* modifying the widgets */
static Widget
name_to_widget (instance, name)
widget_instance* instance;
char* name;
name_to_widget (widget_instance *instance, char *name)
{
Widget widget = NULL;
@ -684,14 +609,7 @@ name_to_widget (instance, name)
}
static void
#ifdef PROTOTYPES
set_one_value (widget_instance* instance, widget_value* val, Boolean deep_p)
#else
set_one_value (instance, val, deep_p)
widget_instance* instance;
widget_value* val;
Boolean deep_p;
#endif
{
Widget widget = name_to_widget (instance, val->name);
@ -713,13 +631,7 @@ set_one_value (instance, val, deep_p)
}
static void
#ifdef PROTOTYPES
update_one_widget_instance (widget_instance* instance, Boolean deep_p)
#else
update_one_widget_instance (instance, deep_p)
widget_instance* instance;
Boolean deep_p;
#endif
{
widget_value *val;
@ -733,13 +645,7 @@ update_one_widget_instance (instance, deep_p)
}
static void
#ifdef PROTOTYPES
update_all_widget_values (widget_info* info, Boolean deep_p)
#else
update_all_widget_values (info, deep_p)
widget_info* info;
Boolean deep_p;
#endif
{
widget_instance* instance;
widget_value* val;
@ -752,14 +658,7 @@ update_all_widget_values (info, deep_p)
}
int
#ifdef PROTOTYPES
lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p)
#else
lw_modify_all_widgets (id, val, deep_p)
LWLIB_ID id;
widget_value* val;
Boolean deep_p;
#endif
{
widget_info* info = get_widget_info (id, False);
widget_value* new_val;
@ -814,8 +713,7 @@ lw_modify_all_widgets (id, val, deep_p)
/* creating the widgets */
static void
initialize_widget_instance (instance)
widget_instance* instance;
initialize_widget_instance (widget_instance *instance)
{
widget_value* val;
@ -830,9 +728,7 @@ initialize_widget_instance (instance)
static widget_creation_function
find_in_table (type, table)
char* type;
widget_creation_entry* table;
find_in_table (char *type, widget_creation_entry *table)
{
widget_creation_entry* cur;
for (cur = table; cur->type; cur++)
@ -842,8 +738,7 @@ find_in_table (type, table)
}
static Boolean
dialog_spec_p (name)
char* name;
dialog_spec_p (char *name)
{
/* return True if name matches [EILPQeilpq][1-9][Bb] or
[EILPQeilpq][1-9][Bb][Rr][1-9] */
@ -876,8 +771,7 @@ dialog_spec_p (name)
}
static void
instantiate_widget_instance (instance)
widget_instance* instance;
instantiate_widget_instance (widget_instance *instance)
{
widget_creation_function function = NULL;
@ -945,14 +839,7 @@ lw_register_widget (type, name, id, val, pre_activate_cb,
}
Widget
#ifdef PROTOTYPES
lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p)
#else
lw_get_widget (id, parent, pop_up_p)
LWLIB_ID id;
Widget parent;
Boolean pop_up_p;
#endif
{
widget_instance* instance;
@ -961,14 +848,7 @@ lw_get_widget (id, parent, pop_up_p)
}
Widget
#ifdef PROTOTYPES
lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p)
#else
lw_make_widget (id, parent, pop_up_p)
LWLIB_ID id;
Widget parent;
Boolean pop_up_p;
#endif
{
widget_instance* instance;
widget_info* info;
@ -988,25 +868,10 @@ lw_make_widget (id, parent, pop_up_p)
}
Widget
#ifdef PROTOTYPES
lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val,
Widget parent, Boolean pop_up_p,
lw_callback pre_activate_cb, lw_callback selection_cb,
lw_callback post_activate_cb, lw_callback highlight_cb)
#else
lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
selection_cb, post_activate_cb, highlight_cb)
char* type;
char* name;
LWLIB_ID id;
widget_value* val;
Widget parent;
Boolean pop_up_p;
lw_callback pre_activate_cb;
lw_callback selection_cb;
lw_callback post_activate_cb;
lw_callback highlight_cb;
#endif
{
lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb,
post_activate_cb, highlight_cb);
@ -1016,8 +881,7 @@ lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
/* destroying the widgets */
static void
destroy_one_instance (instance)
widget_instance* instance;
destroy_one_instance (widget_instance *instance)
{
/* Remove the destroy callback on the widget; that callback will try to
dereference the instance object (to set its widget slot to 0, since the
@ -1059,8 +923,7 @@ destroy_one_instance (instance)
}
void
lw_destroy_widget (w)
Widget w;
lw_destroy_widget (Widget w)
{
widget_instance* instance = get_widget_instance (w, True);
@ -1076,8 +939,7 @@ lw_destroy_widget (w)
}
void
lw_destroy_all_widgets (id)
LWLIB_ID id;
lw_destroy_all_widgets (LWLIB_ID id)
{
widget_info* info = get_widget_info (id, True);
widget_instance* instance;
@ -1096,14 +958,14 @@ lw_destroy_all_widgets (id)
}
void
lw_destroy_everything ()
lw_destroy_everything (void)
{
while (all_widget_info)
lw_destroy_all_widgets (all_widget_info->id);
}
void
lw_destroy_all_pop_ups ()
lw_destroy_all_pop_ups (void)
{
widget_info* info;
widget_info* next;
@ -1123,7 +985,7 @@ extern Widget first_child (/* Widget */); /* garbage */
#endif
Widget
lw_raise_all_pop_up_widgets ()
lw_raise_all_pop_up_widgets (void)
{
widget_info* info;
widget_instance* instance;
@ -1156,13 +1018,7 @@ lw_raise_all_pop_up_widgets ()
}
static void
#ifdef PROTOTYPES
lw_pop_all_widgets (LWLIB_ID id, Boolean up)
#else
lw_pop_all_widgets (id, up)
LWLIB_ID id;
Boolean up;
#endif
{
widget_info* info = get_widget_info (id, False);
widget_instance* instance;
@ -1197,23 +1053,19 @@ lw_pop_all_widgets (id, up)
}
void
lw_pop_up_all_widgets (id)
LWLIB_ID id;
lw_pop_up_all_widgets (LWLIB_ID id)
{
lw_pop_all_widgets (id, True);
}
void
lw_pop_down_all_widgets (id)
LWLIB_ID id;
lw_pop_down_all_widgets (LWLIB_ID id)
{
lw_pop_all_widgets (id, False);
}
void
lw_popup_menu (widget, event)
Widget widget;
XEvent *event;
lw_popup_menu (Widget widget, XEvent *event)
{
#if defined (USE_LUCID)
if (lw_lucid_widget_p (widget))
@ -1231,9 +1083,7 @@ lw_popup_menu (widget, event)
/* get the values back */
static Boolean
get_one_value (instance, val)
widget_instance* instance;
widget_value* val;
get_one_value (widget_instance *instance, widget_value *val)
{
Widget widget = name_to_widget (instance, val->name);
@ -1258,9 +1108,7 @@ get_one_value (instance, val)
}
Boolean
lw_get_some_values (id, val_out)
LWLIB_ID id;
widget_value* val_out;
lw_get_some_values (LWLIB_ID id, widget_value *val_out)
{
widget_info* info = get_widget_info (id, False);
widget_instance* instance;
@ -1282,8 +1130,7 @@ lw_get_some_values (id, val_out)
}
widget_value*
lw_get_all_values (id)
LWLIB_ID id;
lw_get_all_values (LWLIB_ID id)
{
widget_info* info = get_widget_info (id, False);
widget_value* val = info->val;
@ -1296,9 +1143,7 @@ lw_get_all_values (id)
/* internal function used by the library dependent implementation to get the
widget_value for a given widget in an instance */
widget_value*
lw_get_widget_value_for_widget (instance, w)
widget_instance* instance;
Widget w;
lw_get_widget_value_for_widget (widget_instance *instance, Widget w)
{
char* name = XtName (w);
widget_value* cur;
@ -1317,10 +1162,7 @@ static Boolean lwlib_updating;
modified to update other instances of the widgets. Closure should be the
widget_instance. */
void
lw_internal_update_other_instances (widget, closure, call_data)
Widget widget;
XtPointer closure;
XtPointer call_data;
lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data)
{
widget_instance* instance = (widget_instance*)closure;
char* name = XtName (widget);
@ -1357,8 +1199,7 @@ lw_internal_update_other_instances (widget, closure, call_data)
/* get the id */
LWLIB_ID
lw_get_widget_id (w)
Widget w;
lw_get_widget_id (Widget w)
{
widget_instance* instance = get_widget_instance (w, False);
@ -1367,9 +1208,7 @@ lw_get_widget_id (w)
/* set the keyboard focus */
void
lw_set_keyboard_focus (parent, w)
Widget parent;
Widget w;
lw_set_keyboard_focus (Widget parent, Widget w)
{
#if defined (USE_MOTIF)
xm_set_keyboard_focus (parent, w);
@ -1380,13 +1219,7 @@ lw_set_keyboard_focus (parent, w)
/* Show busy */
static void
#ifdef PROTOTYPES
show_one_widget_busy (Widget w, Boolean flag)
#else
show_one_widget_busy (w, flag)
Widget w;
Boolean flag;
#endif
{
Pixel foreground = 0;
Pixel background = 1;
@ -1405,13 +1238,7 @@ show_one_widget_busy (w, flag)
}
void
#ifdef PROTOTYPES
lw_show_busy (Widget w, Boolean busy)
#else
lw_show_busy (w, busy)
Widget w;
Boolean busy;
#endif
{
widget_instance* instance = get_widget_instance (w, False);
widget_info* info;
@ -1433,13 +1260,7 @@ lw_show_busy (w, busy)
/* This hack exists because Lucid/Athena need to execute the strange
function below to support geometry management. */
void
#ifdef PROTOTYPES
lw_refigure_widget (Widget w, Boolean doit)
#else
lw_refigure_widget (w, doit)
Widget w;
Boolean doit;
#endif
{
#if defined (USE_XAW)
XawPanedSetRefigureMode (w, doit);
@ -1455,9 +1276,7 @@ lw_refigure_widget (w, doit)
/* Toolkit independent way of determining if an event window is in the
menubar. */
Boolean
lw_window_is_in_menubar (win, menubar_widget)
Window win;
Widget menubar_widget;
lw_window_is_in_menubar (Window win, Widget menubar_widget)
{
return menubar_widget
#if defined (USE_LUCID)
@ -1473,10 +1292,7 @@ lw_window_is_in_menubar (win, menubar_widget)
/* Motif hack to set the main window areas. */
void
lw_set_main_areas (parent, menubar, work_area)
Widget parent;
Widget menubar;
Widget work_area;
lw_set_main_areas (Widget parent, Widget menubar, Widget work_area)
{
#if defined (USE_MOTIF)
xm_set_main_areas (parent, menubar, work_area);
@ -1486,13 +1302,7 @@ lw_set_main_areas (parent, menubar, work_area)
/* Manage resizing for Motif. This disables resizing when the menubar
is about to be modified. */
void
#ifdef PROTOTYPES
lw_allow_resizing (Widget w, Boolean flag)
#else
lw_allow_resizing (w, flag)
Widget w;
Boolean flag;
#endif
{
#if defined (USE_MOTIF)
xm_manage_resizing (w, flag);
@ -1506,15 +1316,12 @@ lw_allow_resizing (w, flag)
to similar ones that are supported. */
int
lw_separator_p (label, type, motif_p)
char *label;
enum menu_separator *type;
int motif_p;
lw_separator_p (char *label, enum menu_separator *type, int motif_p)
{
int separator_p = 0;
if (strlen (label) >= 3
&& bcmp (label, "--:", 3) == 0)
&& memcmp (label, "--:", 3) == 0)
{
static struct separator_table
{
@ -1557,7 +1364,7 @@ lw_separator_p (label, type, motif_p)
}
}
else if (strlen (label) > 3
&& bcmp (label, "--", 2) == 0
&& memcmp (label, "--", 2) == 0
&& label[2] != '-')
{
/* Alternative, more Emacs-style names. */

View file

@ -130,66 +130,64 @@ typedef struct _widget_value
} widget_value;
typedef void (*lw_callback) __P ((Widget w, LWLIB_ID id, void* data));
typedef void (*lw_callback) (Widget w, LWLIB_ID id, void* data);
void lw_register_widget __P ((char* type, char* name, LWLIB_ID id,
widget_value* val, lw_callback pre_activate_cb,
lw_callback selection_cb,
lw_callback post_activate_cb,
lw_callback highlight_cb));
Widget lw_get_widget __P ((LWLIB_ID id, Widget parent, Boolean pop_up_p));
Widget lw_make_widget __P ((LWLIB_ID id, Widget parent, Boolean pop_up_p));
Widget lw_create_widget __P ((char* type, char* name, LWLIB_ID id,
widget_value* val, Widget parent, Boolean pop_up_p,
lw_callback pre_activate_cb,
lw_callback selection_cb,
lw_callback post_activate_cb,
lw_callback highlight_cb));
LWLIB_ID lw_get_widget_id __P ((Widget w));
int lw_modify_all_widgets __P ((LWLIB_ID id, widget_value* val, Boolean deep_p));
void lw_destroy_widget __P ((Widget w));
void lw_destroy_all_widgets __P ((LWLIB_ID id));
void lw_destroy_everything __P ((void));
void lw_destroy_all_pop_ups __P ((void));
Widget lw_raise_all_pop_up_widgets __P ((void));
widget_value* lw_get_all_values __P ((LWLIB_ID id));
Boolean lw_get_some_values __P ((LWLIB_ID id, widget_value* val));
void lw_pop_up_all_widgets __P ((LWLIB_ID id));
void lw_pop_down_all_widgets __P ((LWLIB_ID id));
widget_value *malloc_widget_value ();
void free_widget_value __P ((widget_value *));
void lw_popup_menu __P ((Widget, XEvent *));
void lw_register_widget (char* type, char* name, LWLIB_ID id,
widget_value* val, lw_callback pre_activate_cb,
lw_callback selection_cb,
lw_callback post_activate_cb,
lw_callback highlight_cb);
Widget lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p);
Widget lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p);
Widget lw_create_widget (char* type, char* name, LWLIB_ID id,
widget_value* val, Widget parent, Boolean pop_up_p,
lw_callback pre_activate_cb,
lw_callback selection_cb,
lw_callback post_activate_cb,
lw_callback highlight_cb);
LWLIB_ID lw_get_widget_id (Widget w);
int lw_modify_all_widgets (LWLIB_ID id, widget_value* val, Boolean deep_p);
void lw_destroy_widget (Widget w);
void lw_destroy_all_widgets (LWLIB_ID id);
void lw_destroy_everything (void);
void lw_destroy_all_pop_ups (void);
Widget lw_raise_all_pop_up_widgets (void);
widget_value* lw_get_all_values (LWLIB_ID id);
Boolean lw_get_some_values (LWLIB_ID id, widget_value* val);
void lw_pop_up_all_widgets (LWLIB_ID id);
void lw_pop_down_all_widgets (LWLIB_ID id);
widget_value *malloc_widget_value (void);
void free_widget_value (widget_value *);
void lw_popup_menu (Widget, XEvent *);
/* Toolkit independent way of focusing on a Widget at the Xt level. */
void lw_set_keyboard_focus __P ((Widget parent, Widget w));
void lw_set_keyboard_focus (Widget parent, Widget w);
/* Silly Energize hack to invert the "sheet" button */
void lw_show_busy __P ((Widget w, Boolean busy));
void lw_show_busy (Widget w, Boolean busy);
/* Silly hack to assist with Lucid/Athena geometry management. */
void lw_refigure_widget __P ((Widget w, Boolean doit));
void lw_refigure_widget (Widget w, Boolean doit);
/* Toolkit independent way of determining if an event occurred on a
menubar. */
Boolean lw_window_is_in_menubar __P ((Window win, Widget menubar_widget));
Boolean lw_window_is_in_menubar (Window win, Widget menubar_widget);
/* Manage resizing: TRUE permits resizing widget w; FALSE disallows it. */
void lw_allow_resizing __P ((Widget w, Boolean flag));
void lw_allow_resizing (Widget w, Boolean flag);
/* Set up the main window. */
void lw_set_main_areas __P ((Widget parent,
Widget menubar,
Widget work_area));
void lw_set_main_areas (Widget parent,
Widget menubar,
Widget work_area);
/* Value is non-zero if LABEL is a menu separator. If it is, *TYPE is
set to an appropriate enumerator of type enum menu_separator.
MOTIF_P non-zero means map separator types not supported by Motif
to similar ones that are supported. */
int lw_separator_p __P ((char *label, enum menu_separator *type,
int motif_p));
void lwlib_bcopy __P ((char*, char*, int));
int lw_separator_p (char *label, enum menu_separator *type,
int motif_p);
#endif /* LWLIB_H */

View file

@ -185,24 +185,25 @@ xlwMenuResources[] =
};
#undef offset
static Boolean XlwMenuSetValues();
static void XlwMenuRealize();
static void XlwMenuResize();
static void XlwMenuInitialize();
static void XlwMenuRedisplay();
static void XlwMenuDestroy();
static void XlwMenuClassInitialize();
static void Start();
static void Drag();
static void Down();
static void Up();
static void Left();
static void Right();
static void Select();
static void Key();
static void Nothing();
static int separator_height __P ((enum menu_separator));
static void pop_up_menu __P ((XlwMenuWidget, XButtonPressedEvent *));
static Boolean XlwMenuSetValues(Widget current, Widget request, Widget new,
ArgList args, Cardinal *num_args);
static void XlwMenuRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes);
static void XlwMenuResize(Widget w);
static void XlwMenuInitialize(Widget request, Widget mw, ArgList args, Cardinal *num_args);
static void XlwMenuRedisplay(Widget w, XEvent *ev, Region region);
static void XlwMenuDestroy(Widget w);
static void XlwMenuClassInitialize(void);
static void Start(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Drag(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Down(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Up(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Left(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Right(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Select(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Key(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static void Nothing(Widget w, XEvent *ev, String *params, Cardinal *num_params);
static int separator_height (enum menu_separator);
static void pop_up_menu (XlwMenuWidget, XButtonPressedEvent *);
static XtActionsRec
@ -278,9 +279,7 @@ static int next_release_must_exit;
/* Ungrab pointer and keyboard */
static void
ungrab_all (w, ungrabtime)
Widget w;
Time ungrabtime;
ungrab_all (Widget w, Time ungrabtime)
{
XtUngrabPointer (w, ungrabtime);
if (GRAB_KEYBOARD) XtUngrabKeyboard (w, ungrabtime);
@ -289,8 +288,7 @@ ungrab_all (w, ungrabtime)
/* Like abort, but remove grabs from widget W before. */
static void
abort_gracefully (w)
Widget w;
abort_gracefully (Widget w)
{
if (XtIsShell (XtParent (w)))
XtRemoveGrab (w);
@ -299,9 +297,7 @@ abort_gracefully (w)
}
static void
push_new_stack (mw, val)
XlwMenuWidget mw;
widget_value* val;
push_new_stack (XlwMenuWidget mw, widget_value *val)
{
if (!mw->menu.new_stack)
{
@ -321,8 +317,7 @@ push_new_stack (mw, val)
}
static void
pop_new_stack_if_no_contents (mw)
XlwMenuWidget mw;
pop_new_stack_if_no_contents (XlwMenuWidget mw)
{
if (mw->menu.new_depth > 1)
{
@ -332,9 +327,7 @@ pop_new_stack_if_no_contents (mw)
}
static void
make_old_stack_space (mw, n)
XlwMenuWidget mw;
int n;
make_old_stack_space (XlwMenuWidget mw, int n)
{
if (!mw->menu.old_stack)
{
@ -354,9 +347,7 @@ make_old_stack_space (mw, n)
/* Size code */
static int
string_width (mw, s)
XlwMenuWidget mw;
char *s;
string_width (XlwMenuWidget mw, char *s)
{
XCharStruct xcs;
int drop;
@ -415,8 +406,7 @@ string_width (mw, s)
#endif
static int
arrow_width (mw)
XlwMenuWidget mw;
arrow_width (XlwMenuWidget mw)
{
return (MENU_FONT_ASCENT (mw) * 3/4) | 1;
}
@ -424,8 +414,7 @@ arrow_width (mw)
/* Return the width of toggle buttons of widget MW. */
static int
toggle_button_width (mw)
XlwMenuWidget mw;
toggle_button_width (XlwMenuWidget mw)
{
return (MENU_FONT_HEIGHT (mw) * 2 / 3) | 1;
}
@ -434,8 +423,7 @@ toggle_button_width (mw)
/* Return the width of radio buttons of widget MW. */
static int
radio_button_width (mw)
XlwMenuWidget mw;
radio_button_width (XlwMenuWidget mw)
{
return toggle_button_width (mw) * 1.41;
}
@ -449,9 +437,7 @@ nameResource[] =
};
static char*
resource_widget_value (mw, val)
XlwMenuWidget mw;
widget_value *val;
resource_widget_value (XlwMenuWidget mw, widget_value *val)
{
if (!val->toolkit_data)
{
@ -537,9 +523,7 @@ size_menu_item (mw, val, horizontal_p, label_width, rest_width, button_width,
}
static void
size_menu (mw, level)
XlwMenuWidget mw;
int level;
size_menu (XlwMenuWidget mw, int level)
{
unsigned int label_width = 0;
int rest_width = 0;
@ -605,14 +589,7 @@ size_menu (mw, level)
/* Display code */
static void
draw_arrow (mw, window, gc, x, y, width, down_p)
XlwMenuWidget mw;
Window window;
GC gc;
int x;
int y;
int width;
int down_p;
draw_arrow (XlwMenuWidget mw, Window window, GC gc, int x, int y, int width, int down_p)
{
Display *dpy = XtDisplay (mw);
GC top_gc = mw->menu.shadow_top_gc;
@ -669,15 +646,7 @@ draw_arrow (mw, window, gc, x, y, width, down_p)
static void
draw_shadow_rectangle (mw, window, x, y, width, height, erase_p, down_p)
XlwMenuWidget mw;
Window window;
int x;
int y;
int width;
int height;
int erase_p;
int down_p;
draw_shadow_rectangle (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
{
Display *dpy = XtDisplay (mw);
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
@ -733,15 +702,7 @@ draw_shadow_rectangle (mw, window, x, y, width, height, erase_p, down_p)
static void
draw_shadow_rhombus (mw, window, x, y, width, height, erase_p, down_p)
XlwMenuWidget mw;
Window window;
int x;
int y;
int width;
int height;
int erase_p;
int down_p;
draw_shadow_rhombus (XlwMenuWidget mw, Window window, int x, int y, int width, int height, int erase_p, int down_p)
{
Display *dpy = XtDisplay (mw);
GC top_gc = !erase_p ? mw->menu.shadow_top_gc : mw->menu.background_gc;
@ -801,10 +762,7 @@ draw_shadow_rhombus (mw, window, x, y, width, height, erase_p, down_p)
toggle button is selected. */
static void
draw_toggle (mw, window, x, y, selected_p)
XlwMenuWidget mw;
Window window;
int x, y, selected_p;
draw_toggle (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
{
int width, height;
@ -821,10 +779,7 @@ draw_toggle (mw, window, x, y, selected_p)
toggle button is selected. */
static void
draw_radio (mw, window, x, y, selected_p)
XlwMenuWidget mw;
Window window;
int x, y, selected_p;
draw_radio (XlwMenuWidget mw, Window window, int x, int y, int selected_p)
{
int width, height;
@ -841,11 +796,7 @@ draw_radio (mw, window, x, y, selected_p)
separator to draw. TYPE is the separator type. */
static void
draw_separator (mw, window, x, y, width, type)
XlwMenuWidget mw;
Window window;
int x, y, width;
enum menu_separator type;
draw_separator (XlwMenuWidget mw, Window window, int x, int y, int width, enum menu_separator type)
{
Display *dpy = XtDisplay (mw);
XGCValues xgcv;
@ -958,8 +909,7 @@ draw_separator (mw, window, x, y, width, type)
/* Return the pixel height of menu separator SEPARATOR. */
static int
separator_height (separator)
enum menu_separator separator;
separator_height (enum menu_separator separator)
{
switch (separator)
{
@ -1137,7 +1087,6 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
#ifdef HAVE_XFT
if (ws->xft_draw)
{
XGlyphInfo gi;
int draw_x = ws->width - ws->max_rest_width
+ mw->menu.arrow_spacing;
int draw_y = y + v_spacing + shadow + font_ascent;
@ -1188,13 +1137,7 @@ display_menu_item (mw, val, ws, where, highlighted_p, horizontal_p,
}
static void
display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return)
XlwMenuWidget mw;
int level;
Boolean just_compute_p;
XPoint* highlighted_pos;
XPoint* hit;
widget_value** hit_return;
display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return)
{
widget_value* val;
widget_value* following_item;
@ -1285,10 +1228,7 @@ display_menu (mw, level, just_compute_p, highlighted_pos, hit, hit_return)
/* Motion code */
static void
set_new_state (mw, val, level)
XlwMenuWidget mw;
widget_value* val;
int level;
set_new_state (XlwMenuWidget mw, widget_value *val, int level)
{
int i;
@ -1311,7 +1251,7 @@ expose_cb (Widget widget,
for (i = 0; i < mw->menu.windows_length; ++i)
if (mw->menu.windows [i].w == widget) break;
if (i < mw->menu.windows_length && i < mw->menu.old_depth)
display_menu (mw, i, False, NULL, NULL, NULL, NULL, NULL);
display_menu (mw, i, False, NULL, NULL, NULL);
}
static void
@ -1332,16 +1272,11 @@ set_window_type (Widget w, XlwMenuWidget mw)
static void
make_windows_if_needed (mw, n)
XlwMenuWidget mw;
int n;
make_windows_if_needed (XlwMenuWidget mw, int n)
{
int i;
int start_at;
window_state* windows;
#ifdef HAVE_XFT
int screen = XScreenNumberOfScreen (mw->core.screen);
#endif
if (mw->menu.windows_length >= n)
return;
@ -1396,9 +1331,7 @@ make_windows_if_needed (mw, n)
/* Value is non-zero if WINDOW is part of menu bar widget W. */
int
xlwmenu_window_p (w, window)
Widget w;
Window window;
xlwmenu_window_p (Widget w, Window window)
{
XlwMenuWidget mw = (XlwMenuWidget) w;
int i;
@ -1412,11 +1345,7 @@ xlwmenu_window_p (w, window)
/* Make the window fit in the screen */
static void
fit_to_screen (mw, ws, previous_ws, horizontal_p)
XlwMenuWidget mw;
window_state* ws;
window_state* previous_ws;
Boolean horizontal_p;
fit_to_screen (XlwMenuWidget mw, window_state *ws, window_state *previous_ws, Boolean horizontal_p)
{
unsigned int screen_width = WidthOfScreen (XtScreen (mw));
unsigned int screen_height = HeightOfScreen (XtScreen (mw));
@ -1497,8 +1426,7 @@ create_pixmap_for_menu (window_state* ws, XlwMenuWidget mw)
/* Updates old_stack from new_stack and redisplays. */
static void
remap_menubar (mw)
XlwMenuWidget mw;
remap_menubar (XlwMenuWidget mw)
{
int i;
int last_same;
@ -1591,11 +1519,7 @@ remap_menubar (mw)
}
static Boolean
motion_event_is_in_menu (mw, ev, level, relative_pos)
XlwMenuWidget mw;
XMotionEvent* ev;
int level;
XPoint* relative_pos;
motion_event_is_in_menu (XlwMenuWidget mw, XMotionEvent *ev, int level, XPoint *relative_pos)
{
window_state* ws = &mw->menu.windows [level];
int shadow = level == 0 ? 0 : mw->menu.shadow_thickness;
@ -1608,11 +1532,7 @@ motion_event_is_in_menu (mw, ev, level, relative_pos)
}
static Boolean
map_event_to_widget_value (mw, ev, val, level)
XlwMenuWidget mw;
XMotionEvent* ev;
widget_value** val;
int* level;
map_event_to_widget_value (XlwMenuWidget mw, XMotionEvent *ev, widget_value **val, int *level)
{
int i;
XPoint relative_pos;
@ -1651,8 +1571,7 @@ map_event_to_widget_value (mw, ev, val, level)
/* Procedures */
static void
make_drawing_gcs (mw)
XlwMenuWidget mw;
make_drawing_gcs (XlwMenuWidget mw)
{
XGCValues xgcv;
float scale;
@ -1722,8 +1641,7 @@ make_drawing_gcs (mw)
}
static void
release_drawing_gcs (mw)
XlwMenuWidget mw;
release_drawing_gcs (XlwMenuWidget mw)
{
XtReleaseGC ((Widget) mw, mw->menu.foreground_gc);
XtReleaseGC ((Widget) mw, mw->menu.button_gc);
@ -1742,8 +1660,7 @@ release_drawing_gcs (mw)
? ((unsigned long) (x)) : ((unsigned long) (y)))
static void
make_shadow_gcs (mw)
XlwMenuWidget mw;
make_shadow_gcs (XlwMenuWidget mw)
{
XGCValues xgcv;
unsigned long pm = 0;
@ -1875,8 +1792,7 @@ make_shadow_gcs (mw)
static void
release_shadow_gcs (mw)
XlwMenuWidget mw;
release_shadow_gcs (XlwMenuWidget mw)
{
Display *dpy = XtDisplay ((Widget) mw);
Screen *screen = XtScreen ((Widget) mw);
@ -1897,8 +1813,7 @@ release_shadow_gcs (mw)
#ifdef HAVE_XFT
static int
openXftFont (mw)
XlwMenuWidget mw;
openXftFont (XlwMenuWidget mw)
{
char *fname = mw->menu.faceName;
@ -1934,14 +1849,10 @@ openXftFont (mw)
#endif
static void
XlwMenuInitialize (request, mw, args, num_args)
Widget request;
XlwMenuWidget mw;
ArgList args;
Cardinal *num_args;
XlwMenuInitialize (Widget request, Widget w, ArgList args, Cardinal *num_args)
{
/* Get the GCs and the widget size */
XlwMenuWidget mw = (XlwMenuWidget) w;
Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
Display* display = XtDisplay (mw);
@ -1950,7 +1861,7 @@ XlwMenuInitialize (request, mw, args, num_args)
/* _XtCreate is freeing the object that was passed to us,
so make a copy that we will actually keep. */
lwlib_bcopy (mw->menu.contents, tem, sizeof (widget_value));
memcpy (tem, mw->menu.contents, sizeof (widget_value));
mw->menu.contents = tem;
#endif
@ -2018,16 +1929,13 @@ XlwMenuInitialize (request, mw, args, num_args)
}
static void
XlwMenuClassInitialize ()
XlwMenuClassInitialize (void)
{
xlwmenu_default_font = 0;
}
static void
XlwMenuRealize (w, valueMask, attributes)
Widget w;
Mask *valueMask;
XSetWindowAttributes *attributes;
XlwMenuRealize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
XSetWindowAttributes xswa;
@ -2089,13 +1997,9 @@ XlwMenuRealize (w, valueMask, attributes)
receives expose events through Xt. So we repaint all the other panes
when receiving an Expose event. */
static void
XlwMenuRedisplay (w, ev, region)
Widget w;
XEvent* ev;
Region region;
XlwMenuRedisplay (Widget w, XEvent *ev, Region region)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
int i;
/* If we have a depth beyond 1, it's because a submenu was displayed.
If the submenu has been destroyed, set the depth back to 1. */
@ -2113,15 +2017,13 @@ XlwMenuRedisplay (w, ev, region)
over a menu item is unmapped. */
void
xlwmenu_redisplay (w)
Widget w;
xlwmenu_redisplay (Widget w)
{
XlwMenuRedisplay (w, NULL, None);
}
static void
XlwMenuDestroy (w)
Widget w;
XlwMenuDestroy (Widget w)
{
int i;
XlwMenuWidget mw = (XlwMenuWidget) w;
@ -2200,10 +2102,8 @@ facename_changed (XlwMenuWidget newmw,
#endif
static Boolean
XlwMenuSetValues (current, request, new)
Widget current;
Widget request;
Widget new;
XlwMenuSetValues (Widget current, Widget request, Widget new,
ArgList args, Cardinal *num_args)
{
XlwMenuWidget oldmw = (XlwMenuWidget)current;
XlwMenuWidget newmw = (XlwMenuWidget)new;
@ -2292,8 +2192,7 @@ XlwMenuSetValues (current, request, new)
}
static void
XlwMenuResize (w)
Widget w;
XlwMenuResize (Widget w)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
@ -2315,9 +2214,7 @@ XlwMenuResize (w)
/* Action procedures */
static void
handle_single_motion_event (mw, ev)
XlwMenuWidget mw;
XMotionEvent* ev;
handle_single_motion_event (XlwMenuWidget mw, XMotionEvent *ev)
{
widget_value* val;
int level;
@ -2333,9 +2230,7 @@ handle_single_motion_event (mw, ev)
}
static void
handle_motion_event (mw, ev)
XlwMenuWidget mw;
XMotionEvent* ev;
handle_motion_event (XlwMenuWidget mw, XMotionEvent *ev)
{
int x = ev->x_root;
int y = ev->y_root;
@ -2357,11 +2252,7 @@ handle_motion_event (mw, ev)
}
static void
Start (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Start (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
@ -2394,11 +2285,7 @@ Start (w, ev, params, num_params)
}
static void
Drag (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Drag (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
if (mw->menu.popped_up)
@ -2408,19 +2295,12 @@ Drag (w, ev, params, num_params)
/* Do nothing.
This is how we handle presses and releases of modifier keys. */
static void
Nothing (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Nothing (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
}
static widget_value *
find_first_selectable (mw, item, skip_titles)
XlwMenuWidget mw;
widget_value *item;
int skip_titles;
find_first_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
{
widget_value *current = item;
enum menu_separator separator;
@ -2436,10 +2316,7 @@ find_first_selectable (mw, item, skip_titles)
}
static widget_value *
find_next_selectable (mw, item, skip_titles)
XlwMenuWidget mw;
widget_value *item;
int skip_titles;
find_next_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
{
widget_value *current = item;
enum menu_separator separator;
@ -2473,10 +2350,7 @@ find_next_selectable (mw, item, skip_titles)
}
static widget_value *
find_prev_selectable (mw, item, skip_titles)
XlwMenuWidget mw;
widget_value *item;
int skip_titles;
find_prev_selectable (XlwMenuWidget mw, widget_value *item, int skip_titles)
{
widget_value *current = item;
widget_value *prev = item;
@ -2493,11 +2367,7 @@ find_prev_selectable (mw, item, skip_titles)
}
static void
Down (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Down (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget) w;
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
@ -2522,11 +2392,7 @@ Down (w, ev, params, num_params)
}
static void
Up (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Up (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget) w;
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
@ -2562,11 +2428,7 @@ Up (w, ev, params, num_params)
}
void
Left (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Left (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget) w;
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
@ -2602,11 +2464,7 @@ Left (w, ev, params, num_params)
}
void
Right (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Right (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget) w;
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
@ -2642,11 +2500,7 @@ Right (w, ev, params, num_params)
/* Handle key press and release events while menu is popped up.
Our action is to get rid of the menu. */
static void
Key (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Key (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
@ -2672,11 +2526,7 @@ Key (w, ev, params, num_params)
}
static void
Select (w, ev, params, num_params)
Widget w;
XEvent *ev;
String *params;
Cardinal *num_params;
Select (Widget w, XEvent *ev, String *params, Cardinal *num_params)
{
XlwMenuWidget mw = (XlwMenuWidget)w;
widget_value* selected_item = mw->menu.old_stack [mw->menu.old_depth - 1];
@ -2715,9 +2565,7 @@ Select (w, ev, params, num_params)
/* Special code to pop-up a menu */
static void
pop_up_menu (mw, event)
XlwMenuWidget mw;
XButtonPressedEvent* event;
pop_up_menu (XlwMenuWidget mw, XButtonPressedEvent *event)
{
int x = event->x_root;
int y = event->y_root;

View file

@ -1,3 +1,17 @@
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* sed1v2.inp: Remove reference to prefix-args.
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1.
(HAVE_BZERO): Don't edit.
2010-07-02 Eli Zaretskii <eliz@gnu.org>
* sed1v2.inp (LIB_GCC): Edit to empty.
Return back to ../src after compiling each .el file.
2010-06-30 Glenn Morris <rgm@gnu.org>
* sed1v2.inp (CANNOT_DUMP): Update for configure name change.

View file

@ -47,7 +47,7 @@ s/\.h\.in/.h-in/
/^LD_SWITCH_SYSTEM *=/s/@LD_SWITCH_SYSTEM@//
/^TEMACS_LDFLAGS2 *=/s/@TEMACS_LDFLAGS2@/$(LDFLAGS)/
/^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@//
/^LIB_GCC *=/s/@LIB_GCC@/-Lgcc/
/^LIB_GCC *=/s/@LIB_GCC@//
/^LD *=/s/@LINKER@/$(CC)/
/^LIB_STANDARD *=/s/@LIB_STANDARD@//
/^LIB_MATH *=/s/@LIB_MATH@/-lm/
@ -128,7 +128,6 @@ s/\.h\.in/.h-in/
/^[ ]*$/d
/^ if test -f/,/^ fi$/c\
command.com /c if exist .gdbinit rm -f _gdbinit
/^temacs:/s/prefix-args//
/^temacs:/s/stamp-oldxmenu//
/^ if test "\${CANNOT_DUMP}" =/,/^ else /d
/^ fi/d
@ -169,6 +168,7 @@ s/echo.*buildobj.lst/dj&/
djecho bootlisp > bootlisp
/^ -\{0,1\}rm -f/s/\\#/#/
/^ @\{0,1\}cd ..\/lisp;.*[^\]$/s|$|\; cd ../src|
/^ *THEFILE=/s|$|\; cd ../src|
/^ echo.* buildobj.h/s|echo |djecho |
# arch-tag: c7e3aacb-4162-460e-99f9-4252bca68d2c

View file

@ -38,6 +38,8 @@
/^#undef HAVE_CBRT *$/s/^.*$/#define HAVE_CBRT 1/
/^#undef HAVE_DIFFTIME *$/s/^.*$/#define HAVE_DIFFTIME 1/
/^#undef HAVE_FPATHCONF *$/s/^.*$/#define HAVE_FPATHCONF 1/
/^#undef HAVE_MEMCPY *$/s/^.*$/#define HAVE_MEMCPY 1/
/^#undef HAVE_MEMSET *$/s/^.*$/#define HAVE_MEMSET 1/
/^#undef HAVE_MEMCMP *$/s/^.*$/#define HAVE_MEMCMP 1/
/^#undef HAVE_MEMMOVE *$/s/^.*$/#define HAVE_MEMMOVE 1/
/^#undef HAVE_SETRLIMIT *$/s/^.*$/#define HAVE_SETRLIMIT 1/
@ -84,14 +86,6 @@ s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/
#else\
#undef HAVE_STDINT_H\
#endif
# GCC 3.x has a built-in bzero, which conflicts with the define at
# the end of config.in
/^#undef HAVE_BZERO/c\
#if __GNUC__ >= 3\
#define HAVE_BZERO 1\
#else\
#undef HAVE_BZERO\
#endif
# Comment out any remaining undef directives, because some of them
# might be defined in sys/config.h we include at the top of config.h.

View file

@ -1,3 +1,12 @@
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs.
(HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs.
2010-07-02 Juanma Barranquero <lekktu@gmail.com>
* config.nt (__P): Remove.
2010-06-06 Dan Nicolaescu <dann@ics.uci.edu>
* config.nt: Remove code depending on BSTRING.

View file

@ -212,8 +212,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef HAVE_SYSINFO
#undef HAVE_RANDOM
#undef HAVE_LRAND48
#undef HAVE_BCOPY
#undef HAVE_BCMP
#undef HAVE_MEMCPY
#undef HAVE_MEMMOVE
#undef HAVE_MEMSET
#undef HAVE_MEMCMP
#undef HAVE_LOGB
#undef HAVE_FREXP
#undef HAVE_FMOD
@ -393,14 +395,6 @@ extern char *getenv ();
#define PROTOTYPES 1
#endif
#ifndef __P
#if defined PROTOTYPES
#define __P(args) args
#else
#define __P(args) ()
#endif
#endif
#ifdef HAVE_STRING_H
#include "string.h"
#endif

View file

@ -103,32 +103,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* For debug, set this to 0 to not grab the keyboard on menu popup */
int x_menu_grab_keyboard = 1;
typedef void (*Wait_func)();
static Wait_func wait_func;
static void* wait_data;
void
XMenuActivateSetWaitFunction (func, data)
Wait_func func;
void *data;
XMenuActivateSetWaitFunction (Wait_func func, void *data)
{
wait_func = func;
wait_data = data;
}
int
XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
help_callback)
register Display *display; /* Display to put menu on. */
register XMenu *menu; /* Menu to activate. */
int *p_num; /* Pane number selected. */
int *s_num; /* Selection number selected. */
int x_pos; /* X coordinate of menu position. */
int y_pos; /* Y coordinate of menu position. */
unsigned int event_mask; /* Mouse button event mask. */
char **data; /* Pointer to return data value. */
void (* help_callback) (); /* Help callback. */
XMenuActivate(
register Display *display, /* Display to put menu on. */
register XMenu *menu, /* Menu to activate. */
int *p_num, /* Pane number selected. */
int *s_num, /* Selection number selected. */
int x_pos, /* X coordinate of menu position. */
int y_pos, /* Y coordinate of menu position. */
unsigned int event_mask, /* Mouse button event mask. */
char **data, /* Pointer to return data value. */
void (* help_callback) (char *, int, int)) /* Help callback. */
{
int status; /* X routine call status. */
int orig_x; /* Upper left menu origin X coord. */

View file

@ -16,11 +16,11 @@
#include "XMenuInt.h"
int
XMenuAddPane(display, menu, label, active)
Display *display;
register XMenu *menu; /* Menu object to be modified. */
register char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active)
/* Menu object to be modified. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *pane; /* Newly created pane. */
register XMSelect *select; /* Initial selection for the new pane. */

View file

@ -17,14 +17,14 @@
#include "XMenuInt.h"
int
XMenuAddSelection(display, menu, p_num, data, label, active, help)
Display *display;
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
char *data; /* Data value. */
char *label; /* Selection label. */
int active; /* Make selection active? */
char *help; /* Help string */
XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Data value. */
/* Selection label. */
/* Make selection active? */
/* Help string */
{
register XMPane *pane; /* Pane containing the new selection. */
register XMSelect *select; /* Newly created selection. */

View file

@ -1,3 +1,38 @@
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* Activate.c: Convert function definitions to standard C.
* AddPane.c:
* AddSel.c:
* ChgPane.c:
* ChgSel.c:
* Create.c:
* DelPane.c:
* DelSel.c:
* Destroy.c:
* Error.c:
* EvHand.c:
* FindPane.c:
* FindSel.c:
* InsPane.c:
* InsSel.c:
* Internal.c:
* Locate.c:
* Post.c:
* Recomp.c:
* SetAEQ.c:
* SetFrz.c:
* SetPane.c:
* SetSel.c:
* X10.h:
* XCrAssoc.c:
* XDelAssoc.c:
* XDestAssoc.c:
* XLookAssoc.c:
* XMakeAssoc.c:
* XMenu.h:
* XMenuInt.h:
* insque.c: Likewise.
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.

View file

@ -17,10 +17,10 @@
#include "XMenuInt.h"
int
XMenuChangePane(menu, p_num, label)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
char *label; /* Selection label. */
XMenuChangePane(register XMenu *menu, register int p_num, char *label)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection label. */
{
register XMPane *p_ptr; /* XMPane pointer. */

View file

@ -17,15 +17,15 @@
#include "XMenuInt.h"
int
XMenuChangeSelection(display, menu, p_num, s_num, data, data_sw, label, label_sw)
Display *display; /* previously opened display. */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int s_num; /* Selection number to modified. */
char *data; /* Data value. */
int data_sw; /* Change to new data value? */
char *label; /* Selection label. */
int label_sw; /* Change to new label? */
XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw)
/* previously opened display. */
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection number to modified. */
/* Data value. */
/* Change to new data value? */
/* Selection label. */
/* Change to new label? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */

View file

@ -91,19 +91,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define TILE_BUF_SIZE 5
int atoi();
double atof();
char *x_get_resource_string ();
int atoi(const char *);
double atof(const char *);
char *x_get_resource_string (char *attribute, char *class);
static Status
XAllocDisplayColor(display, map, colorName, color, junk)
Display *display;
Colormap map;
char *colorName;
XColor *color;
XColor *junk;
XAllocDisplayColor(Display *display, Colormap map, char *colorName, XColor *color, XColor *junk)
{
return (colorName!=0 &&
XParseColor(display, map, colorName, color) &&
@ -112,10 +107,10 @@ XAllocDisplayColor(display, map, colorName, color, junk)
XMenu *
XMenuCreate(display, parent, def_env)
Display *display; /* ID of previously opened display */
Window parent; /* Window ID of the menu's parent window. */
register char *def_env; /* X Defaults program environment name. */
XMenuCreate(Display *display, Window parent, register char *def_env)
/* ID of previously opened display */
/* Window ID of the menu's parent window. */
/* X Defaults program environment name. */
{
register int i; /* Loop counter. */
register int j; /* Loop counter. */

View file

@ -16,10 +16,10 @@
#include "XMenuInt.h"
int
XMenuDeletePane(display, menu, p_num)
register Display *display; /* Previously opened display */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be deleted. */
XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num)
/* Previously opened display */
/* Menu object to be modified. */
/* Pane number to be deleted. */
{
register XMPane *p_ptr; /* Pointer to pane being deleted. */
register XMSelect *s_ptr; /* Pointer to selections being deleted. */

View file

@ -16,11 +16,11 @@
#include "XMenuInt.h"
int
XMenuDeleteSelection(display, menu, p_num, s_num)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be deleted. */
register int s_num; /* Selection number to be deleted. */
XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num)
/* Previously opened display. */
/* Menu object to be modified. */
/* Pane number to be deleted. */
/* Selection number to be deleted. */
{
register XMPane *p_ptr; /* Pointer to pane being deleted. */
register XMSelect *s_ptr; /* Pointer to selections being deleted. */

View file

@ -15,9 +15,9 @@
#include "XMenuInt.h"
XMenuDestroy(display, menu)
Display *display;
register XMenu *menu; /* Menu object to destroy. */
XMenuDestroy(Display *display, register XMenu *menu)
/* Menu object to destroy. */
{
register XMPane *p_ptr; /* Pointer to the current pane. */
register XMPane *p_next; /* Pointer to the next pane. */

View file

@ -17,7 +17,7 @@
#include "XMenuInt.h"
char *
XMenuError()
XMenuError(void)
{
static char message[128]; /* Error message buffer. */

View file

@ -15,8 +15,7 @@
#include "XMenuInt.h"
XMenuEventHandler(handler)
int (*handler)();
XMenuEventHandler(int (*handler) (XEvent*))
{
/*
* Set the global event handler variable.

View file

@ -17,9 +17,7 @@
#include "XMenuInt.h"
int
XMenuFindPane(menu, label)
register XMenu *menu;
register char *label;
XMenuFindPane(register XMenu *menu, register char *label)
{
register XMPane *p_ptr;
register int i = 0;

View file

@ -34,10 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "XMenuInt.h"
int
XMenuFindSelection(menu, p_num, label)
register XMenu *menu;
int p_num;
register char *label;
XMenuFindSelection(register XMenu *menu, int p_num, register char *label)
{
register XMPane *p_ptr;
register XMSelect *s_ptr;

View file

@ -18,11 +18,11 @@
#include "XMenuInt.h"
int
XMenuInsertPane(menu, p_num, label, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number of new pane. */
char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active)
/* Menu object to be modified. */
/* Pane number of new pane. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMPane *pane; /* Newly created pane. */

View file

@ -17,13 +17,13 @@
#include "XMenuInt.h"
int
XMenuInsertSelection(menu, p_num, s_num, data, label, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int s_num; /* Selection number of new selection. */
char *data; /* Data value. */
char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection number of new selection. */
/* Data value. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */

View file

@ -96,7 +96,7 @@ _XMErrorList[XME_CODE_COUNT] = {
/*
* _XMEventHandler - Internal event handler variable.
*/
int (*_XMEventHandler)() = NULL;
int (*_XMEventHandler)(XEvent*) = NULL;
@ -104,7 +104,7 @@ int (*_XMEventHandler)() = NULL;
* _XMWinQueInit - Internal routine to initialize the window
* queue.
*/
_XMWinQueInit()
_XMWinQueInit(void)
{
/*
* If the queue is not initialized initialize it.
@ -138,10 +138,10 @@ _XMWinQueInit()
* window queue.
*/
int
_XMWinQueAddPane(display, menu, p_ptr)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMPane *p_ptr; /* XMPane being queued. */
_XMWinQueAddPane(register Display *display, register XMenu *menu, register XMPane *p_ptr)
/* Menu being manipulated. */
/* XMPane being queued. */
{
/*
* If the queue is currently full then flush it.
@ -172,10 +172,10 @@ _XMWinQueAddPane(display, menu, p_ptr)
* the selection window queue.
*/
int
_XMWinQueAddSelection(display, menu, s_ptr)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMSelect *s_ptr; /* XMSelection being queued. */
_XMWinQueAddSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr)
/* Menu being manipulated. */
/* XMSelection being queued. */
{
/*
* If this entry will overflow the queue then flush it.
@ -206,10 +206,10 @@ _XMWinQueAddSelection(display, menu, s_ptr)
* selection window queues.
*/
int
_XMWinQueFlush(display, menu, pane, select)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMPane *pane; /* Current pane. */
_XMWinQueFlush(register Display *display, register XMenu *menu, register XMPane *pane, XMSelect *select)
/* Menu being manipulated. */
/* Current pane. */
{
register int pq_index; /* Pane queue index. */
register int sq_index; /* Selection queue index. */
@ -346,9 +346,9 @@ _XMWinQueFlush(display, menu, pane, select)
* a pane pointer that points to the indexed pane.
*/
XMPane *
_XMGetPanePtr(menu, p_num)
register XMenu *menu; /* Menu to find the pane in. */
register int p_num; /* Index number of pane to find. */
_XMGetPanePtr(register XMenu *menu, register int p_num)
/* Menu to find the pane in. */
/* Index number of pane to find. */
{
register XMPane *p_ptr; /* Pane pointer to be returned. */
register int i; /* Loop counter. */
@ -382,9 +382,9 @@ _XMGetPanePtr(menu, p_num)
* indexed selection.
*/
XMSelect *
_XMGetSelectionPtr(p_ptr, s_num)
register XMPane *p_ptr; /* Pane to find the selection in. */
register int s_num; /* Index number of the selection to find. */
_XMGetSelectionPtr(register XMPane *p_ptr, register int s_num)
/* Pane to find the selection in. */
/* Index number of the selection to find. */
{
register XMSelect *s_ptr; /* Selection pointer to be returned. */
register int i; /* Loop counter. */
@ -416,9 +416,9 @@ _XMGetSelectionPtr(p_ptr, s_num)
* _XMRecomputeGlobals - Internal subroutine to recompute menu wide
* global values.
*/
_XMRecomputeGlobals(display, menu)
register Display *display; /*X11 display variable. */
register XMenu *menu; /* Menu object to compute from. */
_XMRecomputeGlobals(register Display *display, register XMenu *menu)
/*X11 display variable. */
/* Menu object to compute from. */
{
register XMPane *p_ptr; /* Pane pointer. */
register XMSelect *s_ptr; /* Selection pointer. */
@ -531,11 +531,11 @@ _XMRecomputeGlobals(display, menu)
* window dependencies.
*/
int
_XMRecomputePane(display, menu, p_ptr, p_num)
register Display *display; /* Standard X display variable. */
register XMenu *menu; /* Menu object being recomputed. */
register XMPane *p_ptr; /* Pane pointer. */
register int p_num; /* Pane sequence number. */
_XMRecomputePane(register Display *display, register XMenu *menu, register XMPane *p_ptr, register int p_num)
/* Standard X display variable. */
/* Menu object being recomputed. */
/* Pane pointer. */
/* Pane sequence number. */
{
register int window_x; /* Recomputed window X coordinate. */
register int window_y; /* Recomputed window Y coordinate. */
@ -681,11 +681,11 @@ _XMRecomputePane(display, menu, p_ptr, p_num)
* selection window dependencies.
*/
int
_XMRecomputeSelection(display, menu, s_ptr, s_num)
register Display *display;
register XMenu *menu; /* Menu object being recomputed. */
register XMSelect *s_ptr; /* Selection pointer. */
register int s_num; /* Selection sequence number. */
_XMRecomputeSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr, register int s_num)
/* Menu object being recomputed. */
/* Selection pointer. */
/* Selection sequence number. */
{
register Bool config_s = False; /* Reconfigure selection window? */
XWindowChanges *changes; /* Values to change in configure. */
@ -811,15 +811,15 @@ _XMRecomputeSelection(display, menu, s_ptr, s_num)
* recomputed before calling this routine or
* unpredictable results will follow.
*/
_XMTransToOrigin(display, menu, p_ptr, s_ptr, x_pos, y_pos, orig_x, orig_y)
Display *display; /* Not used. Included for consistency. */
register XMenu *menu; /* Menu being computed against. */
register XMPane *p_ptr; /* Current pane pointer. */
register XMSelect *s_ptr; /* Current selection pointer. */
int x_pos; /* X coordinate of point to translate. */
int y_pos; /* Y coordinate of point to translate. */
int *orig_x; /* Return value X coord. of the menu origin. */
int *orig_y; /* Return value Y coord. of the menu origin. */
_XMTransToOrigin(Display *display, register XMenu *menu, register XMPane *p_ptr, register XMSelect *s_ptr, int x_pos, int y_pos, int *orig_x, int *orig_y)
/* Not used. Included for consistency. */
/* Menu being computed against. */
/* Current pane pointer. */
/* Current selection pointer. */
/* X coordinate of point to translate. */
/* Y coordinate of point to translate. */
/* Return value X coord. of the menu origin. */
/* Return value Y coord. of the menu origin. */
{
register int l_orig_x; /* Local X coordinate of the menu origin. */
register int l_orig_y; /* Local Y coordinate of the menu origin. */
@ -871,10 +871,7 @@ _XMTransToOrigin(display, menu, p_ptr, s_ptr, x_pos, y_pos, orig_x, orig_y)
* _XMRefreshPane - Internal subroutine to completely refresh
* the contents of a pane.
*/
_XMRefreshPane(display, menu, pane)
register Display *display;
register XMenu *menu;
register XMPane *pane;
_XMRefreshPane(register Display *display, register XMenu *menu, register XMPane *pane)
{
register XMSelect *s_list = pane->s_list;
register XMSelect *s_ptr;
@ -941,10 +938,7 @@ _XMRefreshPane(display, menu, pane)
* _XMRefreshSelection - Internal subroutine that refreshes
* a single selection window.
*/
_XMRefreshSelection(display, menu, select)
register Display *display;
register XMenu *menu;
register XMSelect *select;
_XMRefreshSelection(register Display *display, register XMenu *menu, register XMSelect *select)
{
register int width = select->window_w;
register int height = select->window_h;

View file

@ -17,17 +17,17 @@
#include "XMenuInt.h"
int
XMenuLocate(display, menu, p_num, s_num, x_pos, y_pos, ul_x, ul_y, width, height)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu object being located. */
int p_num; /* Active pane number. */
int s_num; /* Active selection number. */
int x_pos; /* X coordinate of mouse active position. */
int y_pos; /* Y coordinate of mouse active position. */
int *ul_x; /* Returned upper left menu X coordinate. */
int *ul_y; /* Returned upper left menu Y coordinate. */
int *width; /* Returned menu width. */
int *height; /* Returned menu height. */
XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height)
/* Previously opened display. */
/* Menu object being located. */
/* Active pane number. */
/* Active selection number. */
/* X coordinate of mouse active position. */
/* Y coordinate of mouse active position. */
/* Returned upper left menu X coordinate. */
/* Returned upper left menu Y coordinate. */
/* Returned menu width. */
/* Returned menu height. */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */

View file

@ -39,14 +39,14 @@
#include "XMenuInt.h"
char *
XMenuPost(display, menu, p_num, s_num, x_pos, y_pos, event_mask)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu to post. */
register int *p_num; /* Pane number selected. */
register int *s_num; /* Selection number selected. */
register int x_pos; /* X coordinate of menu position. */
register int y_pos; /* Y coordinate of menu position. */
int event_mask; /* Mouse button event mask. */
XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask)
/* Previously opened display. */
/* Menu to post. */
/* Pane number selected. */
/* Selection number selected. */
/* X coordinate of menu position. */
/* Y coordinate of menu position. */
/* Mouse button event mask. */
{
register int stat; /* Routine call return status. */
char *data; /* Return data. */

View file

@ -16,9 +16,9 @@
#include "XMenuInt.h"
int
XMenuRecompute(display, menu)
Display *display;
register XMenu *menu; /* Menu object to be recomputed. */
XMenuRecompute(Display *display, register XMenu *menu)
/* Menu object to be recomputed. */
{
register XMPane *p_ptr; /* Pane pointer. */
register XMSelect *s_ptr; /* Selection pointer. */

View file

@ -18,9 +18,9 @@
#include "XMenuInt.h"
XMenuSetAEQ(menu, aeq)
register XMenu *menu; /* Menu object to be modified. */
register int aeq; /* AEQ mode? */
XMenuSetAEQ(register XMenu *menu, register int aeq)
/* Menu object to be modified. */
/* AEQ mode? */
{
/*
* Set the AEQ mode switch.

View file

@ -17,9 +17,9 @@
#include "XMenuInt.h"
XMenuSetFreeze(menu, freeze)
register XMenu *menu; /* Menu object to be modified. */
register int freeze; /* Freeze mode? */
XMenuSetFreeze(register XMenu *menu, register int freeze)
/* Menu object to be modified. */
/* Freeze mode? */
{
/*
* Set the freeze mode switch.

View file

@ -16,10 +16,10 @@
#include "XMenuInt.h"
int
XMenuSetPane(menu, p_num, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int active; /* Make selection active? */
XMenuSetPane(register XMenu *menu, register int p_num, register int active)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */

View file

@ -16,11 +16,11 @@
#include "XMenuInt.h"
int
XMenuSetSelection(menu, p_num, s_num, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int s_num; /* Selection number to modified. */
int active; /* Make selection active? */
XMenuSetSelection(register XMenu *menu, register int p_num, register int s_num, int active)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection number to modified. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */

View file

@ -71,8 +71,8 @@ typedef struct {
int size; /* Table size (number of buckets). */
} XAssocTable;
XAssocTable *XCreateAssocTable();
char *XLookUpAssoc();
XAssocTable *XCreateAssocTable(int size);
char *XLookUpAssoc(Display *dpy, XAssocTable *table, XID x_id);
#endif /* _X10_H_ */

View file

@ -11,8 +11,6 @@
#define NULL 0
#endif
extern int errno;
/*
* XCreateAssocTable - Create an XAssocTable. The size argument should be
* a power of two for efficiency reasons. Some size suggestions: use 32
@ -20,8 +18,8 @@ extern int errno;
* buckets is 8. If there is an error creating the XAssocTable, a NULL
* pointer is returned.
*/
XAssocTable *XCreateAssocTable(size)
register int size; /* Desired size of the table. */
XAssocTable *XCreateAssocTable(register int size)
/* Desired size of the table. */
{
register XAssocTable *table; /* XAssocTable to be initialized. */
register XAssoc *buckets; /* Pointer to the first bucket in */

View file

@ -5,22 +5,19 @@
#include <X11/Xlib.h>
#include "X10.h"
void emacs_remque();
struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
char q_data[1];
};
void emacs_remque(struct qelem*);
/*
* XDeleteAssoc - Delete an association in an XAssocTable keyed on
* an XId. An association may be removed only once. Redundant
* deletes are meaningless (but cause no problems).
*/
XDeleteAssoc(dpy, table, x_id)
register Display *dpy;
register XAssocTable *table;
register XID x_id;
XDeleteAssoc(register Display *dpy, register XAssocTable *table, register XID x_id)
{
int hash;
register XAssoc *bucket;

View file

@ -10,8 +10,7 @@
* XDestroyAssocTable - Destroy (free the memory associated with)
* an XAssocTable.
*/
XDestroyAssocTable(table)
register XAssocTable *table;
XDestroyAssocTable(register XAssocTable *table)
{
register int i;
register XAssoc *bucket;

View file

@ -18,10 +18,10 @@
* in the table the routine will return a NULL pointer. All XId's are relative
* to the currently active Display.
*/
caddr_t XLookUpAssoc(dpy, table, x_id)
register Display *dpy;
register XAssocTable *table; /* XAssocTable to search in. */
register XID x_id; /* XId to search for. */
caddr_t XLookUpAssoc(register Display *dpy, register XAssocTable *table, register XID x_id)
/* XAssocTable to search in. */
/* XId to search for. */
{
int hash;
register XAssoc *bucket;

View file

@ -13,25 +13,20 @@
#define NULL 0
#endif
extern int errno;
void emacs_insque();
struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
char q_data[1];
};
void emacs_insque (struct qelem *elem, struct qelem *prev);
/*
* XMakeAssoc - Insert data into an XAssocTable keyed on an XId.
* Data is inserted into the table only once. Redundant inserts are
* meaningless (but cause no problems). The queue in each association
* bucket is sorted (lowest XId to highest XId).
*/
XMakeAssoc(dpy, table, x_id, data)
register Display *dpy;
register XAssocTable *table;
register XID x_id;
register caddr_t data;
XMakeAssoc(register Display *dpy, register XAssocTable *table, register XID x_id, register caddr_t data)
{
int hash;
register XAssoc *bucket;

View file

@ -234,31 +234,33 @@ typedef struct _xmenu {
Pixmap inact_pixmap; /* Menu inactive pixmap. */
} XMenu;
typedef void (*Wait_func)(void*);
/*
* XMenu library routine declarations.
*/
XMenu *XMenuCreate();
int XMenuAddPane();
int XMenuAddSelection();
int XMenuInsertPane();
int XMenuInsertSelection();
int XMenuFindPane();
int XMenuFindSelection();
int XMenuChangePane();
int XMenuChangeSelection();
int XMenuSetPane();
int XMenuSetSelection();
int XMenuRecompute();
int XMenuEventHandler(); /* No value actually returned. */
int XMenuLocate();
int XMenuSetFreeze(); /* No value actually returned. */
void XMenuActivateSetWaitFunction();
int XMenuActivate();
char *XMenuPost();
int XMenuDeletePane();
int XMenuDeleteSelection();
int XMenuDestroy(); /* No value actually returned. */
char *XMenuError();
XMenu *XMenuCreate(Display *display, Window parent, register char *def_env);
int XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active);
int XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char *help);
int XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active);
int XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active);
int XMenuFindPane(register XMenu *menu, register char *label);
int XMenuFindSelection(register XMenu *menu, int p_num, register char *label);
int XMenuChangePane(register XMenu *menu, register int p_num, char *label);
int XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw);
int XMenuSetPane(register XMenu *menu, register int p_num, register int active);
int XMenuSetSelection(register XMenu *menu, register int p_num, register int s_num, int active);
int XMenuRecompute(Display *display, register XMenu *menu);
int XMenuEventHandler(int (*handler) (XEvent *)); /* No value actually returned. */
int XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height);
int XMenuSetFreeze(register XMenu *menu, register int freeze); /* No value actually returned. */
void XMenuActivateSetWaitFunction(Wait_func func, void *data);
int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char *, int, int));
char *XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask);
int XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num);
int XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num);
int XMenuDestroy(Display *display, register XMenu *menu); /* No value actually returned. */
char *XMenuError(void);
#endif
/* Don't add after this point. */

View file

@ -37,7 +37,7 @@
/*
* XMenu internal event handler variable.
*/
extern int (*_XMEventHandler)();
extern int (*_XMEventHandler)(XEvent*);
#ifndef Pixel
#define Pixel unsigned long
@ -46,19 +46,17 @@ extern int (*_XMEventHandler)();
/*
* Internal routine declarations.
*/
int _XMWinQueInit(); /* No value actually returned. */
int _XMWinQueAddPane();
int _XMWinQueAddSelection();
int _XMWinQueFlush();
XMPane *_XMGetPanePtr();
XMSelect *_XMGetSelectionPtr();
int _XMRecomputeGlobals(); /* No value actually returned. */
int _XMRecomputePane();
int _XMRecomputeSelection();
int _XMTransToOrigin(); /* No value actually returned. */
int _XMRefreshPane(); /* No value actually returned. */
int _XMRefreshSelections(); /* No value actually returned. */
int _XMHighlightSelection(); /* No value actually returned. */
int _XMWinQueInit(void); /* No value actually returned. */
int _XMWinQueAddPane(register Display *display, register XMenu *menu, register XMPane *p_ptr);
int _XMWinQueAddSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr);
int _XMWinQueFlush(register Display *display, register XMenu *menu, register XMPane *pane, XMSelect *select);
XMPane *_XMGetPanePtr(register XMenu *menu, register int p_num);
XMSelect *_XMGetSelectionPtr(register XMPane *p_ptr, register int s_num);
int _XMRecomputeGlobals(register Display *display, register XMenu *menu); /* No value actually returned. */
int _XMRecomputePane(register Display *display, register XMenu *menu, register XMPane *p_ptr, register int p_num);
int _XMRecomputeSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr, register int s_num);
int _XMTransToOrigin(Display *display, register XMenu *menu, register XMPane *p_ptr, register XMSelect *s_ptr, int x_pos, int y_pos, int *orig_x, int *orig_y); /* No value actually returned. */
int _XMRefreshPane(register Display *display, register XMenu *menu, register XMPane *pane); /* No value actually returned. */
#endif
/* Don't add stuff after this #endif */

View file

@ -30,8 +30,7 @@ struct qelem {
/* Insert ELEM into a doubly-linked list, after PREV. */
void
emacs_insque (elem, prev)
struct qelem *elem, *prev;
emacs_insque (struct qelem *elem, struct qelem *prev)
{
struct qelem *next = prev->q_forw;
prev->q_forw = elem;
@ -43,8 +42,7 @@ emacs_insque (elem, prev)
/* Unlink ELEM from the doubly-linked list that it is in. */
emacs_remque (elem)
struct qelem *elem;
emacs_remque (struct qelem *elem)
{
struct qelem *next = elem->q_forw;
struct qelem *prev = elem->q_back;

View file

@ -1,3 +1,676 @@
2010-07-08 Dan Nicolaescu <dann@ics.uci.edu>
* xdisp.c (store_mode_line_noprop_char): Remove K&R alternative declaration.
Clean up include guards.
* tparam.c: Remove include guards for config.h, string.h and code
that assumes #ifndef emacs.
* termcap.c:
* unexalpha.c:
* sysdep.c:
* filemode.c:
* filelock.c:
* bidi.c: Likewise.
Remove prefix-args.c
* prefix-args.c: Remove file.
* autodeps.mk (ALLOBJS): Remove reference to prefix-args.
* Makefile.in (temacs${EXEEXT}): Remove references to
PRE_EDIT_LDFLAGS and POST_EDIT_LDFLAGS.
(mostlyclean): Remove reference to prefix-args.
(prefix-args): Remove.
Simplify cstart_of_data, start_of_code and related code.
* mem-limits.h: Remove !emacs and _LIBC conditional code.
(start_of_data): Merge into start_of_data function.
* sysdep.c (start_of_text): Remove. Move simplified versions of
it in the only users: unexaix.c and unexec.c.
(read_input_waiting): Remove local declaration of quit_char.
(start, etext): Remove declarations.
(start_of_data): Merge with the version in mem-limits.h and move
to vm-limits.c.
* vm-limit.c (start_of_data): Merged and simplified version of the
code formerly in mem-limits.h and sysdep.c.
* unexec.c (start): New declaration, moved from sysdep.c.
(start_of_text): Simplified version of the code formerly in sysdep.c.
* unexaix.c (start_of_text): Simplified version of the code
formerly in sysdep.c.
* m/alpha.h (HAVE_TEXT_START): Remove.
(TEXT_START): Move ...
* unexalpha.c (TEXT_START): ... here.
* s/hpux10-20.h (TEXT_START): Remove.
* s/darwin.h (TEXT_START):
* m/mips.h (TEXT_START):
* m/macppc.h (HAVE_TEXT_START):
* m/m68k.h (TEXT_START):
* m/iris4d.h (TEXT_START):
* m/intel386.h (TEXT_START):
* m/ibmrs6000.h (TEXT_START):
* m/ia64.h (HAVE_TEXT_START):
* s/msdos.h (TEXT_START): Likewise.
2010-07-07 Andreas Schwab <schwab@linux-m68k.org>
* alloc.c (overrun_check_malloc, overrun_check_realloc)
(overrun_check_free, xstrdup, allocate_string)
(allocate_string_data, compact_small_strings, Fmake_string)
(make_unibyte_string, make_multibyte_string)
(make_string_from_bytes, make_specified_string, make_float)
(Fcons, allocate_terminal, allocate_frame, make_pure_string)
(Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
memcpy, memmove, memset, memcmp.
* atimer.c (start_atimer, set_alarm): Likewise.
* buffer.c (clone_per_buffer_values, report_overlay_modification)
(mmap_realloc, init_buffer_once): Likewise.
* callint.c (Fcall_interactively): Likewise.
* callproc.c (Fcall_process, Fcall_process_region, child_setup)
(getenv_internal_1): Likewise.
* casefiddle.c (casify_object): Likewise.
* ccl.c (ccl_driver): Likewise.
* character.c (str_as_multibyte, str_to_multibyte): Likewise.
* charset.c (load_charset_map_from_file)
(load_charset_map_from_file, load_charset_map_from_vector)
(Fdefine_charset_internal): Likewise.
* cm.c (Wcm_clear): Likewise.
* coding.c (decode_eol, decode_coding_object)
(Fset_coding_system_priority, make_subsidiaries): Likewise.
* data.c (Faset): Likewise.
* dired.c (directory_files_internal, file_name_completion_stat):
Likewise.
* dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
(clear_glyph_row, copy_row_except_pointers)
(copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
(save_current_matrix, restore_current_matrix)
(build_frame_matrix_from_leaf_window, mirrored_line_dance)
(mirror_line_dance, scrolling_window): Likewise.
* doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (Fuser_full_name, make_buffer_string_both)
(Fmessage_box, Fformat, Ftranspose_regions): Likewise.
* emacs.c (sort_args): Likewise.
* eval.c (Fapply, Ffuncall): Likewise.
* fileio.c (Ffile_name_directory, make_temp_name)
(Fexpand_file_name, search_embedded_absfilename)
(Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
(auto_save_error): Likewise.
* fns.c (Fstring_equal, Fcopy_sequence, concat)
(string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
(internal_equal, Fclear_string, larger_vector, copy_hash_table)
(Fmake_hash_table): Likewise.
* fringe.c (Fdefine_fringe_bitmap): Likewise.
* ftfont.c (ftfont_text_extents): Likewise.
* getloadavg.c (getloadavg): Likewise.
* image.c (define_image_type, make_image, make_image_cache)
(x_create_x_image_and_pixmap, xbm_image_p)
(w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
(xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
(init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
(png_image_p, png_read_from_memory, png_load, jpeg_image_p)
(tiff_image_p, tiff_read_from_memory, gif_image_p)
(gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
Likewise.
* indent.c (scan_for_column, compute_motion): Likewise.
* insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
(insert_1_both, insert_from_gap, replace_range_2): Likewise.
* intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
* keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
(kbd_buffer_store_event_hold, apply_modifiers_uncached)
(store_user_signal_events, menu_bar_items, tool_bar_items)
(process_tool_bar_item, append_tool_bar_item)
(read_char_minibuf_menu_prompt, read_key_sequence)
(Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
Likewise.
* keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
Likewise.
* lisp.h (STRING_COPYIN): Likewise.
* lread.c (Fload, read1, oblookup): Likewise.
* msdos.c (Frecent_doskeys): Likewise.
* nsfns.m (Fx_create_frame): Likewise.
* nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
Likewise.
* nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
(EmacsImage-initForXPMWithDepth:width:height:flip:length:):
Likewise.
* nsmenu.m (ns_update_menubar): Likewise.
* nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
* print.c (print_unwind, printchar, strout, print_string)
(print_error_message): Likewise.
* process.c (conv_lisp_to_sockaddr, set_socket_option)
(Fmake_network_process, Fnetwork_interface_list)
(Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
(init_process): Likewise.
* ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
* regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
Likewise.
* scroll.c (do_scrolling, do_direct_scrolling)
(scrolling_max_lines_saved): Likewise.
* search.c (search_buffer, wordify, Freplace_match): Likewise.
* sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
* syntax.c (skip_chars, skip_syntaxes): Likewise.
* sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
(emacs_set_tty): Likewise.
* term.c (encode_terminal_code, calculate_costs)
(produce_special_glyphs, create_tty_output, init_tty, delete_tty):
Likewise.
* termcap.c (tgetst1, gobble_line): Likewise.
* termhooks.h (EVENT_INIT): Likewise.
* tparam.c (tparam1): Likewise.
* unexalpha.c (unexec): Likewise.
* unexec.c (write_segment): Likewise.
* unexmacosx.c (unexec_write_zero): Likewise.
* w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
(Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
* w32font.c (w32font_list_family, w32font_text_extents)
(w32font_list_internal, w32font_match_internal)
(w32font_open_internal, compute_metrics, Fx_select_font):
Likewise.
* w32menu.c (set_frame_menubar, add_menu_item)
(w32_menu_display_help, w32_free_submenu_strings): Likewise.
* w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
* w32uniscribe.c (uniscribe_list_family): Likewise.
* w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
* window.c (make_window, replace_window, set_window_buffer)
(Fsplit_window): Likewise.
* xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
(add_to_log, message3, x_consider_frame_title)
(append_space_for_newline, extend_face_to_end_of_line)
(decode_mode_spec_coding, init_glyph_string): Likewise.
* xfaces.c (x_create_gc, get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, Finternal_merge_in_global_face)
(face_attr_equal_p, make_realized_face, make_face_cache)
(free_realized_faces, lookup_named_face, smaller_face)
(face_with_height, lookup_derived_face)
(x_supports_face_attributes_p, Finternal_set_font_selection_order)
(Finternal_set_font_selection_order, realize_default_face)
(compute_char_face, face_at_buffer_position)
(face_for_overlay_string, face_at_string_position, merge_faces):
Likewise.
* xfns.c (xic_create_fontsetname, Fx_create_frame)
(Fx_window_property, x_create_tip_frame)
(Fx_backspace_delete_keys_p): Likewise.
* xfont.c (xfont_list, xfont_match, xfont_list_family)
(xfont_text_extents): Likewise.
* xmenu.c (set_frame_menubar, xmenu_show): Likewise.
* xrdb.c (magic_file_p, x_get_resource): Likewise.
* xselect.c (x_queue_event, x_get_window_property)
(receive_incremental_selection): Likewise.
* xsmfns.c (x_session_check_input): Likewise.
* xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
(handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
Likewise.
* character.h (BCOPY_SHORT): Removed.
* config.in: Regenerate.
* dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
* emacs.c (main) [PROFILING]: Don't declare
dump_opcode_frequencies.
* lisp.h (safe_bcopy): Remove declaration.
(memset) [!HAVE_MEMSET]: Declare.
(memcpy) [!HAVE_MEMCPY]: Likewise.
(memmove) [!HAVE_MEMMOVE]: Likewise.
(memcmp) [!HAVE_MEMCMP]: Likewise.
* s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
(BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
Don't define.
(HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
* s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
(BCOPY_DOWNWARD_SAFE): Don't define.
* sysdep.c (memset) [!HAVE_MEMSET]: Define.
(memcpy) [!HAVE_MEMCPY]: Define.
(memmove) [!HAVE_MEMMOVE]: Define.
(memcmp) [!HAVE_MEMCMP]: Define.
2010-07-07 Jan Djärv <jan.h.d@swipnet.se>
* process.c (kbd_is_on_hold): New variable.
(hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p): New
functions.
(wait_reading_process_output): If kbd_on_hold_p returns non-zero,
select on empty input mask.
(init_process): Initialize kbd_is_on_hold to 0.
* process.h (hold_keyboard_input, unhold_keyboard_input)
(kbd_on_hold_p): Declare.
* keyboard.c (input_available_signal): Declare.
(kbd_buffer_nr_stored): New function.
(kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
(kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
(tty_read_avail_input): If input is on hold, return.
Don't read more that free slots in kbd_buffer (Bug#6571).
2010-07-07 Eli Zaretskii <eliz@gnu.org>
* msdos.h:
* msdos.c:
* dosfns.c:
* w16select.c: Convert function definitions to ANSI C.
* msdos.h (ctrl_break_func, install_ctrl_break_check): Remove
unused prototypes.
2010-07-07 Juanma Barranquero <lekktu@gmail.com>
* coding.c, sysdep.c: Convert some more functions to standard C.
2010-07-07 Juanma Barranquero <lekktu@gmail.com>
* coding.c (decode_coding_gap, encode_coding_gap, decode_coding_object)
(encode_coding_object): Use SPECPDL_INDEX.
(syms_of_coding): Use DOS_NT.
2010-07-07 Dan Nicolaescu <dann@ics.uci.edu>
* intervals.h (interval): Use EMACS_UINT instead of unsigned EMACS_INT.
Make the function member of Lisp_Subr use standard C prototypes.
* lisp.h (struct Lisp_Subr): Use a union for the function member.
(DECL_ALIGN): Add a cast for the function.
* eval.c (Feval, Ffuncall): Use the proper type for each type
function call.
2010-07-06 Chong Yidong <cyd@stupidchicken.com>
* fringe.c (draw_fringe_bitmap_1): Use lookup_named_face to get
fringe face id, so face-remapping-alist works (Bug#6091).
2010-07-06 Juanma Barranquero <lekktu@gmail.com>
* w32.c, w32console.c, w32fns.c, w32font.c, w32heap.c, w32inevt.c
* w32menu.c, w32proc.c, w32reg.c, w32select.c, w32term.c
* w32uniscribe.c, w32xfns.c: Convert function definitions to standard C.
2010-07-06 Andreas Schwab <schwab@linux-m68k.org>
* xterm.c (x_get_keysym_name): Change type of parameter to int.
* lisp.h: Declare x_get_keysym_name.
* keyboard.c (modify_event_symbol): Don't declare
x_get_keysym_name here.
2010-07-06 Dan Nicolaescu <dann@ics.uci.edu>
* ecrt0.c: Revert conversion to standard C.
2010-07-05 Dan Nicolaescu <dann@ics.uci.edu>
* vm-limit.c (memory_warnings):
* keyboard.c (modify_event_symbol):
* floatfns.c (rounding_driver, ceiling2, floor2, truncate2)
(round2, emacs_rint):
* process.c (send_process, old_sigpipe): Convert function
definitions and declarations to standard C.
2010-07-05 Juanma Barranquero <lekktu@gmail.com>
* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
* xdisp.c: Convert function definitions to standard C.
* cm.c (cmputc): Arg C is now int, not char.
* process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
2010-07-05 James Cloos <cloos@jhcloos.com>
* xterm.h (Xatom_net_wm_name, Xatom_net_wm_icon_name): New.
* xterm.c (x_term_init): Intern the _NET_WM_NAME and
_NET_WM_ICON_NAME atoms.
* xfns.c (x_set_name_internal): Set the EWMH _NET_WM_NAME
and _NET_WM_ICON_NAME properties, too, matching what is
done in the Gtk+ case.
2010-07-05 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (XTring_bell, XTset_terminal_window): Fix wrong prototype.
* xsmfns.c (SSDATA): New macro.
(smc_save_yourself_CB, x_session_initialize): Use SSDATA for strings
passed to strlen/strcpy/strcat.
(create_client_leader_window): Surround with #ifndef USE_GTK. Cast
7:th arg to XChangeProperty to (unsigned char *)
* xsettings.c (something_changedCB, parse_settings)
(apply_xft_settings): Reformat prototype.
(something_changedCB, init_gconf): Remove unused variable i.
(read_settings): Remove unused variable long_len.
* gtkutil.c (xg_get_pixbuf_from_pix_and_mask)
(xg_get_image_for_pixmap, create_dialog)
(xg_get_file_with_selection, xg_get_file_name, update_cl_data)
(menuitem_highlight_callback, make_menu_item)
(xg_create_one_menuitem, create_menus, xg_update_menu_item)
(xg_create_scroll_bar, xg_update_scrollbar_pos)
(xg_set_toolkit_scroll_bar_thumb, xg_tool_bar_button_cb)
(xg_tool_bar_proxy_help_callback, xg_tool_bar_detach_callback)
(xg_tool_bar_attach_callback, xg_tool_bar_help_callback)
(xg_tool_bar_item_expose_callback): Reformat prototype.
(xg_update_menubar): GList *group => GSList *group.
(xg_modify_menubar_widgets): Initialize witem to 0, check witem != 0
before use.
(update_frame_tool_bar): 4:th param to xg_get_image_for_pixmap changed
to GTK_IMAGE (wimage).
2010-07-05 Dan Nicolaescu <dann@ics.uci.edu>
* atimer.c: Use "" instead of <> for local includes for
consistency with the rest of the code.
* xsmfns.c (smc_save_yourself_CB, smc_error_handler):
* xrdb.c (get_system_name):
* window.c (shrink_windows):
* syntax.c (forw_comment):
* scroll.c (calculate_scrolling, calculate_direct_scrolling)
(ins_del_costs):
* mem-limits.h (start_of_data):
* lread.c (readevalloop):
* gtkutil.c (xg_dialog_response_cb, xg_get_file_with_chooser)
(xg_get_file_with_selection, xg_update_menubar, xg_update_submenu):
* frame.c (x_get_focus_frame):
* floatfns.c (fmod_float):
* fileio.c (choose_write_coding_system):
* emacs.c (fatal_error_signal, init_cmdargs, argmatch)
(malloc_initialize_hook, sort_args, synchronize_locale):
* doprnt.c (doprnt):
* dired.c (compile_pattern):
* data.c (fmod_float):
* chartab.c (map_sub_char_table, map_sub_char_table_for_charset)
(map_char_table_for_charset):
* charset.c (define_charset_internal):
* alloc.c (Fgarbage_collect): Convert declarations or definitions
to standard C.
2010-07-04 Tetsurou Okazaki <okazaki@be.to> (tiny change)
Stefan Monnier <monnier@iro.umontreal.ca>
* lread.c (read1): Fix up last change to not mess up `c'.
2010-07-04 Juanma Barranquero <lekktu@gmail.com>
* strftime.c: Revert conversion to standard C (2010-07-04T07:50:25Z!dann@ics.uci.edu).
2010-07-04 Juanma Barranquero <lekktu@gmail.com>
Fix prototypes.
* atimer.c (start_atimer): Use EMACS_TIME, not struct timeval.
* dired.c (file_name_completion_stat): Use DIRENTRY, not struct dirent.
* fileio.c (read_non_regular, read_non_regular_quit): Add Lisp_Object
arg, as required by internal_condition_case_1.
* print.c (strout): Use const char* for arg PTR.
* regex.c (bcmp_translate): Use RE_TRANSLATE_TYPE, not Lisp_Object.
(analyse_first): Fix "const const".
* sysdep.c (set_file_times): Use EMACS_TIME, not struct timeval.
* unexelf.c (round_up, find_section): Use ElfW macro for arguments.
* xgselect.c (xg_select): Use SELECT_TYPE, EMACS_TIME.
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* alloc.c: Convert function definitions to standard C.
* atimer.c:
* bidi.c:
* bytecode.c:
* callint.c:
* callproc.c:
* casefiddle.c:
* casetab.c:
* category.c:
* ccl.c:
* character.c:
* charset.c:
* chartab.c:
* cmds.c:
* coding.c:
* composite.c:
* data.c:
* dbusbind.c:
* dired.c:
* dispnew.c:
* doc.c:
* doprnt.c:
* ecrt0.c:
* editfns.c:
* fileio.c:
* filelock.c:
* filemode.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* fringe.c:
* ftfont.c:
* ftxfont.c:
* gtkutil.c:
* indent.c:
* insdel.c:
* intervals.c:
* keymap.c:
* lread.c:
* macros.c:
* marker.c:
* md5.c:
* menu.c:
* minibuf.c:
* prefix-args.c:
* print.c:
* ralloc.c:
* regex.c:
* region-cache.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* termcap.c:
* terminal.c:
* terminfo.c:
* textprop.c:
* tparam.c:
* undo.c:
* unexelf.c:
* window.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xgselect.c:
* xmenu.c:
* xrdb.c:
* xselect.c:
* xsettings.c:
* xsmfns.c:
* xterm.c: Likewise.
2010-07-03 Eli Zaretskii <eliz@gnu.org>
* msdos.c (IT_set_frame_parameters): Fix setting of colors in
frames other than the initial one. Fix reversal of colors when
`reverse' is specified in the frame parameters. Call
update_face_from_frame_parameter instead of
internal-set-lisp-face-attribute. Initialize screen colors from
initial_screen_colors[] when f->default_face_done_p is zero,
instead of depending on being called with default-frame-alist as
the alist argument.
* xfaces.c (update_face_from_frame_parameter): Move out of
HAVE_WINDOW_SYSTEM portion. Condition window-system only parts
with HAVE_WINDOW_SYSTEM.
* msdos.c (IT_set_frame_parameters): Set menu-bar-lines according
to menu-bar-mode, if not set in the frame parameters or in
default-frame-alist.
* w32console.c (sys_tputs): Adjust argument list to prototype in
term.c.
2010-07-03 Juanma Barranquero <lekktu@gmail.com>
* lisp.h (memory_warnings): Fix prototype.
* cm.h (evalcost): Fix prototype.
* cm.c (evalcost): Fix arg type.
2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
* term.c (term_clear_mouse_face, Fidentity):
* syssignal.h (signal_handler_t):
* lisp.h (memory_warnings):
* coding.h (preferred_coding_system):
* cm.h (evalcost):
* blockinput.h (reinvoke_input_signal): Convert to standard C prototypes.
2010-07-02 Eli Zaretskii <eliz@gnu.org>
* dosfns.h (msdos_stdcolor_idx, msdos_stdcolor_name): Remove P_
from prototypes.
* msdos.h (load_pixmap): Don't define away.
2010-07-02 Jan Djärv <jan.h.d@swipnet.se>
* lisp.h:
* atimer.h: Remove define for P_.
* alloc.c: Remove __P and P_ from .c and .m files.
* atimer.c:
* buffer.c:
* callint.c:
* category.c:
* charset.c:
* chartab.c:
* cm.c:
* coding.c:
* composite.c:
* data.c:
* dired.c:
* dispnew.c:
* doc.c:
* editfns.c:
* emacs.c:
* eval.c:
* fileio.c:
* filelock.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* ftfont.c:
* ftxfont.c:
* gmalloc.c:
* gtkutil.c:
* image.c:
* indent.c:
* intervals.c:
* keyboard.c:
* keymap.c:
* lread.c:
* marker.c:
* menu.c:
* minibuf.c:
* print.c:
* process.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* term.c:
* terminal.c:
* textprop.c:
* unexalpha.c:
* w32console.c:
* w32fns.c:
* w32font.c:
* w32menu.c:
* w32term.c:
* w32uniscribe.c:
* window.c:
* xdisp.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xmenu.c:
* xselect.c:
* xterm.c: Likewise.
Remove P_ and __P macros.
* atimer.h: Remove P_ and __P macros.
* buffer.h:
* category.h:
* ccl.h:
* character.h:
* charset.h:
* cm.h:
* coding.h:
* composite.h:
* dispextern.h:
* disptab.h:
* dosfns.h:
* font.h:
* fontset.h:
* frame.h:
* gtkutil.h:
* indent.h:
* intervals.h:
* keyboard.h:
* keymap.h:
* lisp.h:
* macros.h:
* md5.h:
* menu.h:
* msdos.h:
* nsterm.h:
* puresize.h:
* region-cache.h:
* syntax.h:
* syssignal.h:
* systime.h:
* termhooks.h:
* w32font.h:
* w32term.h:
* widget.h:
* window.h:
* xgselect.h:
* xsettings.h:
* xterm.h: Likewise.
2010-07-02 Dan Nicolaescu <dann@ics.uci.edu>
* lisp.h: Document that USE_LISP_UNION_TYPE is now enabled using autoconf.
Cleanup old code.
* dired.c (BSD4_3): Remove all uses, redundant with BSD4_2.
* syssignal.h: Remove code for Lynx, not supported anymore.
* vm-limit.c: Remove unused code the depends on emacs not being
defined and NO_LIM_DATA being defined.
* mem-limits.h: Remove dead code.
2010-07-01 Jan Djärv <jan.h.d@swipnet.se>
* window.c (Fwindow_absolute_pixel_edges): Doc fix.
* window.c (calc_absolute_offset, Fwindow_absolute_pixel_edges)
(Fwindow_inside_absolute_pixel_edges): New functions (bug#5721).
* nsfns.m (compute_tip_xy): Do not convert coordinates from frame
parameters, they are already absolute.
* nsterm.m (x_set_window_size, initFrameFromEmacs): Renamed
FRAME_NS_TOOLBAR_HEIGHT to FRAME_TOOLBAR_HEIGHT.
* nsterm.h (FRAME_NS_TOOLBAR_HEIGHT): Rename to FRAME_TOOLBAR_HEIGH
* nsmenu.m (update_frame_tool_bar, free_frame_tool_bar): Update
FRAME_TOOLBAR_HEIGHT.
* nsmenu.m (free_frame_tool_bar, update_frame_tool_bar): Add
BLOCK/UNBLOCK_INPUT so asserts don't trigger.
2010-06-30 Chong Yidong <cyd@stupidchicken.com>
* frame.c (get_future_frame_param, Fmake_terminal_frame): Don't

View file

@ -628,20 +628,10 @@ buildobj.h: Makefile
echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
## We cannot define variables for PRE_EDIT and POST_EDIT.
## If !ORDINARY_LINK && !LINKER && GCC, they add a
## `./prefix-args -Xlinker ... ` wrapper, otherwise they are empty.
## One alternative to this approach would be to always call prefix-args,
## and have it DTRT in all cases, by testing the above defines.
temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
$(LD) @PRE_EDIT_LDFLAGS@ ${TEMACS_LDFLAGS} @POST_EDIT_LDFLAGS@ \
${TEMACS_LDFLAGS2} \
temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj}
$(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \
-o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES}
prefix-args${EXEEXT}: prefix-args.o $(config_h)
$(CC) $(LDFLAGS) prefix-args.o -o prefix-args
## The following oldxmenu-related rules are only (possibly) used if
## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
## (provided we take a little care that OLDXMENU is never empty).
@ -688,7 +678,7 @@ doc.o: buildobj.h
mostlyclean:
rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
rm -f temacs${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
rm -f ../etc/DOC
rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
rm -f buildobj.h

File diff suppressed because it is too large Load diff

View file

@ -21,11 +21,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <setjmp.h>
#include <lisp.h>
#include <syssignal.h>
#include <systime.h>
#include <blockinput.h>
#include <atimer.h>
#include "lisp.h"
#include "syssignal.h"
#include "systime.h"
#include "blockinput.h"
#include "atimer.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@ -64,11 +64,11 @@ int pending_atimers;
/* Function prototypes. */
static void set_alarm P_ ((void));
static void schedule_atimer P_ ((struct atimer *));
static struct atimer *append_atimer_lists P_ ((struct atimer *,
struct atimer *));
SIGTYPE alarm_signal_handler ();
static void set_alarm (void);
static void schedule_atimer (struct atimer *);
static struct atimer *append_atimer_lists (struct atimer *,
struct atimer *);
SIGTYPE alarm_signal_handler (int signo);
/* Start a new atimer of type TYPE. TIME specifies when the timer is
@ -90,11 +90,8 @@ SIGTYPE alarm_signal_handler ();
to cancel_atimer; don't free it yourself. */
struct atimer *
start_atimer (type, time, fn, client_data)
enum atimer_type type;
EMACS_TIME time;
atimer_callback fn;
void *client_data;
start_atimer (enum atimer_type type, EMACS_TIME time, atimer_callback fn,
void *client_data)
{
struct atimer *t;
@ -119,7 +116,7 @@ start_atimer (type, time, fn, client_data)
t = (struct atimer *) xmalloc (sizeof *t);
/* Fill the atimer structure. */
bzero (t, sizeof *t);
memset (t, 0, sizeof *t);
t->type = type;
t->fn = fn;
t->client_data = client_data;
@ -159,8 +156,7 @@ start_atimer (type, time, fn, client_data)
/* Cancel and free atimer TIMER. */
void
cancel_atimer (timer)
struct atimer *timer;
cancel_atimer (struct atimer *timer)
{
int i;
@ -199,8 +195,7 @@ cancel_atimer (timer)
result list. */
static struct atimer *
append_atimer_lists (list1, list2)
struct atimer *list1, *list2;
append_atimer_lists (struct atimer *list1, struct atimer *list2)
{
if (list1 == NULL)
return list2;
@ -221,8 +216,7 @@ append_atimer_lists (list1, list2)
/* Stop all timers except timer T. T null means stop all timers. */
void
stop_other_atimers (t)
struct atimer *t;
stop_other_atimers (struct atimer *t)
{
BLOCK_ATIMERS;
@ -257,7 +251,7 @@ stop_other_atimers (t)
stop_other_atimers. */
void
run_all_atimers ()
run_all_atimers (void)
{
if (stopped_atimers)
{
@ -283,8 +277,7 @@ run_all_atimers ()
/* A version of run_all_timers suitable for a record_unwind_protect. */
Lisp_Object
unwind_stop_other_atimers (dummy)
Lisp_Object dummy;
unwind_stop_other_atimers (Lisp_Object dummy)
{
run_all_atimers ();
return Qnil;
@ -294,7 +287,7 @@ unwind_stop_other_atimers (dummy)
/* Arrange for a SIGALRM to arrive when the next timer is ripe. */
static void
set_alarm ()
set_alarm (void)
{
if (atimers)
{
@ -315,7 +308,7 @@ set_alarm ()
EMACS_SET_USECS (time, 1000);
}
bzero (&it, sizeof it);
memset (&it, 0, sizeof it);
it.it_value = time;
setitimer (ITIMER_REAL, &it, 0);
#else /* not HAVE_SETITIMER */
@ -330,8 +323,7 @@ set_alarm ()
already. */
static void
schedule_atimer (t)
struct atimer *t;
schedule_atimer (struct atimer *t)
{
struct atimer *a = atimers, *prev = NULL;
@ -349,7 +341,7 @@ schedule_atimer (t)
}
static void
run_timers ()
run_timers (void)
{
EMACS_TIME now;
@ -401,8 +393,7 @@ run_timers ()
SIGALRM. */
SIGTYPE
alarm_signal_handler (signo)
int signo;
alarm_signal_handler (int signo)
{
#ifndef SYNC_INPUT
SIGNAL_THREAD_CHECK (signo);
@ -420,7 +411,7 @@ alarm_signal_handler (signo)
/* Call alarm_signal_handler for pending timers. */
void
do_pending_atimers ()
do_pending_atimers (void)
{
if (pending_atimers)
{
@ -435,8 +426,7 @@ do_pending_atimers ()
some systems like HPUX (see process.c). */
void
turn_on_atimers (on)
int on;
turn_on_atimers (int on)
{
if (on)
{
@ -449,7 +439,7 @@ turn_on_atimers (on)
void
init_atimer ()
init_atimer (void)
{
free_atimers = stopped_atimers = atimers = NULL;
pending_atimers = 0;

View file

@ -20,13 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_ATIMER_H
#define EMACS_ATIMER_H
/* Declare the prototype for a general external function. */
#if defined (PROTOTYPES) || defined (WINDOWSNT)
#define P_(proto) proto
#else
#define P_(proto) ()
#endif
#include "systime.h" /* for EMACS_TIME */
/* Forward declaration. */
@ -49,7 +42,7 @@ enum atimer_type
/* Type of timer callback functions. */
typedef void (* atimer_callback) P_ ((struct atimer *timer));
typedef void (* atimer_callback) (struct atimer *timer);
/* Structure describing an asynchronous timer. */
@ -77,15 +70,15 @@ struct atimer
/* Function prototypes. */
struct atimer *start_atimer P_ ((enum atimer_type, EMACS_TIME,
atimer_callback, void *));
void cancel_atimer P_ ((struct atimer *));
void do_pending_atimers P_ ((void));
void init_atimer P_ ((void));
void turn_on_atimers P_ ((int));
void stop_other_atimers P_ ((struct atimer *));
void run_all_atimers P_ ((void));
Lisp_Object unwind_stop_other_atimers P_ ((Lisp_Object));
struct atimer *start_atimer (enum atimer_type, EMACS_TIME,
atimer_callback, void *);
void cancel_atimer (struct atimer *);
void do_pending_atimers (void);
void init_atimer (void);
void turn_on_atimers (int);
void stop_other_atimers (struct atimer *);
void run_all_atimers (void);
Lisp_Object unwind_stop_other_atimers (Lisp_Object);
#endif /* EMACS_ATIMER_H */

View file

@ -2,5 +2,5 @@
## This is inserted in src/Makefile if AUTO_DEPEND=yes.
ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
ALLOBJS=$(START_FILES) ${obj} ${otherobj}
-include $(ALLOBJS:%.o=${DEPDIR}/%.d)

View file

@ -49,16 +49,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
rule X9 and to its modifications decribed in the "Implementation
Notes" section of UAX#9, under "Retaining Format Codes". */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <setjmp.h>
#include "lisp.h"
@ -106,7 +99,7 @@ static Lisp_Object paragraph_start_re, paragraph_separate_re;
static Lisp_Object Qparagraph_start, Qparagraph_separate;
static void
bidi_initialize ()
bidi_initialize (void)
{
#include "biditype.h"

View file

@ -123,7 +123,7 @@ extern int pending_atimers;
/* Defined in keyboard.c */
/* Don't use a prototype here; it causes trouble in some files. */
extern void reinvoke_input_signal ();
extern void reinvoke_input_signal (void);
#endif /* EMACS_BLOCKINPUT_H */

View file

@ -106,13 +106,13 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS];
int last_per_buffer_idx;
EXFUN (Fset_buffer, 1);
void set_buffer_internal P_ ((struct buffer *b));
void set_buffer_internal_1 P_ ((struct buffer *b));
static void call_overlay_mod_hooks P_ ((Lisp_Object list, Lisp_Object overlay,
int after, Lisp_Object arg1,
Lisp_Object arg2, Lisp_Object arg3));
static void swap_out_buffer_local_variables P_ ((struct buffer *b));
static void reset_buffer_local_variables P_ ((struct buffer *b, int permanent_too));
void set_buffer_internal (struct buffer *b);
void set_buffer_internal_1 (struct buffer *b);
static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
int after, Lisp_Object arg1,
Lisp_Object arg2, Lisp_Object arg3);
static void swap_out_buffer_local_variables (struct buffer *b);
static void reset_buffer_local_variables (struct buffer *b, int permanent_too);
/* Alist of all buffer names vs the buffers. */
/* This used to be a variable, but is no longer,
@ -168,20 +168,19 @@ Lisp_Object Qmodification_hooks;
Lisp_Object Qinsert_in_front_hooks;
Lisp_Object Qinsert_behind_hooks;
static void alloc_buffer_text P_ ((struct buffer *, size_t));
static void free_buffer_text P_ ((struct buffer *b));
static struct Lisp_Overlay * copy_overlays P_ ((struct buffer *, struct Lisp_Overlay *));
static void modify_overlay P_ ((struct buffer *, EMACS_INT, EMACS_INT));
static Lisp_Object buffer_lisp_local_variables P_ ((struct buffer *));
static void alloc_buffer_text (struct buffer *, size_t);
static void free_buffer_text (struct buffer *b);
static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *);
static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT);
static Lisp_Object buffer_lisp_local_variables (struct buffer *);
extern char * emacs_strerror P_ ((int));
extern char * emacs_strerror (int);
/* For debugging; temporary. See set_buffer_internal. */
/* Lisp_Object Qlisp_mode, Vcheck_symbol; */
void
nsberror (spec)
Lisp_Object spec;
nsberror (Lisp_Object spec)
{
if (STRINGP (spec))
error ("No buffer named %s", SDATA (spec));
@ -248,9 +247,7 @@ frame parameter come first, followed by the rest of the buffers. */)
and don't ever QUIT. */
static Lisp_Object
assoc_ignore_text_properties (key, list)
register Lisp_Object key;
Lisp_Object list;
assoc_ignore_text_properties (register Lisp_Object key, Lisp_Object list)
{
register Lisp_Object tail;
for (tail = list; CONSP (tail); tail = XCDR (tail))
@ -312,8 +309,7 @@ See also `find-buffer-visiting'. */)
}
Lisp_Object
get_truename_buffer (filename)
register Lisp_Object filename;
get_truename_buffer (register Lisp_Object filename)
{
register Lisp_Object tail, buf, tem;
@ -437,9 +433,7 @@ even if it is dead. The return value is never nil. */)
LIST, but for buffer B. */
static struct Lisp_Overlay *
copy_overlays (b, list)
struct buffer *b;
struct Lisp_Overlay *list;
copy_overlays (struct buffer *b, struct Lisp_Overlay *list)
{
Lisp_Object buffer;
struct Lisp_Overlay *result = NULL, *tail = NULL;
@ -489,8 +483,7 @@ copy_overlays (b, list)
copied. */
static void
clone_per_buffer_values (from, to)
struct buffer *from, *to;
clone_per_buffer_values (struct buffer *from, struct buffer *to)
{
Lisp_Object to_buffer;
int offset;
@ -521,7 +514,7 @@ clone_per_buffer_values (from, to)
PER_BUFFER_VALUE (to, offset) = obj;
}
bcopy (from->local_flags, to->local_flags, sizeof to->local_flags);
memcpy (to->local_flags, from->local_flags, sizeof to->local_flags);
to->overlays_before = copy_overlays (to, from->overlays_before);
to->overlays_after = copy_overlays (to, from->overlays_after);
@ -658,8 +651,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
}
void
delete_all_overlays (b)
struct buffer *b;
delete_all_overlays (struct buffer *b)
{
Lisp_Object overlay;
@ -689,8 +681,7 @@ delete_all_overlays (b)
claims it doesn't belong to it. */
void
reset_buffer (b)
register struct buffer *b;
reset_buffer (register struct buffer *b)
{
b->filename = Qnil;
b->file_truename = Qnil;
@ -734,9 +725,7 @@ reset_buffer (b)
we preserve those. */
static void
reset_buffer_local_variables (b, permanent_too)
register struct buffer *b;
int permanent_too;
reset_buffer_local_variables (register struct buffer *b, int permanent_too)
{
register int offset;
int i;
@ -993,8 +982,7 @@ is the default binding of the variable. */)
in special slots in the buffer object. */
static Lisp_Object
buffer_lisp_local_variables (buf)
struct buffer *buf;
buffer_lisp_local_variables (struct buffer *buf)
{
Lisp_Object result = Qnil;
register Lisp_Object tail;
@ -1293,7 +1281,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */)
(buffer, visible_ok, frame)
register Lisp_Object buffer, visible_ok, frame;
{
Lisp_Object Fset_buffer_major_mode ();
Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer);
register Lisp_Object tail, buf, notsogood, tem, pred, add_ons;
notsogood = Qnil;
@ -1618,8 +1606,7 @@ with SIGHUP. */)
means that other_buffer is more likely to choose a relevant buffer. */
void
record_buffer (buf)
Lisp_Object buf;
record_buffer (Lisp_Object buf)
{
register Lisp_Object link, prev;
Lisp_Object frame;
@ -1734,8 +1721,7 @@ the current buffer's major mode. */)
If NORECORD is non-nil, don't call record_buffer. */
Lisp_Object
switch_to_buffer_1 (buffer_or_name, norecord)
Lisp_Object buffer_or_name, norecord;
switch_to_buffer_1 (Lisp_Object buffer_or_name, Lisp_Object norecord)
{
register Lisp_Object buffer;
@ -1831,8 +1817,7 @@ DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
time, and that increments windows_or_buffers_changed. */
void
set_buffer_internal (b)
register struct buffer *b;
set_buffer_internal (register struct buffer *b)
{
if (current_buffer != b)
set_buffer_internal_1 (b);
@ -1842,8 +1827,7 @@ set_buffer_internal (b)
This is used by redisplay. */
void
set_buffer_internal_1 (b)
register struct buffer *b;
set_buffer_internal_1 (register struct buffer *b)
{
register struct buffer *old_buf;
register Lisp_Object tail;
@ -1939,8 +1923,7 @@ set_buffer_internal_1 (b)
This avoids certain things that don't need to be done within redisplay. */
void
set_buffer_temp (b)
struct buffer *b;
set_buffer_temp (struct buffer *b)
{
register struct buffer *old_buf;
@ -2019,8 +2002,7 @@ ends when the current command terminates. Use `switch-to-buffer' or
/* Set the current buffer to BUFFER provided it is alive. */
Lisp_Object
set_buffer_if_live (buffer)
Lisp_Object buffer;
set_buffer_if_live (Lisp_Object buffer)
{
if (! NILP (XBUFFER (buffer)->name))
Fset_buffer (buffer);
@ -2120,8 +2102,7 @@ so the buffer is truly empty after this. */)
}
void
validate_region (b, e)
register Lisp_Object *b, *e;
validate_region (register Lisp_Object *b, register Lisp_Object *e)
{
CHECK_NUMBER_COERCE_MARKER (*b);
CHECK_NUMBER_COERCE_MARKER (*e);
@ -2141,8 +2122,7 @@ validate_region (b, e)
and return the adjusted position. */
static int
advance_to_char_boundary (byte_pos)
int byte_pos;
advance_to_char_boundary (int byte_pos)
{
int c;
@ -2175,7 +2155,7 @@ advance_to_char_boundary (byte_pos)
}
#ifdef REL_ALLOC
extern void r_alloc_reset_variable P_ ((POINTER_TYPE *, POINTER_TYPE *));
extern void r_alloc_reset_variable (POINTER_TYPE *, POINTER_TYPE *);
#endif /* REL_ALLOC */
DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
@ -2644,8 +2624,7 @@ the normal hook `change-major-mode-hook'. */)
for their current values. */
static void
swap_out_buffer_local_variables (b)
struct buffer *b;
swap_out_buffer_local_variables (struct buffer *b)
{
Lisp_Object oalist, alist, buffer;
@ -2690,14 +2669,8 @@ swap_out_buffer_local_variables (b)
default (BEGV or ZV). */
int
overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req)
EMACS_INT pos;
int extend;
Lisp_Object **vec_ptr;
int *len_ptr;
EMACS_INT *next_ptr;
EMACS_INT *prev_ptr;
int change_req;
overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr, int *len_ptr,
EMACS_INT *next_ptr, EMACS_INT *prev_ptr, int change_req)
{
Lisp_Object overlay, start, end;
struct Lisp_Overlay *tail;
@ -2835,13 +2808,8 @@ overlays_at (pos, extend, vec_ptr, len_ptr, next_ptr, prev_ptr, change_req)
But we still return the total number of overlays. */
static int
overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
int beg, end;
int extend;
Lisp_Object **vec_ptr;
int *len_ptr;
int *next_ptr;
int *prev_ptr;
overlays_in (int beg, int end, int extend, Lisp_Object **vec_ptr, int *len_ptr,
int *next_ptr, int *prev_ptr)
{
Lisp_Object overlay, ostart, oend;
struct Lisp_Overlay *tail;
@ -2962,8 +2930,7 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, prev_ptr)
`mouse-face' property overlapping OVERLAY. */
int
mouse_face_overlay_overlaps (overlay)
Lisp_Object overlay;
mouse_face_overlay_overlaps (Lisp_Object overlay)
{
int start = OVERLAY_POSITION (OVERLAY_START (overlay));
int end = OVERLAY_POSITION (OVERLAY_END (overlay));
@ -2992,8 +2959,7 @@ mouse_face_overlay_overlaps (overlay)
/* Fast function to just test if we're at an overlay boundary. */
int
overlay_touches_p (pos)
int pos;
overlay_touches_p (int pos)
{
Lisp_Object overlay;
struct Lisp_Overlay *tail;
@ -3038,8 +3004,7 @@ struct sortvec
};
static int
compare_overlays (v1, v2)
const void *v1, *v2;
compare_overlays (const void *v1, const void *v2)
{
const struct sortvec *s1 = (const struct sortvec *) v1;
const struct sortvec *s2 = (const struct sortvec *) v2;
@ -3056,10 +3021,7 @@ compare_overlays (v1, v2)
The return value is the new size; this may be smaller than the original
size if some of the overlays were invalid or were window-specific. */
int
sort_overlays (overlay_vec, noverlays, w)
Lisp_Object *overlay_vec;
int noverlays;
struct window *w;
sort_overlays (Lisp_Object *overlay_vec, int noverlays, struct window *w)
{
int i, j;
struct sortvec *sortvec;
@ -3139,8 +3101,7 @@ static int overlay_str_len;
/* A comparison function suitable for passing to qsort. */
static int
cmp_for_strings (as1, as2)
char *as1, *as2;
cmp_for_strings (const void *as1, const void *as2)
{
struct sortstr *s1 = (struct sortstr *)as1;
struct sortstr *s2 = (struct sortstr *)as2;
@ -3152,10 +3113,7 @@ cmp_for_strings (as1, as2)
}
static void
record_overlay_string (ssl, str, str2, pri, size)
struct sortstrlist *ssl;
Lisp_Object str, str2, pri;
int size;
record_overlay_string (struct sortstrlist *ssl, Lisp_Object str, Lisp_Object str2, Lisp_Object pri, int size)
{
int nbytes;
@ -3211,10 +3169,7 @@ record_overlay_string (ssl, str, str2, pri, size)
subsequent calls. */
int
overlay_strings (pos, w, pstr)
EMACS_INT pos;
struct window *w;
unsigned char **pstr;
overlay_strings (EMACS_INT pos, struct window *w, unsigned char **pstr)
{
Lisp_Object overlay, window, str;
struct Lisp_Overlay *ov;
@ -3337,9 +3292,7 @@ overlay_strings (pos, w, pstr)
/* Shift overlays in BUF's overlay lists, to center the lists at POS. */
void
recenter_overlay_lists (buf, pos)
struct buffer *buf;
EMACS_INT pos;
recenter_overlay_lists (struct buffer *buf, EMACS_INT pos)
{
Lisp_Object overlay, beg, end;
struct Lisp_Overlay *prev, *tail, *next;
@ -3488,9 +3441,7 @@ recenter_overlay_lists (buf, pos)
}
void
adjust_overlays_for_insert (pos, length)
EMACS_INT pos;
EMACS_INT length;
adjust_overlays_for_insert (EMACS_INT pos, EMACS_INT length)
{
/* After an insertion, the lists are still sorted properly,
but we may need to update the value of the overlay center. */
@ -3499,9 +3450,7 @@ adjust_overlays_for_insert (pos, length)
}
void
adjust_overlays_for_delete (pos, length)
EMACS_INT pos;
EMACS_INT length;
adjust_overlays_for_delete (EMACS_INT pos, EMACS_INT length)
{
if (current_buffer->overlay_center < pos)
/* The deletion was to our right. No change needed; the before- and
@ -3526,8 +3475,7 @@ adjust_overlays_for_delete (pos, length)
Such an overlay might even have negative size at this point.
If so, we'll make the overlay empty. */
void
fix_start_end_in_overlays (start, end)
register int start, end;
fix_start_end_in_overlays (register int start, register int end)
{
Lisp_Object overlay;
struct Lisp_Overlay *before_list, *after_list;
@ -3673,9 +3621,7 @@ fix_start_end_in_overlays (start, end)
was at PREV, and now is at POS. */
void
fix_overlays_before (bp, prev, pos)
struct buffer *bp;
EMACS_INT prev, pos;
fix_overlays_before (struct buffer *bp, EMACS_INT prev, EMACS_INT pos)
{
/* If parent is nil, replace overlays_before; otherwise, parent->next. */
struct Lisp_Overlay *tail = bp->overlays_before, *parent = NULL, *right_pair;
@ -3841,9 +3787,7 @@ for the rear of the overlay advance when text is inserted there
/* Mark a section of BUF as needing redisplay because of overlays changes. */
static void
modify_overlay (buf, start, end)
struct buffer *buf;
EMACS_INT start, end;
modify_overlay (struct buffer *buf, EMACS_INT start, EMACS_INT end)
{
if (start > end)
{
@ -3870,11 +3814,10 @@ modify_overlay (buf, start, end)
}
Lisp_Object Fdelete_overlay ();
Lisp_Object Fdelete_overlay (Lisp_Object overlay);
static struct Lisp_Overlay *
unchain_overlay (list, overlay)
struct Lisp_Overlay *list, *overlay;
unchain_overlay (struct Lisp_Overlay *list, struct Lisp_Overlay *overlay)
{
struct Lisp_Overlay *tmp, *prev;
for (tmp = list, prev = NULL; tmp; prev = tmp, tmp = tmp->next)
@ -4333,8 +4276,7 @@ static int last_overlay_modification_hooks_used;
to the end of last_overlay_modification_hooks. */
static void
add_overlay_mod_hooklist (functionlist, overlay)
Lisp_Object functionlist, overlay;
add_overlay_mod_hooklist (Lisp_Object functionlist, Lisp_Object overlay)
{
int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
@ -4362,10 +4304,8 @@ add_overlay_mod_hooklist (functionlist, overlay)
and the length of deleted or replaced old text. */
void
report_overlay_modification (start, end, after, arg1, arg2, arg3)
Lisp_Object start, end;
int after;
Lisp_Object arg1, arg2, arg3;
report_overlay_modification (Lisp_Object start, Lisp_Object end, int after,
Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
Lisp_Object prop, overlay;
struct Lisp_Overlay *tail;
@ -4473,8 +4413,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
Lisp_Object *copy = (Lisp_Object *) alloca (size * sizeof (Lisp_Object));
int i;
bcopy (XVECTOR (last_overlay_modification_hooks)->contents,
copy, size * sizeof (Lisp_Object));
memcpy (copy, XVECTOR (last_overlay_modification_hooks)->contents,
size * sizeof (Lisp_Object));
gcpro1.var = copy;
gcpro1.nvars = size;
@ -4490,10 +4430,8 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3)
}
static void
call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3)
Lisp_Object list, overlay;
int after;
Lisp_Object arg1, arg2, arg3;
call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, int after,
Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
@ -4513,8 +4451,7 @@ call_overlay_mod_hooks (list, overlay, after, arg1, arg2, arg3)
/* Delete any zero-sized overlays at position POS, if the `evaporate'
property is set. */
void
evaporate_overlays (pos)
EMACS_INT pos;
evaporate_overlays (EMACS_INT pos)
{
Lisp_Object overlay, hit_list;
struct Lisp_Overlay *tail;
@ -4552,9 +4489,7 @@ evaporate_overlays (pos)
in the slot with offset OFFSET. */
void
buffer_slot_type_mismatch (newval, type)
Lisp_Object newval;
int type;
buffer_slot_type_mismatch (Lisp_Object newval, int type)
{
Lisp_Object predicate;
@ -4693,13 +4628,13 @@ static int mmap_initialized_p;
/* Function prototypes. */
static int mmap_free_1 P_ ((struct mmap_region *));
static int mmap_enlarge P_ ((struct mmap_region *, int));
static struct mmap_region *mmap_find P_ ((POINTER_TYPE *, POINTER_TYPE *));
static POINTER_TYPE *mmap_alloc P_ ((POINTER_TYPE **, size_t));
static POINTER_TYPE *mmap_realloc P_ ((POINTER_TYPE **, size_t));
static void mmap_free P_ ((POINTER_TYPE **ptr));
static void mmap_init P_ ((void));
static int mmap_free_1 (struct mmap_region *);
static int mmap_enlarge (struct mmap_region *, int);
static struct mmap_region *mmap_find (POINTER_TYPE *, POINTER_TYPE *);
static POINTER_TYPE *mmap_alloc (POINTER_TYPE **, size_t);
static POINTER_TYPE *mmap_realloc (POINTER_TYPE **, size_t);
static void mmap_free (POINTER_TYPE **ptr);
static void mmap_init (void);
/* Return a region overlapping address range START...END, or null if
@ -4942,7 +4877,7 @@ mmap_realloc (var, nbytes)
}
else if (mmap_alloc (var, nbytes))
{
bcopy (old_ptr, *var, r->nbytes_specified);
memcpy (*var, old_ptr, r->nbytes_specified);
mmap_free_1 (MMAP_REGION (old_ptr));
result = *var;
r = MMAP_REGION (result);
@ -5032,18 +4967,16 @@ mmap_init ()
***********************************************************************/
#ifdef REL_ALLOC
extern POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t));
extern POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t));
extern void r_alloc_free P_ ((POINTER_TYPE **ptr));
extern POINTER_TYPE *r_alloc (POINTER_TYPE **, size_t);
extern POINTER_TYPE *r_re_alloc (POINTER_TYPE **, size_t);
extern void r_alloc_free (POINTER_TYPE **ptr);
#endif /* REL_ALLOC */
/* Allocate NBYTES bytes for buffer B's text buffer. */
static void
alloc_buffer_text (b, nbytes)
struct buffer *b;
size_t nbytes;
alloc_buffer_text (struct buffer *b, size_t nbytes)
{
POINTER_TYPE *p;
@ -5098,8 +5031,7 @@ enlarge_buffer_text (struct buffer *b, EMACS_INT delta)
/* Free buffer B's text buffer. */
static void
free_buffer_text (b)
struct buffer *b;
free_buffer_text (struct buffer *b)
{
BLOCK_INPUT;
@ -5122,11 +5054,11 @@ free_buffer_text (b)
***********************************************************************/
void
init_buffer_once ()
init_buffer_once (void)
{
int idx;
bzero (buffer_permanent_local_flags, sizeof buffer_permanent_local_flags);
memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags);
/* Make sure all markable slots in buffer_defaults
are initialized reasonably, so mark_buffer won't choke. */
@ -5214,7 +5146,7 @@ init_buffer_once ()
if (sizeof (EMACS_INT) != sizeof (Lisp_Object)) abort ();
/* 0 means not a lisp var, -1 means always local, else mask */
bzero (&buffer_local_flags, sizeof buffer_local_flags);
memset (&buffer_local_flags, 0, sizeof buffer_local_flags);
XSETINT (buffer_local_flags.filename, -1);
XSETINT (buffer_local_flags.directory, -1);
XSETINT (buffer_local_flags.backed_up, -1);
@ -5318,7 +5250,7 @@ init_buffer_once ()
}
void
init_buffer ()
init_buffer (void)
{
char *pwd;
Lisp_Object temp;
@ -5402,12 +5334,8 @@ init_buffer ()
} while (0)
static void
defvar_per_buffer (bo_fwd, namestring, address, type, doc)
struct Lisp_Buffer_Objfwd *bo_fwd;
char *namestring;
Lisp_Object *address;
Lisp_Object type;
char *doc;
defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring,
Lisp_Object *address, Lisp_Object type, char *doc)
{
struct Lisp_Symbol *sym;
int offset;
@ -5435,7 +5363,7 @@ defvar_per_buffer (bo_fwd, namestring, address, type, doc)
/* initialize the buffer routines */
void
syms_of_buffer ()
syms_of_buffer (void)
{
staticpro (&last_overlay_modification_hooks);
last_overlay_modification_hooks
@ -6338,7 +6266,7 @@ The function `kill-all-local-variables' runs this before doing anything else. *
}
void
keys_of_buffer ()
keys_of_buffer (void)
{
initial_define_key (control_x_map, 'b', "switch-to-buffer");
initial_define_key (control_x_map, 'k', "kill-buffer");

View file

@ -225,12 +225,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BUF_TEMP_SET_PT(buffer, position) \
(temp_set_point ((buffer), (position)))
extern void set_point P_ ((EMACS_INT));
extern INLINE void temp_set_point P_ ((struct buffer *, EMACS_INT));
extern void set_point_both P_ ((EMACS_INT, EMACS_INT));
extern INLINE void temp_set_point_both P_ ((struct buffer *,
EMACS_INT, EMACS_INT));
extern void enlarge_buffer_text P_ ((struct buffer *, EMACS_INT));
extern void set_point (EMACS_INT);
extern INLINE void temp_set_point (struct buffer *, EMACS_INT);
extern void set_point_both (EMACS_INT, EMACS_INT);
extern INLINE void temp_set_point_both (struct buffer *,
EMACS_INT, EMACS_INT);
extern void enlarge_buffer_text (struct buffer *, EMACS_INT);
/* Macros for setting the BEGV, ZV or PT of a given buffer.
@ -857,23 +857,23 @@ extern struct buffer buffer_local_flags;
extern struct buffer buffer_local_symbols;
extern void delete_all_overlays P_ ((struct buffer *));
extern void reset_buffer P_ ((struct buffer *));
extern void evaporate_overlays P_ ((EMACS_INT));
extern int overlays_at P_ ((EMACS_INT pos, int extend, Lisp_Object **vec_ptr,
int *len_ptr, EMACS_INT *next_ptr,
EMACS_INT *prev_ptr, int change_req));
extern int sort_overlays P_ ((Lisp_Object *, int, struct window *));
extern void recenter_overlay_lists P_ ((struct buffer *, EMACS_INT));
extern int overlay_strings P_ ((EMACS_INT, struct window *, unsigned char **));
extern void validate_region P_ ((Lisp_Object *, Lisp_Object *));
extern void set_buffer_internal P_ ((struct buffer *));
extern void set_buffer_internal_1 P_ ((struct buffer *));
extern void set_buffer_temp P_ ((struct buffer *));
extern void record_buffer P_ ((Lisp_Object));
extern void buffer_slot_type_mismatch P_ ((Lisp_Object, int)) NO_RETURN;
extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT));
extern void mmap_set_vars P_ ((int));
extern void delete_all_overlays (struct buffer *);
extern void reset_buffer (struct buffer *);
extern void evaporate_overlays (EMACS_INT);
extern int overlays_at (EMACS_INT pos, int extend, Lisp_Object **vec_ptr,
int *len_ptr, EMACS_INT *next_ptr,
EMACS_INT *prev_ptr, int change_req);
extern int sort_overlays (Lisp_Object *, int, struct window *);
extern void recenter_overlay_lists (struct buffer *, EMACS_INT);
extern int overlay_strings (EMACS_INT, struct window *, unsigned char **);
extern void validate_region (Lisp_Object *, Lisp_Object *);
extern void set_buffer_internal (struct buffer *);
extern void set_buffer_internal_1 (struct buffer *);
extern void set_buffer_temp (struct buffer *);
extern void record_buffer (Lisp_Object);
extern void buffer_slot_type_mismatch (Lisp_Object, int) NO_RETURN;
extern void fix_overlays_before (struct buffer *, EMACS_INT, EMACS_INT);
extern void mmap_set_vars (int);
/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
If NEXTP is non-NULL, return next overlay there.

View file

@ -272,7 +272,7 @@ struct byte_stack *byte_stack_list;
/* Mark objects on byte_stack_list. Called during GC. */
void
mark_byte_stack ()
mark_byte_stack (void)
{
struct byte_stack *stack;
Lisp_Object *obj;
@ -301,7 +301,7 @@ mark_byte_stack ()
counters. Called when GC has completed. */
void
unmark_byte_stack ()
unmark_byte_stack (void)
{
struct byte_stack *stack;
@ -1678,7 +1678,7 @@ If the third argument is incorrect, Emacs may crash. */)
}
void
syms_of_bytecode ()
syms_of_bytecode (void)
{
Qbytecode = intern_c_string ("byte-code");
staticpro (&Qbytecode);

Some files were not shown because too many files have changed in this diff Show more