Changeset 8dfb59c
- Timestamp:
- Mar 23, 2010, 5:23:43 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 38cc669
- Parents:
- 1b1cd2c
- git-author:
- Nelson Elhage <nelhage@mit.edu> (03/04/10 09:41:04)
- git-committer:
- Nelson Elhage <nelhage@ksplice.com> (03/23/10 17:23:43)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r8a921b5 r8dfb59c 2566 2566 /* if we get two arguments, ask for the password */ 2567 2567 if (argc==2) { 2568 owl_global_set_buffercommand(&g, argv[1]); 2569 owl_global_set_buffercallback(&g, &owl_callback_aimlogin); 2568 owl_editwin_set_cbdata(owl_global_get_typwin(&g), 2569 owl_strdup(argv[1]), owl_free); 2570 owl_editwin_set_callback(owl_global_get_typwin(&g), 2571 owl_callback_aimlogin); 2570 2572 owl_function_start_password("AIM Password: "); 2571 2573 return(NULL); -
editwin.c
r1b1cd2c r8dfb59c 35 35 oe_excursion *excursions; 36 36 37 char *command;38 37 void (*callback)(struct _owl_editwin*); 39 38 void (*destroy_cbdata)(void *); … … 77 76 owl_free(e->buff); 78 77 owl_free(e->killbuf); 79 owl_free(e->command);80 78 /* just in case someone forgot to clean up */ 81 79 while (e->excursions) { … … 181 179 { 182 180 e->dotsend=1; 183 }184 185 void owl_editwin_set_command(owl_editwin *e, const char *command)186 {187 if(e->command) owl_free(e->command);188 e->command = owl_strdup(command);189 }190 191 const char *owl_editwin_get_command(owl_editwin *e)192 {193 if(e->command) return e->command;194 return "";195 181 } 196 182 -
functions.c
r1b1cd2c r8dfb59c 296 296 297 297 owl_editwin_set_cbdata(owl_global_get_typwin(&g), data, cleanup); 298 owl_ global_set_buffercallback(&g, callback);298 owl_editwin_set_callback(owl_global_get_typwin(&g), callback); 299 299 owl_global_push_context(&g, OWL_CTX_EDITMULTI, e, "editmulti"); 300 300 } … … 312 312 noun); 313 313 314 owl_function_start_edit_win(line, callback, NULL, NULL); 315 owl_global_set_buffercommand(&g, line); 314 owl_function_start_edit_win(line, callback, 315 owl_strdup(line), 316 owl_free); 316 317 } 317 318 … … 349 350 350 351 void owl_callback_zwrite(owl_editwin *e) { 351 owl_function_zwrite(owl_editwin_get_command(e), 352 char *command = owl_editwin_get_cbdata(e); 353 owl_function_zwrite(command, 352 354 owl_editwin_get_text(e)); 353 355 } … … 447 449 448 450 void owl_callback_aimwrite(owl_editwin *e) { 449 owl_function_aimwrite(owl_editwin_get_command(e), 451 char *command = owl_editwin_get_cbdata(e); 452 owl_function_aimwrite(command, 450 453 owl_editwin_get_text(e)); 451 454 } … … 882 885 883 886 void owl_callback_aimlogin(owl_editwin *e) { 884 owl_function_aimlogin(owl_editwin_get_command(e), 887 char *user = owl_editwin_get_cbdata(e); 888 owl_function_aimlogin(user, 885 889 owl_editwin_get_text(e)); 886 890 } -
global.c
r2ee9e8d r8dfb59c 324 324 } 325 325 326 /* buffercommand */327 328 void owl_global_set_buffercommand(owl_global *g, const char *command) {329 owl_editwin_set_command(owl_global_get_typwin(g), command);330 }331 332 const char *owl_global_get_buffercommand(const owl_global *g) {333 return owl_editwin_get_command(owl_global_get_typwin(g));334 }335 336 void owl_global_set_buffercallback(owl_global *g, void (*cb)(owl_editwin*)) {337 owl_editwin_set_callback(owl_global_get_typwin(g), cb);338 }339 340 void (*owl_global_get_buffercallback(const owl_global *g))(owl_editwin*) {341 return owl_editwin_get_callback(owl_global_get_typwin(g));342 }343 344 326 /* refresh */ 345 327
Note: See TracChangeset
for help on using the changeset viewer.