tag.c
changeset 837 123231b9eb87
parent 830 5a4fd8fec414
child 857 453788ae925c
equal deleted inserted replaced
836:52c1caae3fab 837:123231b9eb87
    10 /* static */
    10 /* static */
    11 
    11 
    12 typedef struct {
    12 typedef struct {
    13 	const char *prop;
    13 	const char *prop;
    14 	const char *tags;
    14 	const char *tags;
    15 	Bool isuntiled;
    15 	Bool isfloating;
    16 } Rule;
    16 } Rule;
    17 
    17 
    18 typedef struct {
    18 typedef struct {
    19 	regex_t *propregex;
    19 	regex_t *propregex;
    20 	regex_t *tagregex;
    20 	regex_t *tagregex;
    81 		snprintf(prop, sizeof prop, "%s:%s:%s",
    81 		snprintf(prop, sizeof prop, "%s:%s:%s",
    82 				ch.res_class ? ch.res_class : "",
    82 				ch.res_class ? ch.res_class : "",
    83 				ch.res_name ? ch.res_name : "", c->name);
    83 				ch.res_name ? ch.res_name : "", c->name);
    84 		for(i = 0; i < nrules; i++)
    84 		for(i = 0; i < nrules; i++)
    85 			if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
    85 			if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
    86 				c->isuntiled = rule[i].isuntiled;
    86 				c->isfloating = rule[i].isfloating;
    87 				for(j = 0; regs[i].tagregex && j < ntags; j++) {
    87 				for(j = 0; regs[i].tagregex && j < ntags; j++) {
    88 					if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
    88 					if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
    89 						matched = True;
    89 						matched = True;
    90 						c->tags[j] = True;
    90 						c->tags[j] = True;
    91 					}
    91 					}