Changeset c675b39
- Timestamp:
- Dec 17, 2008, 3:24:25 PM (15 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1631825
- Parents:
- e0096b7
- git-author:
- Nelson Elhage <nelhage@mit.edu> (12/15/08 21:26:36)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (12/17/08 15:24:25)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
rb7bb454 rc675b39 201 201 owl_function_debugmsg("owl_aim_login: connecting"); 202 202 203 g.aim_nop_timer = owl_select_add_timer(30, 30, owl_aim_send_nop, NULL );203 g.aim_nop_timer = owl_select_add_timer(30, 30, owl_aim_send_nop, NULL, NULL); 204 204 205 205 return(0); … … 227 227 owl_global_set_ignore_aimlogin(&g); 228 228 owl_select_add_timer(owl_global_get_aim_ignorelogin_timer(&g), 229 0, owl_aim_unset_ignorelogin, NULL );229 0, owl_aim_unset_ignorelogin, NULL, NULL); 230 230 231 231 /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */ -
owl.c
r80a465c rc675b39 395 395 396 396 397 owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL );397 owl_select_add_timer(180, 180, owl_zephyr_buddycheck_timer, NULL, NULL); 398 398 399 399 /* If we ever deprecate the mainloop hook, remove this. */ 400 owl_select_add_timer(0, 1, owl_perlconfig_mainloop, NULL );400 owl_select_add_timer(0, 1, owl_perlconfig_mainloop, NULL, NULL); 401 401 402 402 -
owl.h
r58d1f8a rc675b39 508 508 int interval; 509 509 void (*callback)(struct _owl_timer *, void *); 510 void (*destroy)(struct _owl_timer *); 510 511 void *data; 511 512 } owl_timer; -
select.c
r58d1f8a rc675b39 11 11 } 12 12 13 owl_timer *owl_select_add_timer(int after, int interval, void (*cb)( struct _owl_timer *, void*), void *data)13 owl_timer *owl_select_add_timer(int after, int interval, void (*cb)(owl_timer *, void *), void (*destroy)(owl_timer*), void *data) 14 14 { 15 15 owl_timer *t = owl_malloc(sizeof(owl_timer)); … … 19 19 t->interval = interval; 20 20 t->callback = cb; 21 t->destroy = destroy; 21 22 t->data = data; 22 23 … … 31 32 if (t && g_list_find(*timers, t)) { 32 33 *timers = g_list_remove(*timers, t); 34 if(t->destroy) { 35 t->destroy(t); 36 } 33 37 owl_free(t); 34 38 } … … 42 46 while(*timers) { 43 47 owl_timer *t = (*timers)->data; 44 void (*cb)(struct _owl_timer *, void *); 45 void *data; 48 int remove = 0; 46 49 47 50 if(t->time > now) 48 51 break; 49 50 cb = t->callback;51 data = t->data;52 52 53 53 /* Reschedule if appropriate */ … … 58 58 (GCompareFunc)_owl_select_timer_cmp); 59 59 } else { 60 remove = 1; 61 } 62 63 /* Do the callback */ 64 t->callback(t, t->data); 65 if(remove) { 60 66 owl_select_remove_timer(t); 61 t = NULL; 62 } 63 64 /* Do the callback */ 65 cb(t, data); 67 } 66 68 } 67 69
Note: See TracChangeset
for help on using the changeset viewer.