- Timestamp:
- Mar 23, 2010, 5:23:43 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 8dfb59c
- Parents:
- 6b78afb
- git-author:
- Nelson Elhage <nelhage@mit.edu> (03/13/10 21:18:03)
- git-committer:
- Nelson Elhage <nelhage@ksplice.com> (03/23/10 17:23:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
editwin.c
rf449096 r1b1cd2c 37 37 char *command; 38 38 void (*callback)(struct _owl_editwin*); 39 void (*destroy_cbdata)(void *); 39 40 void *cbdata; 40 41 }; … … 58 59 static int oe_copy_region(owl_editwin *e); 59 60 static char *oe_chunk(owl_editwin *e, int start, int end); 61 static void oe_destroy_cbdata(owl_editwin *e); 60 62 61 63 #define INCR 4096 … … 145 147 e->echochar='\0'; 146 148 147 /* We get initialized multiple times, but we need to hold on to148 the callbacks, so we can't NULL them here. */149 /*150 e->command = NULL;151 e->callback = NULL;152 e->cbdata = NULL;153 */154 149 if (win) werase(win); 155 150 } … … 210 205 } 211 206 212 void owl_editwin_set_cbdata(owl_editwin *e, void *data) 213 { 207 static void oe_destroy_cbdata(owl_editwin *e) { 208 if (e->destroy_cbdata) 209 e->destroy_cbdata(e->cbdata); 210 e->cbdata = NULL; 211 e->destroy_cbdata = NULL; 212 } 213 214 void owl_editwin_set_cbdata(owl_editwin *e, void *data, void (*destroy)(void *)) 215 { 216 oe_destroy_cbdata(e); 214 217 e->cbdata = data; 218 e->destroy_cbdata = destroy; 215 219 } 216 220 … … 282 286 owl_free(e->buff); 283 287 owl_editwin_init(e, e->curswin, e->winlines, e->wincols, e->style, e->hist); 288 e->callback = NULL; 289 oe_destroy_cbdata(e); 284 290 } 285 291
Note: See TracChangeset
for help on using the changeset viewer.