From 0c8394fdfaad3458ba573682f1b013bc5703794c Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Sep 2007 16:58:44 +0200 Subject: [PATCH] change compileregs proto, simplify --- tag.c | 14 +++++++------- tag.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tag.c b/tag.c index 5b9378e3..7e159e6a 100644 --- a/tag.c +++ b/tag.c @@ -75,28 +75,28 @@ applyrules(Client * c, awesome_config *awesomeconf) } void -compileregs(awesome_config * awesomeconf) +compileregs(Rule * rules, int nrules) { int i; regex_t *reg; if(regs) return; - regs = p_new(Regs, awesomeconf->nrules); - for(i = 0; i < awesomeconf->nrules; i++) + regs = p_new(Regs, nrules); + for(i = 0; i < nrules; i++) { - if(awesomeconf->rules[i].prop) + if(rules[i].prop) { reg = p_new(regex_t, 1); - if(regcomp(reg, awesomeconf->rules[i].prop, REG_EXTENDED)) + if(regcomp(reg, rules[i].prop, REG_EXTENDED)) p_delete(®); else regs[i].propregex = reg; } - if(awesomeconf->rules[i].tags) + if(rules[i].tags) { reg = p_new(regex_t, 1); - if(regcomp(reg, awesomeconf->rules[i].tags, REG_EXTENDED)) + if(regcomp(reg, rules[i].tags, REG_EXTENDED)) p_delete(®); else regs[i].tagregex = reg; diff --git a/tag.h b/tag.h index dd4e0763..f4fb0c0f 100644 --- a/tag.h +++ b/tag.h @@ -9,7 +9,7 @@ /** Check if a client is tiled */ #define IS_TILED(client, tags, ntags) (client && !client->isfloating && isvisible(client, tags, ntags)) -void compileregs(awesome_config *); /* initialize regexps of rules defined in config.h */ +void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */ Bool isvisible(Client *, Bool *, int); void applyrules(Client * c, awesome_config *); /* applies rules to c */ void uicb_tag(Display *, awesome_config *, const char *); /* tags sel with arg's index */