Changeset ad15610
- Timestamp:
- Aug 8, 2007, 6:01:51 PM (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:
- ce7b824
- Parents:
- b51d257
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rb363d83 rad15610 2468 2468 owl_message *m; 2469 2469 owl_view *v; 2470 char *cmd; 2470 2471 2471 2472 v = owl_global_get_current_view(&g); … … 2486 2487 return; 2487 2488 } 2488 c har * cmd = owl_message_get_attribute_value(m, "yescommand");2489 cmd = owl_message_get_attribute_value(m, "yescommand"); 2489 2490 if(!cmd) { 2490 2491 owl_function_error("No yes command!"); … … 2501 2502 owl_message *m; 2502 2503 owl_view *v; 2504 char *cmd; 2503 2505 2504 2506 v = owl_global_get_current_view(&g); … … 2519 2521 return; 2520 2522 } 2521 c har * cmd = owl_message_get_attribute_value(m, "nocommand");2523 cmd = owl_message_get_attribute_value(m, "nocommand"); 2522 2524 if(!cmd) { 2523 2525 owl_function_error("No no command!"); -
filter.c
r535d68b rad15610 63 63 static owl_filterelement * owl_filter_parse_primitive_expression(int argc, char **argv, int *next) 64 64 { 65 owl_filterelement *fe, *op; 66 int i = 0, skip; 67 65 68 if(!argc) return NULL; 66 69 67 owl_filterelement * fe = owl_malloc(sizeof(owl_filterelement)); 68 owl_filterelement *op; 69 70 fe = owl_malloc(sizeof(owl_filterelement)); 70 71 owl_filterelement_create(fe); 71 int i = 0, skip;72 72 73 73 if(!strcasecmp(argv[i], "(")) { … … 118 118 { 119 119 int i = 0, skip; 120 owl_filterelement * op1 = NULL, * op2 = NULL ;120 owl_filterelement * op1 = NULL, * op2 = NULL, *tmp; 121 121 122 122 op1 = owl_filter_parse_primitive_expression(argc-i, argv+i, &skip); … … 129 129 op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip); 130 130 if(!op2) goto err; 131 owl_filterelement *tmp = owl_malloc(sizeof(owl_filterelement));131 tmp = owl_malloc(sizeof(owl_filterelement)); 132 132 if(!strcasecmp(argv[i], "and")) { 133 133 owl_filterelement_create_and(tmp, op1, op2); … … 204 204 int owl_filter_message_match(owl_filter *f, owl_message *m) 205 205 { 206 int ret; 206 207 if(!f->root) return 0; 207 intret = owl_filterelement_match(f->root, m);208 ret = owl_filterelement_match(f->root, m); 208 209 if(f->polarity) ret = !ret; 209 210 return ret; … … 305 306 306 307 int owl_filter_regtest(void) { 307 owl_list_create(&(g.filterlist));308 308 int numfailed=0; 309 309 owl_message m; 310 owl_filter f1, f2, f3, f4; 311 312 owl_list_create(&(g.filterlist)); 310 313 owl_message_init(&m); 311 314 owl_message_set_type_zephyr(&m); … … 345 348 TEST_FILTER("true and false or false", 0); 346 349 347 owl_filter f1, f2, f3, f4;348 349 350 owl_filter_init_fromstring(&f1, "f1", "class owl"); 350 351 owl_global_add_filter(&g, &f1); -
functions.c
r0ef0e8f rad15610 2801 2801 owl_message *m; 2802 2802 char *zperson, *filtname=NULL; 2803 char *argv[1]; 2803 2804 2804 2805 v=owl_global_get_current_view(&g); … … 2859 2860 2860 2861 /* pass it off to perl */ 2861 char *argv[1];2862 2862 if(type) { 2863 2863 argv[0] = "-i"; -
global.c
rb363d83 rad15610 18 18 struct hostent *hent; 19 19 char hostname[MAXHOSTNAMELEN]; 20 char *cd; 20 21 21 22 g->malloced=0; … … 88 89 g->confdir = NULL; 89 90 g->startupfile = NULL; 90 c har * cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);91 cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR); 91 92 owl_global_set_confdir(g, cd); 92 93 owl_free(cd); -
message.c
r21f0a9d rad15610 27 27 owl_fmtext_cache * owl_message_next_fmtext() /*noproto*/ 28 28 { 29 owl_fmtext_cache * f = fmtext_cache_next; 29 30 if(fmtext_cache_next->message != NULL) { 30 31 owl_message_invalidate_format(fmtext_cache_next->message); 31 32 } 32 owl_fmtext_cache * f = fmtext_cache_next;33 33 fmtext_cache_next++; 34 34 if(fmtext_cache_next - fmtext_cache == OWL_FMTEXT_CACHE_SIZE) … … 567 567 568 568 int owl_message_is_answered(owl_message *m) { 569 char *q; 569 570 if(!owl_message_is_question(m)) return 0; 570 char *q = owl_message_get_attribute_value(m, "question");571 q = owl_message_get_attribute_value(m, "question"); 571 572 if(!q) return 0; 572 573 return !strcmp(q, "answered"); -
perlconfig.c
rf6b319c rad15610 137 137 char *key,*val; 138 138 HV * hash; 139 struct tm tm; 139 140 140 141 hash = (HV*)SvRV(msg); … … 162 163 } else if (!strcmp(key, "time")) { 163 164 m->timestr = owl_strdup(val); 164 struct tm tm;165 165 strptime(val, "%a %b %d %T %Y", &tm); 166 166 m->time = mktime(&tm); … … 445 445 int i, count; 446 446 char * ret = NULL; 447 SV *rv; 447 448 STRLEN n_a; 448 449 dSP; … … 467 468 if(count != 1) 468 469 croak("Perl command %s returned more than one value!", cmd->name); 469 SV *rv = POPs;470 rv = POPs; 470 471 if(SvTRUE(rv)) { 471 472 ret = owl_strdup(SvPV(rv, n_a)); … … 488 489 SV *cb = (SV*)(e->cbdata); 489 490 unsigned int n_a; 491 dSP; 492 490 493 if(cb == NULL) { 491 494 owl_function_error("Perl callback is NULL!"); 492 495 } 493 494 dSP;495 496 496 497 ENTER; … … 516 517 void owl_perlconfig_mainloop() 517 518 { 519 dSP; 518 520 if (!owl_perlconfig_is_function("BarnOwl::Hooks::_mainloop_hook")) 519 521 return; 520 dSP ;521 522 PUSHMARK(SP) ; 522 523 call_pv("BarnOwl::Hooks::_mainloop_hook", G_DISCARD|G_EVAL); -
variable.c
r1cf3f8d3 rad15610 974 974 int numfailed=0; 975 975 char buf[1024]; 976 owl_variable * v; 976 977 977 978 in_regtest = 1; … … 1027 1028 FAIL_UNLESS("get enum 10", OWL_WEBBROWSER_NETSCAPE==owl_variable_get_int(&vd,"webbrowser")); 1028 1029 1029 owl_variable * v;1030 1031 1030 owl_variable_dict_newvar_string(&vd, "stringvar", "", "", "testval"); 1032 1031 FAIL_UNLESS("get new string var", NULL != (v = owl_variable_get(&vd, "stringvar", OWL_VARIABLE_STRING)));
Note: See TracChangeset
for help on using the changeset viewer.