diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:23 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:23 +0000 |
commit | dc0f15394719e18bb9b01e70468f4d9908488d35 (patch) | |
tree | 7ab8dfcac5f42c5c2951a6007e45a45d53a09537 | |
parent | e29f1f1ed2128d7382a72ccb1684045fe4bc8183 (diff) |
XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1
-rw-r--r-- | exec.c | 59 | ||||
-rw-r--r-- | handle.c | 273 | ||||
-rw-r--r-- | wq.h | 6 | ||||
-rw-r--r-- | xmodmap.c | 17 | ||||
-rw-r--r-- | xmodmap.h | 30 | ||||
-rw-r--r-- | xmodmap.man | 26 |
6 files changed, 212 insertions, 199 deletions
@@ -56,6 +56,7 @@ from The Open Group. * Author: Jim Fulton, MIT X Consortium; derived from parts of the * original xmodmap, written by David Rosenthal, of Sun Microsystems. */ +/* $XFree86: xc/programs/xmodmap/exec.c,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xlib.h> @@ -63,8 +64,8 @@ from The Open Group. #include "xmodmap.h" #include "wq.h" -static mapping_busy_key (timeout) - int timeout; +static void +mapping_busy_key(int timeout) { int i; unsigned char keymap[32]; @@ -81,15 +82,15 @@ static mapping_busy_key (timeout) KeySym ks = XKeycodeToKeysym (dpy, (KeyCode) i, 0); char *cp = XKeysymToString (ks); fprintf (stderr, " %s (keysym 0x%x, keycode %d)\n", - cp ? cp : "UNNAMED", ks, i); + cp ? cp : "UNNAMED", (unsigned int)ks, i); } } sleep (timeout); return; } -static mapping_busy_pointer (timeout) - int timeout; +static void +mapping_busy_pointer(int timeout) { int i; Window root, child; /* dummy variables */ @@ -119,8 +120,8 @@ static mapping_busy_pointer (timeout) * and deals with retransmissions due to the keyboard being busy. */ -int UpdateModifierMapping (map) - XModifierKeymap *map; +int +UpdateModifierMapping(XModifierKeymap *map) { int retries, timeout; @@ -155,10 +156,8 @@ int UpdateModifierMapping (map) * AddModifier - this adds a keycode to the modifier list */ -int AddModifier (mapp, keycode, modifier) - XModifierKeymap **mapp; - KeyCode keycode; - int modifier; +int +AddModifier(XModifierKeymap **mapp, KeyCode keycode, int modifier) { if (keycode) { *mapp = XInsertModifiermapEntry (*mapp, keycode, modifier); @@ -174,10 +173,8 @@ int AddModifier (mapp, keycode, modifier) * DeleteModifier - this removes a keycode from the modifier list */ -int RemoveModifier (mapp, keycode, modifier) - XModifierKeymap **mapp; - KeyCode keycode; - int modifier; +int +RemoveModifier(XModifierKeymap **mapp, KeyCode keycode, int modifier) { if (keycode) { *mapp = XDeleteModifiermapEntry (*mapp, keycode, modifier); @@ -193,9 +190,8 @@ int RemoveModifier (mapp, keycode, modifier) * ClearModifier - this removes all entries from the modifier list */ -int ClearModifier (mapp, modifier) - XModifierKeymap **mapp; - int modifier; +int +ClearModifier(XModifierKeymap **mapp, int modifier) { int i; XModifierKeymap *map = *mapp; @@ -212,10 +208,8 @@ int ClearModifier (mapp, modifier) /* * print the contents of the map */ - -PrintModifierMapping (map, fp) - XModifierKeymap *map; - FILE *fp; +void +PrintModifierMapping(XModifierKeymap *map, FILE *fp) { int i, k = 0; @@ -242,10 +236,8 @@ PrintModifierMapping (map, fp) return; } - -PrintKeyTable (exprs, fp) - Bool exprs; - FILE *fp; +void +PrintKeyTable(Bool exprs, FILE *fp) { int i; int min_keycode, max_keycode, keysyms_per_keycode; @@ -287,11 +279,12 @@ PrintKeyTable (exprs, fp) else s = "NoSymbol"; if (!exprs) - fprintf (fp, "0x%04x (%s)\t", ks, s ? s : "no name"); + fprintf (fp, "0x%04x (%s)\t", + (unsigned int)ks, s ? s : "no name"); else if (s) fprintf (fp, " %s", s); else - fprintf (fp, " 0x%04x", ks); + fprintf (fp, " 0x%04x", (unsigned int)ks); } keymap += keysyms_per_keycode; fprintf (fp, "\n"); @@ -301,9 +294,8 @@ PrintKeyTable (exprs, fp) return; } - -PrintPointerMap (fp) - FILE *fp; +void +PrintPointerMap(FILE *fp) { unsigned char pmap[256]; /* there are 8 bits of buttons */ int count, i; @@ -327,9 +319,8 @@ PrintPointerMap (fp) * SetPointerMap - set the pointer map */ -int SetPointerMap (map, n) - unsigned char *map; - int n; +int +SetPointerMap(unsigned char *map, int n) { unsigned char defmap[MAXBUTTONCODES]; int j; @@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/xmodmap/handle.c,v 3.7 2001/12/14 20:02:13 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xlib.h> @@ -33,6 +34,7 @@ from The Open Group. #include <ctype.h> #include "xmodmap.h" #include "wq.h" +#include <stdlib.h> static XModifierKeymap *map = NULL; @@ -51,10 +53,8 @@ struct wq work_queue = {NULL, NULL}; * common utility routines */ -KeyCode *KeysymToKeycodes(dpy, keysym, pnum_kcs) - Display *dpy; - KeySym keysym; - int *pnum_kcs; +static KeyCode * +KeysymToKeycodes(Display *dpy, KeySym keysym, int *pnum_kcs) { KeyCode *kcs = NULL; int i, j; @@ -66,8 +66,8 @@ KeyCode *KeysymToKeycodes(dpy, keysym, pnum_kcs) if (!kcs) kcs = (KeyCode *)malloc(sizeof(KeyCode)); else - kcs = (KeyCode *)realloc((char *)kcs, - sizeof(KeyCode) * (*pnum_kcs + 1)); + kcs = (KeyCode *)realloc((char *)kcs, + sizeof(KeyCode) * (*pnum_kcs + 1)); kcs[*pnum_kcs] = i; *pnum_kcs += 1; break; @@ -77,9 +77,8 @@ KeyCode *KeysymToKeycodes(dpy, keysym, pnum_kcs) return kcs; } -char *copy_to_scratch (s, len) - char *s; - int len; +static char * +copy_to_scratch(char *s, int len) { static char *buf = NULL; static int buflen = 0; @@ -98,33 +97,48 @@ char *copy_to_scratch (s, len) return (buf); } -static badheader () +static void +badheader(void) { fprintf (stderr, "%s: %s:%d: bad ", ProgramName, inputFilename, lineno); parse_errors++; } +#define badmsg0(what) { badheader(); fprintf (stderr, what); \ + putc ('\n', stderr); } + #define badmsg(what,arg) { badheader(); fprintf (stderr, what, arg); \ putc ('\n', stderr); } #define badmsgn(what,s,len) badmsg (what, copy_to_scratch (s, len)) -void initialize_map () +void +initialize_map (void) { map = XGetModifierMapping (dpy); return; } -static void do_keycode(), do_keysym(), finish_keycodes(); -static void do_add(), do_remove(), do_clear(), do_pointer(); -static int get_keysym_list(); +static void do_keycode ( char *line, int len ); +static void do_keysym ( char *line, int len ); +static void finish_keycodes ( char *line, int len, KeyCode *keycodes, + int count ); +static void do_add ( char *line, int len ); +static void do_remove ( char *line, int len ); +static void do_clear ( char *line, int len ); +static void do_pointer ( char *line, int len ); +static int get_keysym_list ( char *line, int len, int *np, KeySym **kslistp ); + +static void print_opcode(union op *op); -int skip_word(), skip_space(), skip_chars(); +static int skip_word ( char *s, int len ); +static int skip_chars ( char *s, int len ); +static int skip_space ( char *s, int len ); static struct dt { char *command; /* name of input command */ int length; /* length of command */ - void (*proc)(); /* handler */ + void (*proc)(char *, int); /* handler */ } dispatch_table[] = { { "keycode", 7, do_keycode }, { "keysym", 6, do_keysym }, @@ -139,9 +153,9 @@ static struct dt { * and trailing whitespace removed) and builds up the work queue. */ -void handle_line (line, len) - char *line; /* string to parse */ - int len; /* length of line */ +void +handle_line(char *line, /* string to parse */ + int len) /* length of line */ { int n; struct dt *dtp; @@ -173,9 +187,8 @@ void handle_line (line, len) * the following routines are useful for parsing */ -int skip_word (s, len) - register char *s; - register int len; +static int +skip_word (char *s, int len) { register int n; @@ -183,9 +196,8 @@ int skip_word (s, len) return (n + skip_space (s+n, len-n)); } -int skip_chars (s, len) - register char *s; - register int len; +static int +skip_chars(char *s, int len) { register int i; @@ -197,9 +209,8 @@ int skip_chars (s, len) return (i); } -int skip_space (s, len) - register char *s; - register int len; +static int +skip_space(char *s, int len) { register int i; @@ -212,10 +223,8 @@ int skip_space (s, len) } -int skip_until_char (s, len, c) - register char *s; - register int len; - register char c; +static int +skip_until_char(char *s, int len, char c) { register int i; @@ -225,11 +234,9 @@ int skip_until_char (s, len, c) return (i); } -int skip_until_chars (s, len, cs, cslen) - char *s; - int len; - register char *cs; - register int cslen; +#if 0 +static int +skip_until_chars(char *s, int len, char *cs, int cslen) { int i; @@ -244,6 +251,7 @@ int skip_until_chars (s, len, cs, cslen) done: return (i); } +#endif /* * The action routines. @@ -259,9 +267,8 @@ int skip_until_chars (s, len, cs, cslen) * inputFilename name of the file being processed * lineno line number of current line in input file */ - -add_to_work_queue (p) /* this can become a macro someday */ - union op *p; +static void +add_to_work_queue(union op *p) /* this can become a macro someday */ { if (work_queue.head == NULL) { /* nothing on the list */ work_queue.head = work_queue.tail = p; /* head, tail, no prev */ @@ -277,9 +284,9 @@ add_to_work_queue (p) /* this can become a macro someday */ return; } -char *copystring (s, len) - char *s; - int len; +#if 0 +static char * +copystring(char *s, int len) { char *retval; @@ -290,10 +297,10 @@ char *copystring (s, len) } return (retval); } +#endif -static Bool parse_number (str, val) - char *str; - unsigned long *val; +static Bool +parse_number(char *str, unsigned long *val) { char *fmt = "%ld"; @@ -312,11 +319,8 @@ static Bool parse_number (str, val) return (sscanf (str, fmt, val) == 1); } -static Bool parse_keysym (line, n, name, keysym) - char *line; - int n; - char **name; - KeySym *keysym; +static Bool +parse_keysym(char *line, int n, char **name, KeySym *keysym) { *name = copy_to_scratch (line, n); if (!strcmp(*name, "NoSymbol")) { @@ -339,34 +343,37 @@ static Bool parse_keysym (line, n, name, keysym) * listed. */ -static void do_keycode (line, len) - char *line; - int len; +static void +do_keycode(char *line, int len) { int dummy; char *fmt = "%d"; KeyCode keycode; if (len < 3 || !line || *line == '\0') { /* 5=a minimum */ - badmsg ("keycode input line", NULL); + badmsg0 ("keycode input line"); return; } + /* + * We need not bother to advance line/len past the + * number (or the string 'any') as finish_keycodes() will + * first advance past the '='. + */ if (!strncmp("any", line, 3)) { keycode = 0; - len += 3; } else { if (*line == '0') line++, len--, fmt = "%o"; if (*line == 'x' || *line == 'X') line++, len--, fmt = "%x"; dummy = 0; if (sscanf (line, fmt, &dummy) != 1 || dummy == 0) { - badmsg ("keycode value", NULL); + badmsg0 ("keycode value"); return; } keycode = (KeyCode) dummy; if ((int)keycode < min_keycode || (int)keycode > max_keycode) { - badmsg ("keycode value (out of range)", NULL); + badmsg0 ("keycode value (out of range)"); return; } } @@ -384,9 +391,8 @@ static void do_keycode (line, len) * The left keysyms has to be checked for validity and evaluated. */ -static void do_keysym (line, len) - char *line; - int len; +static void +do_keysym(char *line, int len) { int n; KeyCode *keycodes; @@ -394,13 +400,13 @@ static void do_keysym (line, len) char *tmpname; if (len < 3 || !line || *line == '\0') { /* a=b minimum */ - badmsg ("keysym input line", NULL); + badmsg0 ("keysym input line"); return; } n = skip_chars (line, len); if (n < 1) { - badmsg ("target keysym name", NULL); + badmsg0 ("target keysym name"); return; } if (!parse_keysym(line, n, &tmpname, &keysym)) { @@ -426,11 +432,8 @@ static void do_keysym (line, len) finish_keycodes (line, len, keycodes, n); } -static void finish_keycodes (line, len, keycodes, count) - char *line; - int len; - KeyCode *keycodes; - int count; +static void +finish_keycodes(char *line, int len, KeyCode *keycodes, int count) { int n; KeySym *kslist; @@ -441,7 +444,7 @@ static void finish_keycodes (line, len, keycodes, count) line += n, len -= n; if (len < 1 || *line != '=') { /* = minimum */ - badmsg ("keycode command (missing keysym list),", NULL); + badmsg0 ("keycode command (missing keysym list),"); return; } line++, len--; /* skip past the = */ @@ -493,9 +496,8 @@ struct modtab modifier_table[] = { /* keep in order so it can be index */ { "ctrl", 4, 2 }, { NULL, 0, 0 }}; -static int parse_modifier (line, n) - register char *line; - register int n; +static int +parse_modifier(char *line, int n) { register int i; struct modtab *mt; @@ -522,9 +524,8 @@ static int parse_modifier (line, n) * is not important. There should also be an alias Ctrl for control. */ -static void do_add (line, len) - char *line; - int len; +static void +do_add(char *line, int len) { int n; int modifier; @@ -533,7 +534,7 @@ static void do_add (line, len) struct op_addmodifier *opam; if (len < 6 || !line || *line == '\0') { /* Lock=a minimum */ - badmsg ("add modifier input line", NULL); + badmsg0 ("add modifier input line"); return; } @@ -552,7 +553,7 @@ static void do_add (line, len) line += n, len -= n; n = skip_until_char (line, len, '='); if (n < 0) { - badmsg ("add modifier = keysym", NULL); + badmsg0 ("add modifier = keysym"); return; } @@ -563,7 +564,7 @@ static void do_add (line, len) if (get_keysym_list (line, len, &n, &kslist) < 0) return; if (n == 0) { - badmsg ("add modifier keysym list (empty)", NULL); + badmsg0 ("add modifier keysym list (empty)"); return; } @@ -587,9 +588,8 @@ static void do_add (line, len) /* * make_add - stick a single add onto the queue */ -static void make_add (modifier, keysym) - int modifier; - KeySym keysym; +static void +make_add(int modifier, KeySym keysym) { union op *uop; struct op_addmodifier *opam; @@ -628,9 +628,8 @@ static void make_add (modifier, keysym) * is not important. There should also be an alias Ctrl for control. */ -static void do_remove (line, len) - char *line; - int len; +static void +do_remove(char *line, int len) { int n; int nc; @@ -643,7 +642,7 @@ static void do_remove (line, len) struct op_removemodifier *oprm; if (len < 6 || !line || *line == '\0') { /* Lock=a minimum */ - badmsg ("remove modifier input line", NULL); + badmsg0 ("remove modifier input line"); return; } @@ -662,7 +661,7 @@ static void do_remove (line, len) line += n, len -= n; n = skip_until_char (line, len, '='); if (n < 0) { - badmsg ("remove modifier = keysym", NULL); + badmsg0 ("remove modifier = keysym"); return; } @@ -673,7 +672,7 @@ static void do_remove (line, len) if (get_keysym_list (line, len, &n, &kslist) < 0) return; if (n == 0) { - badmsg ("remove modifier keysym list (empty)", NULL); + badmsg0 ("remove modifier keysym list (empty)"); return; } @@ -746,9 +745,8 @@ static void do_remove (line, len) /* * make_remove - stick a single remove onto the queue */ -static void make_remove (modifier, keycode) - int modifier; - KeyCode keycode; +static void +make_remove(int modifier, KeyCode keycode) { union op *uop; struct op_removemodifier *oprm; @@ -786,9 +784,8 @@ static void make_remove (modifier, keycode) * ^ */ -static void do_clear (line, len) - char *line; - int len; +static void +do_clear(char *line, int len) { int n; int modifier; @@ -796,7 +793,7 @@ static void do_clear (line, len) struct op_clearmodifier *opcm; if (len < 4 || !line || *line == '\0') { /* Lock minimum */ - badmsg ("clear modifier input line", NULL); + badmsg0 ("clear modifier input line"); return; } @@ -815,7 +812,7 @@ static void do_clear (line, len) uop = AllocStruct (union op); if (!uop) { - badmsg ("attempt to allocate %d byte clearmodifier opcode", + badmsg ("attempt to allocate %ld byte clearmodifier opcode", (long) sizeof (struct op_clearmodifier)); return; } @@ -827,9 +824,8 @@ static void do_clear (line, len) add_to_work_queue (uop); } -static int strncmp_nocase (a, b, n) - char *a, *b; - int n; +static int +strncmp_nocase(char *a, char *b, int n) { int i; int a1, b1; @@ -855,9 +851,8 @@ static int strncmp_nocase (a, b, n) * ^ */ -static void do_pointer (line, len) - char *line; - int len; +static void +do_pointer(char *line, int len) { int n; int i; @@ -870,7 +865,7 @@ static void do_pointer (line, len) Bool ok; if (len < 2 || !line || *line == '\0') { /* =1 minimum */ - badmsg ("buttons input line", NULL); + badmsg0 ("buttons input line"); return; } @@ -880,7 +875,7 @@ static void do_pointer (line, len) line += n, len -= n; if (line[0] != '=') { - badmsg ("buttons pointer code list, missing equal sign", NULL); + badmsg0 ("buttons pointer code list, missing equal sign"); return; } @@ -946,11 +941,8 @@ static void do_pointer (line, len) * and adding it to the list. */ -static int get_keysym_list (line, len, np, kslistp) - char *line; - int len; - int *np; - KeySym **kslistp; +static int +get_keysym_list(char *line, int len, int *np, KeySym **kslistp) { int havesofar, maxcanhave; KeySym *keysymlist; @@ -980,7 +972,7 @@ static int get_keysym_list (line, len, np, kslistp) n = skip_chars (line, len); if (n < 0) { - badmsg ("keysym name list", NULL); + badmsg0 ("keysym name list"); return (-1); } @@ -1027,10 +1019,8 @@ static int get_keysym_list (line, len, np, kslistp) * 8 by map->max_keypermod keycodes. */ -static void check_special_keys (keycode, n, kslist) - KeyCode keycode; - int n; - KeySym *kslist; +static void +check_special_keys(KeyCode keycode, int n, KeySym *kslist) { int i; /* iterator variable */ KeyCode *kcp; /* keycode pointer */ @@ -1087,7 +1077,8 @@ static void check_special_keys (keycode, n, kslist) * print_work_queue - disassemble the work queue and print it on stdout */ -void print_work_queue () +void +print_work_queue(void) { union op *op; @@ -1098,8 +1089,8 @@ void print_work_queue () return; } -void print_opcode (op) - union op *op; +static void +print_opcode(union op *op) { int i; @@ -1155,11 +1146,15 @@ void print_opcode (op) * execute_work_queue - do the real meat and potatoes now that we know what * we need to do and that all of the input is correct. */ +static int exec_keycode ( struct op_keycode *opk ); +static int exec_add ( struct op_addmodifier *opam ); +static int exec_remove ( struct op_removemodifier *oprm ); +static int exec_clear ( struct op_clearmodifier *opcm ); +static int exec_pointer ( struct op_pointer *opp ); -static int exec_keycode(), exec_add(), exec_remove(), exec_clear(); -static int exec_pointer(); -int execute_work_queue () +int +execute_work_queue (void) { union op *op; int errors; @@ -1200,26 +1195,26 @@ int execute_work_queue () dosync = 0; switch (op->generic.type) { case doKeycode: - if (exec_keycode (op) < 0) errors++; + if (exec_keycode (&op->keycode) < 0) errors++; if (op->keycode.target_keycode) dosync = 1; else dosync = -1; break; case doAddModifier: - if (exec_add (op) < 0) errors++; + if (exec_add (&op->addmodifier) < 0) errors++; else update_map = True; break; case doRemoveModifier: - if (exec_remove (op) < 0) errors++; + if (exec_remove (&op->removemodifier) < 0) errors++; else update_map = True; break; case doClearModifier: - if (exec_clear (op) < 0) errors++; + if (exec_clear (&op->clearmodifier) < 0) errors++; else update_map = True; break; case doPointer: - if (exec_pointer (op) < 0) errors++; + if (exec_pointer (&op->pointer) < 0) errors++; break; default: fprintf (stderr, "%s: unknown opcode %d\n", @@ -1235,8 +1230,8 @@ int execute_work_queue () return (errors > 0 ? -1 : 0); } -static int exec_keycode (opk) - struct op_keycode *opk; +static int +exec_keycode(struct op_keycode *opk) { if (!opk->target_keycode) { int i, j; @@ -1277,8 +1272,8 @@ static int exec_keycode (opk) return (0); } -static int exec_add (opam) - struct op_addmodifier *opam; +static int +exec_add(struct op_addmodifier *opam) { int i; int status; @@ -1299,8 +1294,8 @@ static int exec_add (opam) return (status); } -static int exec_remove (oprm) - struct op_removemodifier *oprm; +static int +exec_remove(struct op_removemodifier *oprm) { int i; int status; @@ -1313,33 +1308,35 @@ static int exec_remove (oprm) return (status); } -static int exec_clear (opcm) - struct op_clearmodifier *opcm; +static int +exec_clear(struct op_clearmodifier *opcm) { return (ClearModifier (&map, opcm->modifier)); } -static int exec_pointer (opp) - struct op_pointer *opp; +static int +exec_pointer(struct op_pointer *opp) { return (SetPointerMap (opp->button_codes, opp->count)); } -void print_modifier_map () +void +print_modifier_map(void) { PrintModifierMapping (map, stdout); return; } -void print_key_table (exprs) - Bool exprs; +void +print_key_table(Bool exprs) { PrintKeyTable (exprs, stdout); return; } -void print_pointer_map () +void +print_pointer_map(void) { PrintPointerMap (stdout); return; @@ -26,6 +26,10 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/xmodmap/wq.h,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ + +#ifndef _WQ_H +#define _WQ_H /* * Input is parsed and a work queue is built that is executed later. This @@ -141,3 +145,5 @@ extern struct modtab { #define AllocStruct(s) ((s *) malloc (sizeof (s))) #define MAXKEYSYMNAMESIZE 80 /* absurdly large */ + +#endif @@ -26,10 +26,12 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/xmodmap/xmodmap.c,v 1.7 2001/12/14 20:02:13 dawes Exp $ */ #include <X11/Xos.h> #include <X11/Xlib.h> #include <stdio.h> +#include <stdlib.h> #include <ctype.h> #include "xmodmap.h" @@ -39,8 +41,8 @@ int min_keycode, max_keycode; Bool verbose = False; Bool dontExecute = False; -void Exit (status) - int status; +static void +Exit(int status) { if (dpy) { XCloseDisplay (dpy); @@ -66,7 +68,8 @@ static char *help_message[] = { NULL}; -void usage () +static void +usage(void) { char **cpp; @@ -99,7 +102,8 @@ static char *grammar_message[] = { NULL }; -void grammar_usage () +static void +grammar_usage(void) { char **cpp; @@ -113,9 +117,8 @@ void grammar_usage () int parse_errors = 0; -main (argc, argv) - int argc; - char **argv; +int +main(int argc, char *argv[]) { int i; char *displayname = NULL; @@ -26,6 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/xmodmap/xmodmap.h,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ extern char *ProgramName; extern Display *dpy; @@ -36,13 +37,22 @@ extern char *inputFilename; extern int lineno; extern int parse_errors; -extern void initialize_map (); -extern void process_file (); -extern void process_line (); -extern void handle_line (); -extern void print_opcode (); -extern void print_work_queue (); -extern int execute_work_queue (); -extern void print_modifier_map (); -extern void print_key_table (); -extern void print_pointer_map (); +extern void initialize_map(void); +extern void process_file(char *filename); +extern void process_line(char *buffer); +extern void handle_line(char *line, int len); +extern void print_work_queue(void); +extern int execute_work_queue(void); +extern void print_modifier_map(void); +extern void print_key_table(Bool exprs); +extern void print_pointer_map(void); + +extern int UpdateModifierMapping(XModifierKeymap *map); +extern int AddModifier(XModifierKeymap **mapp, KeyCode keycode, int modifier); +extern int RemoveModifier(XModifierKeymap **mapp, KeyCode keycode, + int modifier); +extern int ClearModifier(XModifierKeymap **mapp, int modifier); +extern void PrintModifierMapping(XModifierKeymap *map, FILE *fp); +extern void PrintKeyTable(Bool exprs, FILE *fp); +extern void PrintPointerMap(FILE *fp); +extern int SetPointerMap(unsigned char *map, int n); diff --git a/xmodmap.man b/xmodmap.man index d23daca..9e5753e 100644 --- a/xmodmap.man +++ b/xmodmap.man @@ -23,6 +23,9 @@ .\" 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. +.\" +.\" $XFree86: xc/programs/xmodmap/xmodmap.man,v 1.11 2002/10/12 16:06:48 herrb Exp $ +.\" .de EX \"Begin example .ne 5 .if n .sp 1 @@ -36,9 +39,9 @@ .if n .sp 1 .if t .sp .5 .. -.TH XMODMAP 1 "Release 6.4" "X Version 11" +.TH XMODMAP 1 __xorgversion__ .SH NAME -xmodmap - utility for modifying keymaps (and pointer buttons) in X +xmodmap - utility for modifying keymaps and pointer button mappings in X .SH SYNOPSIS .B xmodmap [-options ...] [filename] @@ -119,9 +122,13 @@ conflicts. .B keycode \fINUMBER\fP = \fIKEYSYMNAME ...\fP The list of keysyms is assigned to the indicated keycode (which may be specified in decimal, hex or octal and can be determined by -running the -.I xev -program. +running the +.I xev +program. Up to eight keysyms may be attached to a key, however the last four +are not used in any major X server implementation. The first keysym is used +when no modifier key is pressed in conjunction with this key, the second with +Shift, the third when the Mode_Switch key is used with this key and the fourth +when both the Mode_Switch and Shift keys are used. .TP 8 .B keycode any = \fIKEYSYMNAME ...\fP If no existing key has the specified list of keysyms assigned to it, @@ -133,10 +140,9 @@ The \fIKEYSYMNAME\fP on the left hand side is translated into matching keycodes used to perform the corresponding set of \fBkeycode\fP expressions. The list of keysym names may be found in the header file \fI<X11/keysymdef.h>\fP (without the \fIXK_\fP prefix) -or the keysym database \fI<XRoot>/lib/X11/XKeysymDB\fP, where <XRoot> refers -to the root of the X11 install tree. -Note that if the same keysym is bound to multiple keys, the expression is -executed for each matching keycode. +or the keysym database \fI__projectroot__/lib/X11/XKeysymDB\fP. Note that +if the same keysym is bound to multiple keys, the expression is executed +for each matching keycode. .TP 8 .B clear \fIMODIFIERNAME\fP This removes all entries in the modifier map for the given modifier, where @@ -279,7 +285,7 @@ add Lock = Caps_Lock .B DISPLAY to get default host and display number. .SH SEE ALSO -X(1), xev(1), \fIXlib\fP documentation on key and pointer events +X(__miscmansuffix__), xev(1), \fIXlib\fP documentation on key and pointer events .SH BUGS .PP Every time a \fBkeycode\fP expression is evaluated, the server generates |