Changeset 0504f63 for filterelement.c
- Timestamp:
- Aug 10, 2008, 5:38:44 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- e9bb404
- Parents:
- d81f8d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
filterelement.c
r81655f8 r0504f63 126 126 /* Print methods */ 127 127 128 static void owl_filterelement_print_true(owl_filterelement *fe, char*buf)129 { 130 strcat(buf, "true");131 } 132 133 static void owl_filterelement_print_false(owl_filterelement *fe, char*buf)134 { 135 strcat(buf, "false");136 } 137 138 static void owl_filterelement_print_re(owl_filterelement *fe, char*buf)128 static void owl_filterelement_print_true(owl_filterelement *fe, GString *buf) 129 { 130 g_string_append(buf, "true"); 131 } 132 133 static void owl_filterelement_print_false(owl_filterelement *fe, GString *buf) 134 { 135 g_string_append(buf, "false"); 136 } 137 138 static void owl_filterelement_print_re(owl_filterelement *fe, GString *buf) 139 139 { 140 140 char *re, *q; 141 strcat(buf, fe->field);142 strcat(buf, " ");141 g_string_append(buf, fe->field); 142 g_string_append(buf, " "); 143 143 144 144 re = owl_regex_get_string(&(fe->re)); 145 145 q = owl_getquoting(re); 146 strcat(buf, q);147 strcat(buf, re);148 strcat(buf, q);149 } 150 151 static void owl_filterelement_print_filter(owl_filterelement *fe, char*buf)152 { 153 strcat(buf, "filter ");154 strcat(buf, fe->field);155 } 156 157 static void owl_filterelement_print_perl(owl_filterelement *fe, char*buf)158 { 159 strcat(buf, "perl ");160 strcat(buf, fe->field);161 } 162 163 static void owl_filterelement_print_group(owl_filterelement *fe, char*buf)164 { 165 strcat(buf, "( ");146 g_string_append(buf, q); 147 g_string_append(buf, re); 148 g_string_append(buf, q); 149 } 150 151 static void owl_filterelement_print_filter(owl_filterelement *fe, GString *buf) 152 { 153 g_string_append(buf, "filter "); 154 g_string_append(buf, fe->field); 155 } 156 157 static void owl_filterelement_print_perl(owl_filterelement *fe, GString *buf) 158 { 159 g_string_append(buf, "perl "); 160 g_string_append(buf, fe->field); 161 } 162 163 static void owl_filterelement_print_group(owl_filterelement *fe, GString *buf) 164 { 165 g_string_append(buf, "( "); 166 166 owl_filterelement_print(fe->left, buf) ; 167 strcat(buf, " )");168 } 169 170 static void owl_filterelement_print_or(owl_filterelement *fe, char*buf)167 g_string_append(buf, " )"); 168 } 169 170 static void owl_filterelement_print_or(owl_filterelement *fe, GString *buf) 171 171 { 172 172 owl_filterelement_print(fe->left, buf); 173 strcat(buf, " or ");173 g_string_append(buf, " or "); 174 174 owl_filterelement_print(fe->right, buf); 175 175 } 176 176 177 static void owl_filterelement_print_and(owl_filterelement *fe, char*buf)177 static void owl_filterelement_print_and(owl_filterelement *fe, GString *buf) 178 178 { 179 179 owl_filterelement_print(fe->left, buf); 180 strcat(buf, " and ");180 g_string_append(buf, " and "); 181 181 owl_filterelement_print(fe->right, buf); 182 182 } 183 183 184 static void owl_filterelement_print_not(owl_filterelement *fe, char*buf)185 { 186 strcat(buf, " not ");184 static void owl_filterelement_print_not(owl_filterelement *fe, GString *buf) 185 { 186 g_string_append(buf, " not "); 187 187 owl_filterelement_print(fe->left, buf); 188 188 } … … 321 321 } 322 322 323 void owl_filterelement_print(owl_filterelement *fe, char*buf)323 void owl_filterelement_print(owl_filterelement *fe, GString *buf) 324 324 { 325 325 if(!fe || !fe->print_elt) return;
Note: See TracChangeset
for help on using the changeset viewer.