Changeset bd65108


Ignore:
Timestamp:
Aug 15, 2009, 7:08:20 PM (8 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
4542047
Parents:
89b2daf
git-author:
Anders Kaseorg <andersk@mit.edu> (08/04/09 00:45:45)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:20)
Message:
Add const qualifiers for owl_filterelement *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • filterelement.c

    rc08c70a rbd65108  
    4848}
    4949
    50 static int owl_filterelement_match_false(owl_filterelement *fe, const owl_message *m)
     50static int owl_filterelement_match_false(const owl_filterelement *fe, const owl_message *m)
    5151{
    5252  return 0;
    5353}
    5454
    55 static int owl_filterelement_match_true(owl_filterelement *fe, const owl_message *m)
     55static int owl_filterelement_match_true(const owl_filterelement *fe, const owl_message *m)
    5656{
    5757  return 1;
    5858}
    5959
    60 static int owl_filterelement_match_re(owl_filterelement *fe, const owl_message *m)
     60static int owl_filterelement_match_re(const owl_filterelement *fe, const owl_message *m)
    6161{
    6262  const char * val = owl_filterelement_get_field(m, fe->field);
     
    6464}
    6565
    66 static int owl_filterelement_match_filter(owl_filterelement *fe, const owl_message *m)
     66static int owl_filterelement_match_filter(const owl_filterelement *fe, const owl_message *m)
    6767{
    6868  owl_filter *subfilter;
     
    7777}
    7878
    79 static int owl_filterelement_match_perl(owl_filterelement *fe, const owl_message *m)
     79static int owl_filterelement_match_perl(const owl_filterelement *fe, const owl_message *m)
    8080{
    8181  const char *subname;
     
    9797}
    9898
    99 static int owl_filterelement_match_group(owl_filterelement *fe, const owl_message *m)
     99static int owl_filterelement_match_group(const owl_filterelement *fe, const owl_message *m)
    100100{
    101101  return owl_filterelement_match(fe->left, m);
     
    106106*/
    107107
    108 static int owl_filterelement_match_and(owl_filterelement *fe, const owl_message *m)
     108static int owl_filterelement_match_and(const owl_filterelement *fe, const owl_message *m)
    109109{
    110110  return owl_filterelement_match(fe->left, m) &&
     
    112112}
    113113
    114 static int owl_filterelement_match_or(owl_filterelement *fe, const owl_message *m)
     114static int owl_filterelement_match_or(const owl_filterelement *fe, const owl_message *m)
    115115{
    116116  return owl_filterelement_match(fe->left, m) ||
     
    118118}
    119119
    120 static int owl_filterelement_match_not(owl_filterelement *fe, const owl_message *m)
     120static int owl_filterelement_match_not(const owl_filterelement *fe, const owl_message *m)
    121121{
    122122  return !owl_filterelement_match(fe->left, m);
     
    125125/* Print methods */
    126126
    127 static void owl_filterelement_print_true(owl_filterelement *fe, GString *buf)
     127static void owl_filterelement_print_true(const owl_filterelement *fe, GString *buf)
    128128{
    129129  g_string_append(buf, "true");
    130130}
    131131
    132 static void owl_filterelement_print_false(owl_filterelement *fe, GString *buf)
     132static void owl_filterelement_print_false(const owl_filterelement *fe, GString *buf)
    133133{
    134134  g_string_append(buf, "false");
    135135}
    136136
    137 static void owl_filterelement_print_re(owl_filterelement *fe, GString *buf)
     137static void owl_filterelement_print_re(const owl_filterelement *fe, GString *buf)
    138138{
    139139  const char *re, *q;
     
    148148}
    149149
    150 static void owl_filterelement_print_filter(owl_filterelement *fe, GString *buf)
     150static void owl_filterelement_print_filter(const owl_filterelement *fe, GString *buf)
    151151{
    152152  g_string_append(buf, "filter ");
     
    154154}
    155155
    156 static void owl_filterelement_print_perl(owl_filterelement *fe, GString *buf)
     156static void owl_filterelement_print_perl(const owl_filterelement *fe, GString *buf)
    157157{
    158158  g_string_append(buf, "perl ");
     
    160160}
    161161
    162 static void owl_filterelement_print_group(owl_filterelement *fe, GString *buf)
     162static void owl_filterelement_print_group(const owl_filterelement *fe, GString *buf)
    163163{
    164164  g_string_append(buf, "( ");
     
    167167}
    168168
    169 static void owl_filterelement_print_or(owl_filterelement *fe, GString *buf)
     169static void owl_filterelement_print_or(const owl_filterelement *fe, GString *buf)
    170170{
    171171  owl_filterelement_print(fe->left, buf);
     
    174174}
    175175
    176 static void owl_filterelement_print_and(owl_filterelement *fe, GString *buf)
     176static void owl_filterelement_print_and(const owl_filterelement *fe, GString *buf)
    177177{
    178178  owl_filterelement_print(fe->left, buf);
     
    181181}
    182182
    183 static void owl_filterelement_print_not(owl_filterelement *fe, GString *buf)
     183static void owl_filterelement_print_not(const owl_filterelement *fe, GString *buf)
    184184{
    185185  g_string_append(buf, " not ");
     
    276276}
    277277
    278 int owl_filterelement_match(owl_filterelement *fe, const owl_message *m)
     278int owl_filterelement_match(const owl_filterelement *fe, const owl_message *m)
    279279{
    280280  if(!fe) return 0;
     
    286286static int fe_visited  = 1;
    287287
    288 int owl_filterelement_is_toodeep(owl_filter *f, owl_filterelement *fe)
     288int owl_filterelement_is_toodeep(owl_filter *f, const owl_filterelement *fe)
    289289{
    290290  int rv;
     
    300300}
    301301
    302 int _owl_filterelement_is_toodeep(owl_filterelement *fe, owl_dict *seen)
     302int _owl_filterelement_is_toodeep(const owl_filterelement *fe, owl_dict *seen)
    303303{
    304304  int rv = 0;
     
    338338}
    339339
    340 void owl_filterelement_print(owl_filterelement *fe, GString *buf)
     340void owl_filterelement_print(const owl_filterelement *fe, GString *buf)
    341341{
    342342  if(!fe || !fe->print_elt) return;
  • owl.h

    r1fdab04 rbd65108  
    398398
    399399typedef struct _owl_filterelement {
    400   int (*match_message)(struct _owl_filterelement *fe, const owl_message *m);
     400  int (*match_message)(const struct _owl_filterelement *fe, const owl_message *m);
    401401  /* Append a string representation of the filterelement onto buf*/
    402   void (*print_elt)(struct _owl_filterelement *fe, GString *buf);
     402  void (*print_elt)(const struct _owl_filterelement *fe, GString *buf);
    403403  /* Operands for and,or,not*/
    404404  struct _owl_filterelement *left, *right;
Note: See TracChangeset for help on using the changeset viewer.