Changeset ce7b824 for functions.c
- Timestamp:
- Aug 11, 2007, 1:04:07 AM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 18fb3d4f
- Parents:
- ad15610
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rad15610 rce7b824 2558 2558 for (i=0; i<j; i++) { 2559 2559 f=owl_list_get_element(fl, i); 2560 snprintf(buff, sizeof(buff), "[% 2d] ", i+1); 2561 owl_fmtext_append_normal(&fm, buff); 2560 2562 owl_filter_print(f, buff); 2561 2563 owl_fmtext_append_normal(&fm, buff); … … 3017 3019 void owl_function_zpunt(char *class, char *inst, char *recip, int direction) 3018 3020 { 3019 owl_filter *f;3020 owl_list *fl;3021 3021 char *buff; 3022 3022 char *quoted; 3023 int ret, i, j; 3024 3025 fl=owl_global_get_puntlist(&g); 3026 3027 /* first, create the filter */ 3028 f=malloc(sizeof(owl_filter)); 3023 3029 3024 buff=malloc(strlen(class)+strlen(inst)+strlen(recip)+100); 3030 3025 strcpy(buff, "class"); … … 3057 3052 owl_free(quoted); 3058 3053 } 3059 3060 owl_function_debugmsg("About to filter %s", buff); 3061 ret=owl_filter_init_fromstring(f, "punt-filter", buff); 3054 3055 owl_function_punt(buff, direction); 3062 3056 owl_free(buff); 3057 } 3058 3059 void owl_function_punt(char *filter, int direction) 3060 { 3061 owl_filter *f; 3062 owl_list *fl; 3063 int ret, i, j; 3064 fl=owl_global_get_puntlist(&g); 3065 3066 /* first, create the filter */ 3067 f=malloc(sizeof(owl_filter)); 3068 3069 owl_function_debugmsg("About to filter %s", filter); 3070 ret=owl_filter_init_fromstring(f, "punt-filter", filter); 3063 3071 if (ret) { 3064 3072 owl_function_error("Error creating filter for zpunt"); … … 3071 3079 for (i=0; i<j; i++) { 3072 3080 if (owl_filter_equiv(f, owl_list_get_element(fl, i))) { 3081 owl_function_debugmsg("found an equivalent punt filter"); 3073 3082 /* if we're punting, then just silently bow out on this duplicate */ 3074 3083 if (direction==0) { … … 3081 3090 owl_filter_free(owl_list_get_element(fl, i)); 3082 3091 owl_list_remove_element(fl, i); 3092 owl_filter_free(f); 3083 3093 return; 3084 3094 } … … 3086 3096 } 3087 3097 3098 owl_function_debugmsg("punting"); 3088 3099 /* If we're punting, add the filter to the global punt list */ 3089 3100 if (direction==0) {
Note: See TracChangeset
for help on using the changeset viewer.