diff options
author | sabetts <sabetts> | 2003-02-23 01:40:42 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-02-23 01:40:42 +0000 |
commit | 49ca20c9fc7807d612ef9925c110e8da6c3c1a8f (patch) | |
tree | f532251c2f3835e9ecd81f46e17900e95603be52 /src/ratpoison.h | |
parent | 5e4c6e4a9729e1ec546535cfc6ee264768c6b987 (diff) | |
download | ratpoison-49ca20c9fc7807d612ef9925c110e8da6c3c1a8f.zip |
* configure.in: don't check for variable argument support in
preprocessor.
* src/ratpoison.h (PRINT_LINE): new macro.
(PRE_PRINT_LOCATION): remove macro
(PRINT_ERROR): takes one argument which is the argument list
,parens and all, to be passed to printf. Callers updated.
* src/actions.c (cmd_number): use list delete entry macro
(cmd_number): likewise
(cmd_escape): use list looping macro
(cmd_escape): likewise
(cmd_defpadding): likewise
(cmd_defborder): likewise
* src/events.c (mapping_notify): use list looping macro
(mapping_notify): likewise
* src/list.c: rename rp_unmapped_window_sentinel to
rp_unmapped_window and rp_mapped_window_sentinel to
rp_mapped_window. Use LIST_HEAD to create them. externs updated.
(add_to_window_list): use list add entry macro.
(find_window_in_list): list head is of type list_head. Prototype
and callers updated.
(find_window_in_list): use list looping macro
(init_window_list): remove function
(find_window_number): use list looping macro
(find_window_name): likewise
(find_window_prev): use list previous entry macro
(find_window_next): use list next entry macro
(find_window_other): use list looping macro
(append_to_list): remove function
(insert_into_list): use list looping macro
(insert_into_list): use list add entry macro
(remove_from_list): remove function
(get_window_list): use list looping macro
* src/main.c (main): do not call init_window_list()
* src/manage.c (unmanage): use list delete macro
(map_window): likewise
(withdraw_window): use list moving macro to move entry to
another list.
(hide_others): use list looping macro
* src/split.c (num_frames): use list looping macro
(frames_screen): likewise
(maximize_all_windows_in_frame): likewise
(delete_frame_from_list): remove function
(create_initial_frame): remove list init code. Add current frame
to screen's frame list.
(init_frame_list): use list init macro
(find_last_frame): use list looping macro
(find_windows_frame): likewise
(find_frame_next): use list next entry macro
(find_frame_prev): use list previous entry macro
(find_window_for_frame): use list looping macro
(split_frame): use list add entry macro
(remove_all_splits): use list looping macro
(resize_frame_vertically): likewise
(resize_frame_horizontally): likewise
(total_frame_area): likewise
(frame_overlaps): likewise
(remove_frame): likewise
(find_frame_up): likewise
(find_frame_down): likewise
(find_frame_left): likewise
(find_frame_right): likewise
Diffstat (limited to 'src/ratpoison.h')
-rw-r--r-- | src/ratpoison.h | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/ratpoison.h b/src/ratpoison.h index 99b6409..ca2d169 100644 --- a/src/ratpoison.h +++ b/src/ratpoison.h @@ -31,32 +31,26 @@ #include <stdarg.h> #include <X11/Xlib.h> -/* Some error reporting macros */ -#define PRE_PRINT_LOCATION fprintf (stderr, "%s:%s():%d: ", __FILE__, __FUNCTION__, __LINE__); +/* Helper macro for error and debug reporting. */ +#define PRINT_LINE(type) printf (PACKAGE ":%s:%d: %s: ",__FILE__, __LINE__, #type) -/* FIXME: Some preprocessors don't have variable args. In that case - they don't get error or debugging output. */ -#ifdef HAVE_VARARG_MACROS +/* Error and debug reporting macros. */ +#define PRINT_ERROR(fmt) \ +do { \ + PRINT_LINE (error); \ + printf fmt; \ +} while (0) -#define PRINT_ERROR(format, args...) \ - { fprintf (stderr, PACKAGE ":error -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); } - -/* Some debugging macros */ #ifdef DEBUG -# define PRINT_DEBUG(format, args...) \ - { fprintf (stderr, PACKAGE ":debug -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); } +#define PRINT_DEBUG(fmt) \ +do { \ + PRINT_LINE (debug); \ + printf fmt; \ +} while (0) #else -# define PRINT_DEBUG(format, args...) +#define PRINT_DEBUG(fmt) #endif /* DEBUG */ -#else /* !HAVE_VARARG_MACROS */ - -#define PRINT_ERROR (void) -#define PRINT_DEBUG (void) - -#endif /* HAVE_VARARG_MACROS */ - - extern XGCValues gv; #include "conf.h" |