summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:23 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:23 +0000
commit955b24e6872aba60a6337b21cbfe346f99706c40 (patch)
tree9385d01368e5b101b0ccb4796d48f6e85cc683be
parent856b88d175fe3399a0fd34a4531931061eb8a309 (diff)
-rw-r--r--xkill.c70
-rw-r--r--xkill.man7
2 files changed, 40 insertions, 37 deletions
diff --git a/xkill.c b/xkill.c
index 816f3e8..b23b99d 100644
--- a/xkill.c
+++ b/xkill.c
@@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/programs/xkill/xkill.c,v 1.6 2001/12/14 20:02:06 dawes Exp $ */
/*
* xkill - simple program for destroying unwanted clients
@@ -37,6 +38,7 @@ from The Open Group.
*/
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/Xos.h>
@@ -52,11 +54,17 @@ char *ProgramName;
#define SelectButtonAny (-1)
#define SelectButtonFirst (-2)
-XID parse_id(), get_window_id();
-int parse_button(), verify_okay_to_kill();
-
-Exit (code)
- int code;
+static int parse_button ( char *s, int *buttonp );
+static XID parse_id ( char *s );
+static XID get_window_id ( Display *dpy, int screen, int button, char *msg );
+static int catch_window_errors ( Display *dpy, XErrorEvent *ev );
+static int kill_all_windows ( Display *dpy, int screenno, Bool top );
+static int verify_okay_to_kill ( Display *dpy, int screenno );
+static Bool wm_state_set ( Display *dpy, Window win );
+static Bool wm_running ( Display *dpy, int screenno );
+
+static void
+Exit(int code)
{
if (dpy) {
XCloseDisplay (dpy);
@@ -64,7 +72,8 @@ Exit (code)
exit (code);
}
-usage ()
+static void
+usage(void)
{
static char *options[] = {
"where options include:",
@@ -85,9 +94,8 @@ NULL};
Exit (1);
}
-main (argc, argv)
- int argc;
- char *argv[];
+int
+main(int argc, char *argv[])
{
int i; /* iterator, temp variable */
char *displayname = NULL; /* name of server to contact */
@@ -216,11 +224,12 @@ main (argc, argv)
}
Exit (0);
+ /*NOTREACHED*/
+ return 0;
}
-int parse_button (s, buttonp)
- register char *s;
- int *buttonp;
+static int
+parse_button(char *s, int *buttonp)
{
register char *cp;
@@ -250,8 +259,8 @@ int parse_button (s, buttonp)
}
-XID parse_id (s)
- char *s;
+static XID
+parse_id(char *s)
{
XID retval = None;
char *fmt = "%ld"; /* since XID is long */
@@ -264,11 +273,8 @@ XID parse_id (s)
return (retval);
}
-XID get_window_id (dpy, screen, button, msg)
- Display *dpy;
- int screen;
- int button;
- char *msg;
+static XID
+get_window_id(Display *dpy, int screen, int button, char *msg)
{
Cursor cursor; /* cursor to use when selecting */
Window root; /* the current root */
@@ -329,17 +335,14 @@ XID get_window_id (dpy, screen, button, msg)
}
-int catch_window_errors (dpy, ev)
- Display *dpy;
- XErrorEvent *ev;
+static int
+catch_window_errors(Display *dpy, XErrorEvent *ev)
{
return 0;
}
-int kill_all_windows (dpy, screenno, top)
- Display *dpy;
- int screenno;
- Bool top;
+static int
+kill_all_windows(Display *dpy, int screenno, Bool top)
{
Window root = RootWindow (dpy, screenno);
Window dummywindow;
@@ -377,9 +380,8 @@ int kill_all_windows (dpy, screenno, top)
/*
* ask the user to press in the root with each button in succession
*/
-int verify_okay_to_kill (dpy, screenno)
- Display *dpy;
- int screenno;
+static int
+verify_okay_to_kill(Display *dpy, int screenno)
{
unsigned char pointer_map[256];
int count = XGetPointerMapping (dpy, pointer_map, 256);
@@ -409,9 +411,8 @@ int verify_okay_to_kill (dpy, screenno)
/* Return True if the property WM_STATE is set on the window, otherwise
* return False.
*/
-Bool wm_state_set(dpy, win)
-Display *dpy;
-Window win;
+static Bool
+wm_state_set(Display *dpy, Window win)
{
Atom wm_state;
Atom actual_type;
@@ -433,9 +434,8 @@ Window win;
* otherwise, return False.
*/
-Bool wm_running(dpy, screenno)
-Display *dpy;
-int screenno;
+static Bool
+wm_running(Display *dpy, int screenno)
{
XWindowAttributes xwa;
Status status;
diff --git a/xkill.man b/xkill.man
index 015eb7d..7c7efeb 100644
--- a/xkill.man
+++ b/xkill.man
@@ -22,7 +22,10 @@
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
-.TH XKILL 1 "Release 6.4" "X Version 11"
+.\"
+.\" $XFree86: xc/programs/xkill/xkill.man,v 1.8 2001/12/14 20:02:06 dawes Exp $
+.\"
+.TH XKILL 1 __xorgversion__
.SH NAME
xkill - kill a client by its X resource
.SH SYNOPSIS
@@ -72,7 +75,7 @@ the root.
Specifies a specific pointer button number or the word "any" to use when
selecting windows.
.SH "SEE ALSO"
-X(1), xwininfo(1), XKillClient and XGetPointerMapping in the Xlib Programmers
+X(__miscmansuffix__), xwininfo(1), XKillClient and XGetPointerMapping in the Xlib Programmers
Manual, KillClient in the X Protocol Specification
.SH AUTHOR
Jim Fulton, MIT X Consortium