Changeset b7bb454 for global.c


Ignore:
Timestamp:
Dec 6, 2008, 5:39:49 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
7ce4003
Parents:
3ea31b6
git-author:
Nelson Elhage <nelhage@mit.edu> (12/06/08 17:36:19)
git-committer:
Nelson Elhage <nelhage@mit.edu> (12/06/08 17:39:49)
Message:
Make owl_timer have a callback and integrate into the select() loop.

Soon we should add support for registering timers from perl, and then
we can eventually remove the perl mainloop hook.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r2b237308 rb7bb454  
    100100  g->aim_screenname_for_filters=NULL;
    101101  g->aim_loggedin=0;
    102   owl_timer_create_countdown(&(g->aim_noop_timer), 30);
    103   owl_timer_create_countdown(&(g->aim_ignorelogin_timer), 0);
    104   owl_timer_create_countdown(&(g->aim_buddyinfo_timer), 60);
    105102  owl_buddylist_init(&(g->buddylist));
    106    
     103
    107104  g->havezephyr=0;
    108105  g->haveaim=0;
     106  g->ignoreaimlogin=0;
    109107  owl_global_set_no_doaimevents(g);
    110108
     
    113111
    114112  owl_zbuddylist_create(&(g->zbuddies));
    115   owl_timer_create_countdown(&(g->zephyr_buddycheck_timer), 60*3);
    116113
    117114  owl_obarray_init(&(g->obarray));
     
    119116  owl_message_init_fmtext_cache();
    120117  owl_list_create(&(g->dispatchlist));
     118  g->timerlist = g_sequence_new(NULL);
    121119}
    122120
     
    814812}
    815813
    816 int owl_global_is_aimnop_time(owl_global *g)
    817 {
    818   if (owl_timer_is_expired(&(g->aim_noop_timer))) return(1);
    819   return(0);
    820 }
    821 
    822 void owl_global_aimnop_sent(owl_global *g)
    823 {
    824   owl_timer_reset(&(g->aim_noop_timer));
    825 }
    826 
    827 owl_timer *owl_global_get_aim_login_timer(owl_global *g)
    828 {
    829   return(&(g->aim_ignorelogin_timer));
    830 }
    831 
    832814/* message queue */
    833815
     
    902884}
    903885
     886void owl_global_set_ignore_aimlogin(owl_global *g)
     887{
     888    g->ignoreaimlogin = 1;
     889}
     890
     891void owl_global_unset_ignore_aimlogin(owl_global *g)
     892{
     893    g->ignoreaimlogin = 0;
     894}
     895
     896int owl_global_is_ignore_aimlogin(owl_global *g)
     897{
     898    return g->ignoreaimlogin;
     899}
     900
    904901void owl_global_set_havezephyr(owl_global *g)
    905902{
     
    911908  if (g->havezephyr) return(1);
    912909  return(0);
    913 }
    914 
    915 owl_timer *owl_global_get_aim_buddyinfo_timer(owl_global *g)
    916 {
    917   return(&(g->aim_buddyinfo_timer));
    918910}
    919911
     
    944936}
    945937
    946 owl_timer *owl_global_get_zephyr_buddycheck_timer(owl_global *g)
    947 {
    948   return(&(g->zephyr_buddycheck_timer));
    949 }
    950938
    951939owl_zbuddylist *owl_global_get_zephyr_buddylist(owl_global *g)
     
    968956  return &(g->dispatchlist);
    969957}
     958
     959GSequence *owl_global_get_timerlist(owl_global *g)
     960{
     961    return g->timerlist;
     962}
Note: See TracChangeset for help on using the changeset viewer.