diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:49:12 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:49:12 +0000 |
commit | 53af03d591c7297c7b8c3e7f8c6f804677f8e325 (patch) | |
tree | 9df4cb951aa1ca966fc79a550d73bbc2637f65f5 | |
parent | 6dcad3b7ba5983633e4303c22446c3de8922c003 (diff) |
merge latest (4.3.99.16) from XFree86 (vendor) branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
-rw-r--r-- | makeform.c | 47 | ||||
-rw-r--r-- | readfile.c | 18 | ||||
-rw-r--r-- | xmessage.c | 41 |
3 files changed, 42 insertions, 64 deletions
@@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xmessage/makeform.c,v 1.6 2002/11/22 03:56:39 paulo Exp $ */ +/* $XFree86: xc/programs/xmessage/makeform.c,v 1.7 2003/04/14 23:03:13 herrb Exp $ */ #include <X11/Intrinsic.h> #include <X11/StringDefs.h> @@ -42,8 +42,7 @@ from the X Consortium. #include <X11/Xaw/Label.h> #include <X11/Xaw/Scrollbar.h> -extern const char *ProgramName; -extern int default_exitstatus; +#include "xmessage.h" typedef struct _ButtonRecord { char *name; @@ -52,15 +51,14 @@ typedef struct _ButtonRecord { Widget widget; } ButtonRecord; -static void unquote_pairs (br, n) - register ButtonRecord *br; - int n; +static void +unquote_pairs (ButtonRecord *br, int n) { int i; for (i = 0; i < n; i++) { - register char *dst, *src; - register int quoted = 0; + char *dst, *src; + int quoted = 0; for (src = dst = br->name; *src; src++) { if (quoted) { @@ -82,11 +80,10 @@ static void unquote_pairs (br, n) * sets brptr to point to parsed table * returns 0 if successful, -1 if not */ -static int parse_name_and_exit_code_list (buttonlist, brptr) - char *buttonlist; - ButtonRecord **brptr; +static int +parse_name_and_exit_code_list (char *buttonlist, ButtonRecord **brptr) { - register char *cp; + char *cp; int shouldfind = 0, npairs = 0; int default_exitcode = 100; int quoted = 0; @@ -199,10 +196,8 @@ static int parse_name_and_exit_code_list (buttonlist, brptr) } /* ARGSUSED */ -static void handle_button (w, closure, client_data) - Widget w; - XtPointer closure; - XtPointer client_data; +static void +handle_button (Widget w, XtPointer closure, XtPointer client_data) { ButtonRecord *br = (ButtonRecord *) closure; @@ -211,17 +206,15 @@ static void handle_button (w, closure, client_data) exit (br->exitstatus); } -Widget make_queryform(parent, msgstr, msglen, - button_list, print_value, default_button, - max_width, max_height) - Widget parent; /* into whom widget should be placed */ - char *msgstr; /* message string */ - int msglen; /* characters in msgstr */ - char *button_list; /* list of button title:status */ - Boolean print_value; /* print button string on stdout? */ - char *default_button; /* button activated by Return */ - Dimension max_width; - Dimension max_height; +Widget +make_queryform(Widget parent, /* into whom widget should be placed */ + char *msgstr, /* message string */ + int msglen, /* characters in msgstr */ + char *button_list, /* list of button title:status */ + Boolean print_value, /* print button string on stdout? */ + char *default_button, /* button activated by Return */ + Dimension max_width, + Dimension max_height) { ButtonRecord *br; int npairs, i; @@ -28,20 +28,21 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xmessage/readfile.c,v 1.2 2000/02/14 19:21:04 dawes Exp $ */ +/* $XFree86: xc/programs/xmessage/readfile.c,v 1.3 2003/04/14 23:03:13 herrb Exp $ */ #include <X11/Xos.h> /* for types.h */ #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> +#include "readfile.h" + /* * get_data_from_file - read data from a file into a single buffer; meant * for small files containing messages. */ -static char *get_data_from_file (filename, len_return) - char *filename; - int *len_return; +static char * +get_data_from_file (char *filename, int *len_return) { FILE *fp; struct stat statbuf; @@ -83,8 +84,8 @@ static char *get_data_from_file (filename, len_return) /* * get_data_from_stdin - read data from stdin into a single buffer. */ -static char *get_data_from_stdin (len_return) - int *len_return; +static char * +get_data_from_stdin (int *len_return) { char *cp; int count; @@ -122,9 +123,8 @@ static char *get_data_from_stdin (len_return) * read_file - read data from indicated file and return pointer to malloced * buffer. Returns NULL on error or if no such file. */ -char *read_file (filename, len) - char *filename; - int *len; /* returned */ +char * +read_file (char *filename, int *len /* returned */) { if (filename[0] == '-' && filename[1] == '\0') { return (get_data_from_stdin (len)); @@ -28,7 +28,7 @@ other dealings in this Software without prior written authorization from the X Consortium. */ -/* $XFree86: xc/programs/xmessage/xmessage.c,v 1.4 2000/02/17 16:53:03 dawes Exp $ */ +/* $XFree86: xc/programs/xmessage/xmessage.c,v 1.5 2003/04/14 23:03:13 herrb Exp $ */ #include <X11/Intrinsic.h> #include <X11/StringDefs.h> @@ -36,8 +36,8 @@ from the X Consortium. #include <stdio.h> #include <stdlib.h> -extern char *read_file(); -extern Widget make_queryform(); +#include "xmessage.h" +#include "readfile.h" /* * data used by xmessage @@ -100,8 +100,8 @@ static String fallback_resources[] = { * usage */ -static void usage (outf) - FILE *outf; +static void +usage (FILE *outf) { static const char *options[] = { " -file filename file to read message from, \"-\" for stdin", @@ -130,11 +130,7 @@ NULL}; static Atom wm_delete_window; /* ARGSUSED */ static void -exit_action(w, event, params, num_params) - Widget w; /* unused */ - XEvent *event; - String *params; - Cardinal *num_params; +exit_action(Widget w, XEvent *event, String *params, Cardinal *num_params) { int exit_status = 0; @@ -151,11 +147,8 @@ int default_exitstatus = -1; /* value of button named by -default */ /* ARGSUSED */ static void -default_exit_action(w, event, params, num_params) - Widget w; - XEvent *event; - String *params; - Cardinal *num_params; +default_exit_action(Widget w, XEvent *event, String *params, + Cardinal *num_params) { if (default_exitstatus >= 0) exit(default_exitstatus); @@ -172,9 +165,7 @@ static String top_trans = /* assumes shell widget has already been realized */ static void -position_near(shell, x, y) - Widget shell; - int x, y; +position_near(Widget shell, int x, int y) { int max_x, max_y; Dimension width, height, border; @@ -220,8 +211,7 @@ position_near(shell, x, y) } static void -position_near_mouse(shell) - Widget shell; +position_near_mouse(Widget shell) { int x, y; Window root, child; @@ -234,8 +224,7 @@ position_near_mouse(shell) } static void -position_near_center(shell) - Widget shell; +position_near_center(Widget shell) { position_near(shell, WidthOfScreen(XtScreen(shell))/2, @@ -244,9 +233,7 @@ position_near_center(shell) /* ARGSUSED */ static void -time_out(client_data, iid) - XtPointer client_data; - XtIntervalId *iid; +time_out(XtPointer client_data, XtIntervalId *iid) { exit(0); } @@ -256,9 +243,7 @@ time_out(client_data, iid) * then create the query box and go. Callbacks take care of exiting. */ int -main (argc, argv) - int argc; - char **argv; +main (int argc, char *argv[]) { Widget top, queryform; XtAppContext app_con; |