Changes in / [f1a2736:a01ed7c]
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
filter.c
r23fddad r3cc4bfc 164 164 } 165 165 166 SV *owl_filter_to_sv(const owl_filter *f) 167 { 168 return owl_new_sv(owl_filter_get_name(f)); 169 } 170 166 171 void owl_filter_set_fgcolor(owl_filter *f, int color) 167 172 { -
fmtext.c
r6c171f1 r1ee5c79 686 686 /* set it as the current color */ 687 687 curcolor=owl_util_string_to_color(buff); 688 if (curcolor==-1) curcolor=OWL_COLOR_DEFAULT; 688 if (curcolor == OWL_COLOR_INVALID) 689 curcolor = OWL_COLOR_DEFAULT; 689 690 owl_free(buff); 690 691 txtptr=tmpptr+1; -
owl.h
r6fc40a7 r6fc40a7 44 44 #else 45 45 typedef void SV; 46 typedef void AV; 47 typedef void HV; 46 48 #endif 47 49 -
perl/lib/BarnOwl/Complete/Client.pm
ra3a9eb7 r02a72bf 24 24 commands => undef, 25 25 command => \&complete_command, 26 errors => undef, 26 27 filters => undef, 27 28 filter => \&complete_filter_name, 28 29 license => undef, 30 keymaps => undef, 31 keymap => \&complete_keymap, 29 32 quickstart => undef, 30 33 startup => undef, … … 45 48 sub complete_variable { return @{BarnOwl::all_variables()}; } 46 49 sub complete_style { return @{BarnOwl::all_styles()}; } 50 sub complete_keymap { return @{BarnOwl::all_keymaps()}; } 47 51 48 52 sub complete_help { -
perlconfig.c
rffc4df6 rffc4df6 33 33 owl_free(escape); 34 34 } 35 return ret; 36 } 37 38 AV *owl_new_av(const owl_list *l, SV *(*to_sv)(const void *)) 39 { 40 AV *ret; 41 int i; 42 void *element; 43 44 ret = newAV(); 45 46 for (i = 0; i < owl_list_get_size(l); i++) { 47 element = owl_list_get_element(l, i); 48 av_push(ret, to_sv(element)); 49 } 50 51 return ret; 52 } 53 54 HV *owl_new_hv(const owl_dict *d, SV *(*to_sv)(const void *)) 55 { 56 HV *ret; 57 owl_list l; 58 const char *key; 59 void *element; 60 int i; 61 62 ret = newHV(); 63 64 /* TODO: add an iterator-like interface to owl_dict */ 65 owl_dict_get_keys(d, &l); 66 for (i = 0; i < owl_list_get_size(&l); i++) { 67 key = owl_list_get_element(&l, i); 68 element = owl_dict_find_element(d, key); 69 (void)hv_store(ret, key, strlen(key), to_sv(element), 0); 70 } 71 owl_list_free_all(&l, owl_free); 72 35 73 return ret; 36 74 } -
perlglue.xs
rffc4df6 rffc4df6 326 326 all_filters() 327 327 PREINIT: 328 AV *filters;329 328 const owl_list *fl; 330 const owl_filter *f;331 int i;332 329 CODE: 333 330 { 334 331 fl = owl_global_get_filterlist(&g); 335 filters = newAV(); 336 for(i=0;i<owl_list_get_size(fl);i++) { 337 f = owl_list_get_element(fl, i); 338 av_push(filters, owl_new_sv(owl_filter_get_name(f))); 339 } 340 RETVAL = filters; 332 RETVAL = owl_new_av(fl, (SV*(*)(const void*))owl_filter_to_sv); 341 333 sv_2mortal((SV*)RETVAL); 342 334 } … … 347 339 all_styles() 348 340 PREINIT: 349 AV *styles;350 341 owl_list l; 351 const char *name;352 int i;353 342 CODE: 354 343 { 355 344 owl_list_create(&l); 356 345 owl_global_get_style_names(&g, &l); 357 styles = newAV(); 358 for(i=0;i<owl_list_get_size(&l);i++) { 359 name = owl_list_get_element(&l, i); 360 av_push(styles, owl_new_sv(name)); 361 } 362 RETVAL = styles; 346 RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); 363 347 sv_2mortal((SV*)RETVAL); 364 348 } … … 372 356 all_variables() 373 357 PREINIT: 374 AV *vars;375 358 owl_list l; 376 const char *name;377 int i;378 359 CODE: 379 360 { 380 361 owl_list_create(&l); 381 362 owl_dict_get_keys(owl_global_get_vardict(&g), &l); 382 vars = newAV(); 383 for(i=0;i<owl_list_get_size(&l);i++) { 384 name = owl_list_get_element(&l, i); 385 av_push(vars, owl_new_sv(name)); 386 } 387 RETVAL = vars; 363 RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); 364 sv_2mortal((SV*)RETVAL); 365 } 366 OUTPUT: 367 RETVAL 368 CLEANUP: 369 owl_list_free_all(&l, owl_free); 370 371 372 AV* 373 all_keymaps() 374 PREINIT: 375 owl_list l; 376 const owl_keyhandler *kh; 377 CODE: 378 { 379 owl_list_create(&l); 380 kh = owl_global_get_keyhandler(&g); 381 owl_keyhandler_get_keymap_names(kh, &l); 382 RETVAL = owl_new_av(&l, (SV*(*)(const void*))owl_new_sv); 388 383 sv_2mortal((SV*)RETVAL); 389 384 } -
scripts/locker-build
rdb98968 r2b6622a6 80 80 echo "Building BarnOwl version $VERS" 81 81 82 opt_rpath="-Wl,-R" 83 [ $(uname) = "SunOS" ] && opt_rpath="-R" 84 82 85 BARNOWL="/afs/sipb.mit.edu/project/barnowl/arch/$ATHENA_SYS" 83 86 export PKG_CONFIG_PATH="$BARNOWL/lib/pkgconfig" 84 87 85 88 CFLAGS="-I$BARNOWL/include" \ 86 LDFLAGS="-L$BARNOWL/lib -Wl,-R$BARNOWL/lib" \89 LDFLAGS="-L$BARNOWL/lib $opt_rpath$BARNOWL/lib" \ 87 90 ./configure --exec-prefix="/mit/barnowl/arch/$ATHENA_SYS" \ 88 91 --prefix="/mit/barnowl/builds/barnowl-$VERS" --mandir=/mit/barnowl/man \ -
util.c
r0697f09 r1b9d3cc 407 407 } 408 408 409 /* These are in order of their value in owl.h */ 410 static const struct { 411 int number; 412 const char *name; 413 } color_map[] = { 414 {OWL_COLOR_INVALID, "invalid"}, 415 {OWL_COLOR_DEFAULT, "default"}, 416 {OWL_COLOR_BLACK, "black"}, 417 {OWL_COLOR_RED, "red"}, 418 {OWL_COLOR_GREEN, "green"}, 419 {OWL_COLOR_YELLOW,"yellow"}, 420 {OWL_COLOR_BLUE, "blue"}, 421 {OWL_COLOR_MAGENTA, "magenta"}, 422 {OWL_COLOR_CYAN, "cyan"}, 423 {OWL_COLOR_WHITE, "white"}, 424 }; 409 425 410 426 /* Return the owl color associated with the named color. Return -1 … … 413 429 int owl_util_string_to_color(const char *color) 414 430 { 415 int c; 416 if (!strcasecmp(color, "black")) { 417 return(OWL_COLOR_BLACK); 418 } else if (!strcasecmp(color, "red")) { 419 return(OWL_COLOR_RED); 420 } else if (!strcasecmp(color, "green")) { 421 return(OWL_COLOR_GREEN); 422 } else if (!strcasecmp(color, "yellow")) { 423 return(OWL_COLOR_YELLOW); 424 } else if (!strcasecmp(color, "blue")) { 425 return(OWL_COLOR_BLUE); 426 } else if (!strcasecmp(color, "magenta")) { 427 return(OWL_COLOR_MAGENTA); 428 } else if (!strcasecmp(color, "cyan")) { 429 return(OWL_COLOR_CYAN); 430 } else if (!strcasecmp(color, "white")) { 431 return(OWL_COLOR_WHITE); 432 } else if (!strcasecmp(color, "default")) { 433 return(OWL_COLOR_DEFAULT); 434 } 435 c = atoi(color); 436 if (c >= -1 && c < COLORS) { 431 int c, i; 432 char *p; 433 434 for (i = 0; i < (sizeof(color_map)/sizeof(color_map[0])); i++) 435 if (strcasecmp(color, color_map[i].name) == 0) 436 return color_map[i].number; 437 438 c = strtol(color, &p, 10); 439 if (p != color && c >= -1 && c < COLORS) { 437 440 return(c); 438 441 } … … 443 446 const char *owl_util_color_to_string(int color) 444 447 { 445 if (color==OWL_COLOR_BLACK) return("black"); 446 if (color==OWL_COLOR_RED) return("red"); 447 if (color==OWL_COLOR_GREEN) return("green"); 448 if (color==OWL_COLOR_YELLOW) return("yellow"); 449 if (color==OWL_COLOR_BLUE) return("blue"); 450 if (color==OWL_COLOR_MAGENTA) return("magenta"); 451 if (color==OWL_COLOR_CYAN) return("cyan"); 452 if (color==OWL_COLOR_WHITE) return("white"); 453 if (color==OWL_COLOR_DEFAULT) return("default"); 448 if (color >= OWL_COLOR_INVALID && color <= OWL_COLOR_WHITE) 449 return color_map[color - OWL_COLOR_INVALID].name; 454 450 return("Unknown color"); 455 451 }
Note: See TracChangeset
for help on using the changeset viewer.