static local functions and data; almost identical diff from Thomas Pfaff

ok oga@
This commit is contained in:
okan 2009-06-26 12:21:58 +00:00
parent b13d592c57
commit f44862be9c
7 changed files with 30 additions and 32 deletions

View File

@ -40,6 +40,7 @@ struct conf Conf;
static void sigchld_cb(int);
static void dpy_init(const char *);
static int x_errorhandler(Display *, XErrorEvent *);
static void x_setup(void);
static void x_setupscreen(struct screen_ctx *, u_int);
static void x_teardown(void);
@ -89,7 +90,7 @@ main(int argc, char **argv)
return (0);
}
void
static void
dpy_init(const char *dpyname)
{
int i;
@ -103,7 +104,7 @@ dpy_init(const char *dpyname)
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
}
void
static void
x_setup(void)
{
struct screen_ctx *sc;
@ -130,7 +131,7 @@ x_setup(void)
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
}
void
static void
x_teardown(void)
{
struct screen_ctx *sc;
@ -141,7 +142,7 @@ x_teardown(void)
XCloseDisplay(X_Dpy);
}
void
static void
x_setupscreen(struct screen_ctx *sc, u_int which)
{
Window *wins, w0, w1;
@ -200,11 +201,9 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
screen_init_xinerama(sc);
XSync(X_Dpy, False);
return;
}
int
static int
x_errorhandler(Display *dpy, XErrorEvent *e)
{
#ifdef DEBUG

View File

@ -324,7 +324,6 @@ struct mwm_hints {
int input_keycodetrans(KeyCode, u_int, enum ctltype *,
char *);
int x_errorhandler(Display *, XErrorEvent *);
__dead void usage(void);
struct client_ctx *client_find(Window);
@ -346,17 +345,11 @@ void client_warp(struct client_ctx *);
void client_ptrwarp(struct client_ctx *);
void client_ptrsave(struct client_ctx *);
void client_draw_border(struct client_ctx *);
void client_update(struct client_ctx *);
void client_placecalc(struct client_ctx *);
void client_maximize(struct client_ctx *);
void client_vertmaximize(struct client_ctx *);
void client_map(struct client_ctx *);
void client_mtf(struct client_ctx *);
struct client_ctx *client_cycle(int);
struct client_ctx *client_mrunext(struct client_ctx *);
struct client_ctx *client_mruprev(struct client_ctx *);
void client_gethints(struct client_ctx *);
void client_freehints(struct client_ctx *);
struct menu *menu_filter(struct menu_q *, char *, char *, int,
void (*)(struct menu_q *, struct menu_q *, char *),
@ -407,9 +400,7 @@ void conf_client(struct client_ctx *);
void conf_grab(struct conf *, struct keybinding *);
void conf_ungrab(struct conf *, struct keybinding *);
void conf_bindname(struct conf *, char *, char *);
void conf_unbind(struct conf *, struct keybinding *);
void conf_mousebind(struct conf *, char *, char *);
void conf_mouseunbind(struct conf *, struct mousebinding *);
void conf_grab_mouse(struct client_ctx *);
void conf_reload(struct conf *);
void conf_font(struct conf *);

View File

@ -21,7 +21,13 @@
#include "headers.h"
#include "calmwm.h"
static int client_inbound(struct client_ctx *, int, int);
static struct client_ctx *client_mrunext(struct client_ctx *);
static struct client_ctx *client_mruprev(struct client_ctx *);
static void client_placecalc(struct client_ctx *);
static void client_update(struct client_ctx *);
static void client_gethints(struct client_ctx *);
static void client_freehints(struct client_ctx *);
static int client_inbound(struct client_ctx *, int, int);
static char emptystring[] = "";
struct client_ctx *_curcc = NULL;
@ -407,7 +413,7 @@ client_draw_border(struct client_ctx *cc)
XSetWindowBorder(X_Dpy, cc->win, pixel);
}
void
static void
client_update(struct client_ctx *cc)
{
Atom *p;
@ -522,7 +528,7 @@ client_cycle(int reverse)
return (newcc);
}
struct client_ctx *
static struct client_ctx *
client_mrunext(struct client_ctx *cc)
{
struct screen_ctx *sc = CCTOSC(cc);
@ -532,7 +538,7 @@ client_mrunext(struct client_ctx *cc)
ccc : TAILQ_FIRST(&sc->mruq));
}
struct client_ctx *
static struct client_ctx *
client_mruprev(struct client_ctx *cc)
{
struct screen_ctx *sc = CCTOSC(cc);
@ -542,7 +548,7 @@ client_mruprev(struct client_ctx *cc)
ccc : TAILQ_LAST(&sc->mruq, cycle_entry_q));
}
void
static void
client_placecalc(struct client_ctx *cc)
{
struct screen_ctx *sc = CCTOSC(cc);
@ -629,7 +635,7 @@ client_mtf(struct client_ctx *cc)
TAILQ_INSERT_HEAD(&sc->mruq, cc, mru_entry);
}
void
static void
client_gethints(struct client_ctx *cc)
{
XClassHint xch;
@ -675,7 +681,7 @@ client_gethints(struct client_ctx *cc)
}
}
void
static void
client_freehints(struct client_ctx *cc)
{
if (cc->app_name != NULL)

11
conf.c
View File

@ -28,6 +28,9 @@
((tsp)->tv_sec cmp (usp)->tv_sec))
#endif
static void conf_mouseunbind(struct conf *, struct mousebinding *);
static void conf_unbind(struct conf *, struct keybinding *);
extern struct screen_ctx *Curscreen;
/* Add an command menu entry to the end of the menu */
@ -278,7 +281,7 @@ conf_client(struct client_ctx *cc)
cc->flags |= ignore ? CLIENT_IGNORE : 0;
}
struct {
static struct {
char *tag;
void (*handler)(struct client_ctx *, union arg *);
int flags;
@ -493,7 +496,7 @@ conf_bindname(struct conf *c, char *name, char *binding)
return;
}
void
static void
conf_unbind(struct conf *c, struct keybinding *unbind)
{
struct keybinding *key = NULL, *keynxt;
@ -515,7 +518,7 @@ conf_unbind(struct conf *c, struct keybinding *unbind)
}
}
struct {
static struct {
char *tag;
void (*handler)(struct client_ctx *, void *);
int context;
@ -583,7 +586,7 @@ conf_mousebind(struct conf *c, char *name, char *binding)
}
}
void
static void
conf_mouseunbind(struct conf *c, struct mousebinding *unbind)
{
struct mousebinding *mb = NULL, *mbnxt;

6
menu.c
View File

@ -43,7 +43,7 @@ static struct menu *menu_handle_key(XEvent *, struct menu_ctx *,
struct menu_q *, struct menu_q *);
static void menu_handle_move(XEvent *, struct menu_ctx *,
struct screen_ctx *);
struct menu *menu_handle_release(XEvent *, struct menu_ctx *,
static struct menu *menu_handle_release(XEvent *, struct menu_ctx *,
struct screen_ctx *, struct menu_q *);
static void menu_draw(struct screen_ctx *, struct menu_ctx *,
struct menu_q *, struct menu_q *);
@ -349,7 +349,7 @@ menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
0, 0, mc->width, font_height());
}
void
static void
menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
{
mc->prev = mc->entry;
@ -366,7 +366,7 @@ menu_handle_move(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc)
xu_ptr_regrab(MenuGrabMask, Cursor_default);
}
struct menu *
static struct menu *
menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
struct menu_q *resultq)
{

View File

@ -21,7 +21,6 @@
#include "headers.h"
#include "calmwm.h"
extern struct screen_ctx_q Screenq;
extern struct screen_ctx *Curscreen;
void

View File

@ -21,7 +21,7 @@
#include "headers.h"
#include "calmwm.h"
unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
static unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
int
xu_ptr_grab(Window win, int mask, Cursor curs)