From f8c511568040d84b7ddc0bca5ba20757719bd808 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 12 Aug 2008 13:44:06 +0930 Subject: Indent consistently. indent -cbi 0 -nprs -nut -npcs -i4 -bli 0 *.c *.h --- setxkbmap.c | 1231 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 671 insertions(+), 560 deletions(-) (limited to 'setxkbmap.c') diff --git a/setxkbmap.c b/setxkbmap.c index d8cafa8..6368f65 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -80,42 +80,42 @@ #define NUM_STRING_VALS 13 /***====================================================================***/ -Bool print= False; -Bool synch= False; -int verbose= 5; +Bool print = False; +Bool synch = False; +int verbose = 5; -Display * dpy; +Display *dpy; -char * srcName[NUM_SOURCES] = { - "undefined", "X server", "rules file", "config file", "command line" +char *srcName[NUM_SOURCES] = { + "undefined", "X server", "rules file", "config file", "command line" }; -char * svName[NUM_STRING_VALS]= { - "rules file", "config file", "X display", "locale", - "keyboard model", "keyboard layout", "layout variant", - "keycodes", "types", "compatibility map", "symbols", "geometry", - "keymap" +char *svName[NUM_STRING_VALS] = { + "rules file", "config file", "X display", "locale", + "keyboard model", "keyboard layout", "layout variant", + "keycodes", "types", "compatibility map", "symbols", "geometry", + "keymap" }; -int svSrc[NUM_STRING_VALS]; -char * svValue[NUM_STRING_VALS]; +int svSrc[NUM_STRING_VALS]; +char *svValue[NUM_STRING_VALS]; -XkbConfigRtrnRec cfgResult; +XkbConfigRtrnRec cfgResult; -XkbRF_RulesPtr rules= NULL; -XkbRF_VarDefsRec rdefs; +XkbRF_RulesPtr rules = NULL; +XkbRF_VarDefsRec rdefs; -Bool clearOptions= False; -int szOptions= 0; -int numOptions= 0; -char ** options= NULL; +Bool clearOptions = False; +int szOptions = 0; +int numOptions = 0; +char **options = NULL; -int szInclPath= 0; -int numInclPath= 0; -char ** inclPath= NULL; +int szInclPath = 0; +int numInclPath = 0; +char **inclPath = NULL; -XkbDescPtr xkb= NULL; +XkbDescPtr xkb = NULL; -int deviceSpec = XkbUseCoreKbd; +int deviceSpec = XkbUseCoreKbd; /***====================================================================***/ @@ -139,66 +139,73 @@ int deviceSpec = XkbUseCoreKbd; /***====================================================================***/ -Bool addToList ( int *sz, int *num, char ***listIn, char *newVal ); -void usage ( int argc, char ** argv ); -void dumpNames ( Bool wantRules, Bool wantCNames ); -void trySetString ( int which, char * newVal, int src ); -Bool setOptString ( int *arg, int argc, char **argv, int which, int src ); -int parseArgs ( int argc, char ** argv ); -Bool getDisplay ( int argc, char ** argv ); -Bool getServerValues ( void ); -FILE * findFileInPath ( char * name, char * subdir ); -Bool addStringToOptions ( char * opt_str, int * sz_opts, int * num_opts, char *** opts ); -char * stringFromOptions ( char * orig, int numNew, char ** newOpts ); -Bool applyConfig ( char * name ); -Bool applyRules ( void ); -Bool applyComponentNames ( void ); -void printKeymap( void ); +Bool addToList(int *sz, int *num, char ***listIn, char *newVal); +void usage(int argc, char **argv); +void dumpNames(Bool wantRules, Bool wantCNames); +void trySetString(int which, char *newVal, int src); +Bool setOptString(int *arg, int argc, char **argv, int which, int src); +int parseArgs(int argc, char **argv); +Bool getDisplay(int argc, char **argv); +Bool getServerValues(void); +FILE *findFileInPath(char *name, char *subdir); +Bool addStringToOptions(char *opt_str, int *sz_opts, int *num_opts, + char ***opts); +char *stringFromOptions(char *orig, int numNew, char **newOpts); +Bool applyConfig(char *name); +Bool applyRules(void); +Bool applyComponentNames(void); +void printKeymap(void); /***====================================================================***/ Bool -addToList(int *sz,int *num,char ***listIn,char *newVal) +addToList(int *sz, int *num, char ***listIn, char *newVal) { -register int i; -char **list; - - if ((!newVal)||(!newVal[0])) { - *num= 0; - return True; - } - list= *listIn; - for (i=0;i<*num;i++) { - if (streq(list[i],newVal)) - return True; - } - if ((list==NULL)||(*sz<1)) { - *num= 0; - *sz= 4; - list= (char **)calloc(*sz,sizeof(char *)); - *listIn= list; - } - else if (*num>=*sz) { - *sz*= 2; - list= (char **)realloc(list,(*sz)*sizeof(char *)); - *listIn= list; - } - if (!list) { - ERR("Internal Error! Allocation failure in add to list!\n"); - ERR(" Exiting.\n"); - exit(-1); - } - list[*num]= strdup(newVal); - (*num)= (*num)+1; + register int i; + char **list; + + if ((!newVal) || (!newVal[0])) + { + *num = 0; + return True; + } + list = *listIn; + for (i = 0; i < *num; i++) + { + if (streq(list[i], newVal)) + return True; + } + if ((list == NULL) || (*sz < 1)) + { + *num = 0; + *sz = 4; + list = (char **) calloc(*sz, sizeof(char *)); + *listIn = list; + } + else if (*num >= *sz) + { + *sz *= 2; + list = (char **) realloc(list, (*sz) * sizeof(char *)); + *listIn = list; + } + if (!list) + { + ERR("Internal Error! Allocation failure in add to list!\n"); + ERR(" Exiting.\n"); + exit(-1); + } + list[*num] = strdup(newVal); + (*num) = (*num) + 1; return True; } /***====================================================================***/ void -usage(int argc,char **argv) +usage(int argc, char **argv) { - MSG1("Usage: %s [args] [ [ [