Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • filter.c

    rcdc6ff1 rf34dd65  
    33
    44static const char fileIdent[] = "$Id$";
    5 
    6 #define OWL_FILTER_MAXRECURSE 20
    75
    86int owl_filter_init_fromstring(owl_filter *f, char *name, char *string)
     
    2018{
    2119  f->name=owl_strdup(name);
    22   f->polarity=0;
    2320  f->fgcolor=OWL_COLOR_DEFAULT;
    2421  f->bgcolor=OWL_COLOR_DEFAULT;
     
    5047  /* Now check for recursion. */
    5148  if (owl_filter_is_toodeep(f)) {
    52     owl_function_error("Filter loop or exceeds recursion depth");
     49    owl_function_error("Filter loop!");
    5350    owl_filter_free(f);
    5451    return(-1);
     
    159156}
    160157
    161 void owl_filter_set_polarity_match(owl_filter *f)
    162 {
    163   f->polarity=0;
    164 }
    165 
    166 void owl_filter_set_polarity_unmatch(owl_filter *f)
    167 {
    168   f->polarity=1;
    169 }
    170 
    171158void owl_filter_set_fgcolor(owl_filter *f, int color)
    172159{
     
    207194  if(!f->root) return 0;
    208195  ret = owl_filterelement_match(f->root, m);
    209   if(f->polarity) ret = !ret;
    210196  return ret;
    211197}
     
    313299  int numfailed=0;
    314300  owl_message m;
    315   owl_filter f1, f2, f3, f4;
     301  owl_filter f1, f2, f3, f4, f5;
    316302
    317303  owl_list_create(&(g.filterlist));
     
    365351  FAIL_UNLESS("mutual recursion",   owl_filter_init_fromstring(&f4, "f4", "filter f3"));
    366352
     353  /* support referencing a filter several times */
     354  FAIL_UNLESS("DAG", !owl_filter_init_fromstring(&f5, "dag", "filter f1 or filter f1"));
     355
    367356  return 0;
    368357}
Note: See TracChangeset for help on using the changeset viewer.