Signed-off-by: Ran Benita <ran234@gmail.com>
#define DFLT_LINE_SIZE 128
typedef struct {
#define DFLT_LINE_SIZE 128
typedef struct {
- int line_num;
- int sz_line;
int num_line;
char buf[DFLT_LINE_SIZE];
char * line;
int num_line;
char buf[DFLT_LINE_SIZE];
char * line;
static void
InitInputLine(InputLine *line)
{
static void
InitInputLine(InputLine *line)
{
line->num_line= 0;
line->sz_line= DFLT_LINE_SIZE;
line->line= line->buf;
line->num_line= 0;
line->sz_line= DFLT_LINE_SIZE;
line->line= line->buf;
{
if (line->line!=line->buf)
free(line->line);
{
if (line->line!=line->buf)
free(line->line);
line->num_line= 0;
line->sz_line= DFLT_LINE_SIZE;
line->line= line->buf;
line->num_line= 0;
line->sz_line= DFLT_LINE_SIZE;
line->line= line->buf;
if (ch=='\n') {
inComment= false;
ch= ' ';
if (ch=='\n') {
inComment= false;
ch= ' ';
typedef struct _RemapSpec {
int number;
typedef struct _RemapSpec {
int number;
struct {
int word;
int index;
struct {
int word;
int index;
+ if (!name)
+ return NULL;
+
orig= name;
str= strchr(name,'%');
if (str==NULL)
orig= name;
str= strchr(name,'%');
if (str==NULL)
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option);
XkbRF_ApplyPartialMatches(rules, names);
XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option);
XkbRF_ApplyPartialMatches(rules, names);
- if (names->keycodes)
- names->keycodes= XkbRF_SubstituteVars(names->keycodes, &mdefs);
- if (names->symbols)
- names->symbols= XkbRF_SubstituteVars(names->symbols, &mdefs);
- if (names->types)
- names->types= XkbRF_SubstituteVars(names->types, &mdefs);
- if (names->compat)
- names->compat= XkbRF_SubstituteVars(names->compat, &mdefs);
- if (names->keymap)
- names->keymap= XkbRF_SubstituteVars(names->keymap, &mdefs);
+ names->keycodes = XkbRF_SubstituteVars(names->keycodes, &mdefs);
+ names->symbols = XkbRF_SubstituteVars(names->symbols, &mdefs);
+ names->types = XkbRF_SubstituteVars(names->types, &mdefs);
+ names->compat = XkbRF_SubstituteVars(names->compat, &mdefs);
+ names->keymap = XkbRF_SubstituteVars(names->keymap, &mdefs);
FreeMultiDefs(&mdefs);
return (names->keycodes && names->symbols && names->types &&
FreeMultiDefs(&mdefs);
return (names->keycodes && names->symbols && names->types &&
}
if (!rules->rules) {
rules->sz_rules= rules->num_rules= 0;
}
if (!rules->rules) {
rules->sz_rules= rules->num_rules= 0;
-#ifdef DEBUG
- fprintf(stderr,"Allocation failure in XkbcRF_AddRule\n");
-#endif
return NULL;
}
memset(&rules->rules[rules->num_rules], 0, sizeof(XkbRF_RuleRec));
return NULL;
}
memset(&rules->rules[rules->num_rules], 0, sizeof(XkbRF_RuleRec));
XkbRF_ClearVarDescriptions(&rules->layouts);
XkbRF_ClearVarDescriptions(&rules->variants);
XkbRF_ClearVarDescriptions(&rules->options);
XkbRF_ClearVarDescriptions(&rules->layouts);
XkbRF_ClearVarDescriptions(&rules->variants);
XkbRF_ClearVarDescriptions(&rules->options);
- if (rules->extra) {
- for (i = 0; i < rules->num_extra; i++) {
- XkbRF_ClearVarDescriptions(&rules->extra[i]);
- }
- free(rules->extra);
- }
for (i=0, rule = rules->rules; i < rules->num_rules && rules; i++, rule++) {
free(rule->model);
free(rule->layout);
for (i=0, rule = rules->rules; i < rules->num_rules && rules; i++, rule++) {
free(rule->model);
free(rule->layout);
const char * layout;
const char * variant;
const char * options;
const char * layout;
const char * variant;
const char * options;
- unsigned short sz_extra;
- unsigned short num_extra;
- char * extra_names;
- char ** extra_values;
} XkbRF_VarDefsRec,*XkbRF_VarDefsPtr;
typedef struct _XkbRF_VarDesc {
} XkbRF_VarDefsRec,*XkbRF_VarDefsPtr;
typedef struct _XkbRF_VarDesc {
} XkbRF_VarDescRec, *XkbRF_VarDescPtr;
typedef struct _XkbRF_DescribeVars {
} XkbRF_VarDescRec, *XkbRF_VarDescPtr;
typedef struct _XkbRF_DescribeVars {
- int sz_desc;
- int num_desc;
+ size_t sz_desc;
+ size_t num_desc;
XkbRF_VarDescPtr desc;
} XkbRF_DescribeVarsRec,*XkbRF_DescribeVarsPtr;
XkbRF_VarDescPtr desc;
} XkbRF_DescribeVarsRec,*XkbRF_DescribeVarsPtr;
XkbRF_DescribeVarsRec layouts;
XkbRF_DescribeVarsRec variants;
XkbRF_DescribeVarsRec options;
XkbRF_DescribeVarsRec layouts;
XkbRF_DescribeVarsRec variants;
XkbRF_DescribeVarsRec options;
- unsigned short num_extra;
- XkbRF_DescribeVarsPtr extra;
- unsigned short sz_rules;
- unsigned short num_rules;
+ size_t sz_rules;
+ size_t num_rules;
- unsigned short sz_groups;
- unsigned short num_groups;
+ size_t sz_groups;
+ size_t num_groups;
XkbRF_GroupPtr groups;
} XkbRF_RulesRec, *XkbRF_RulesPtr;
XkbRF_GroupPtr groups;
} XkbRF_RulesRec, *XkbRF_RulesPtr;