Changeset fc57e84 for filter.c


Ignore:
Timestamp:
Dec 24, 2003, 10:59:20 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
330bcec
Parents:
5c1393d
Message:
Remove the unused loop detection code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • filter.c

    r40458b9 rfc57e84  
    557557}
    558558
    559 /* If the filter exceeds the max recursion depth, due to filters of
    560  * filters with possible loops, return 1.  Otherwise, return 0.
    561  */
    562 int owl_filter_is_toodeep_old(owl_filter *f)
    563 {
    564   int ret;
    565 
    566   owl_function_debugmsg("owl_filter_is_toodeep: checking depth");
    567   filter_depth=0;
    568   ret=_owl_filter_toodeep_recurse(f);
    569   if (ret || (filter_depth>OWL_FILTER_MAXRECURSE)) {
    570     owl_function_debugmsg("owl_filter_is_toodeep: too deep");
    571     return(1);
    572   }
    573   owl_function_debugmsg("owl_filter_is_toodeep: ok");
    574   return(0);
    575 }
    576 
    577 int _owl_filter_toodeep_recurse(owl_filter *f)
    578 {
    579   owl_list list;
    580   owl_filter *subfilter;
    581   int i, j;
    582 
    583   owl_function_debugmsg("_owl_filter_toodeep_recurse: filter_depth on entrance is  %i", filter_depth);
    584 
    585   owl_list_create(&list);
    586   _owl_filter_get_subfilter_names(f, &list);
    587   j=owl_list_get_size(&list);
    588   if (j>0) {
    589     filter_depth++;
    590     if (filter_depth>OWL_FILTER_MAXRECURSE) {
    591       owl_list_free_all(&list, owl_free);
    592       return(1);
    593     }
    594     for (i=0; i<j; i++) {
    595       subfilter=owl_global_get_filter(&g, owl_list_get_element(&list, i));
    596       if (!subfilter) {
    597         owl_function_error("_owl_filter_toodeep_recurse: subfilter %s does not exist",
    598                            owl_list_get_element(&list, i));
    599         return(1);
    600       }
    601       return(_owl_filter_toodeep_recurse(subfilter));
    602     }
    603   }
    604   owl_list_free_all(&list, owl_free);
    605   return(0);
    606 }
    607 
    608559void owl_filter_free(owl_filter *f)
    609560{
Note: See TracChangeset for help on using the changeset viewer.