Changeset 074bdaa for perlglue.xs


Ignore:
Timestamp:
Jun 22, 2011, 12:37:21 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
bcde7926
Parents:
58f4fb2
git-author:
David Benjamin <davidben@mit.edu> (05/24/11 00:36:51)
git-committer:
David Benjamin <davidben@mit.edu> (06/22/11 00:37:21)
Message:
Replace BarnOwl::Timer with a perl wrapper over AnyEvent

This also allows us to kill owl_timer altogether.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r3b8a563 r074bdaa  
    515515        owl_select_add_perl_io_dispatch(fd, mode, newSVsv(cb));
    516516
    517 IV
    518 add_timer(after, interval, cb, name = NULL)
    519         int after
    520         int interval
    521         SV *cb
    522         const char *name
    523         PREINIT:
    524                 SV *ref;
    525                 owl_timer *t;
    526         CODE:
    527                 ref = sv_rvweaken(newSVsv(cb));
    528                 t = owl_select_add_timer(name,
    529                                          after,
    530                                          interval,
    531                                          owl_perlconfig_perl_timer,
    532                                          owl_perlconfig_perl_timer_destroy,
    533                                          ref);
    534                 owl_function_debugmsg("Created timer %s: %p", t->name ? t->name : "(unnamed)", t);
    535         RETVAL = (IV)t;
    536         OUTPUT:
    537                 RETVAL
    538 
    539 void
    540 remove_timer(timer)
    541         IV timer
    542         PREINIT:
    543                 owl_timer *t;
    544         CODE:
    545                 t = (owl_timer*)timer;
    546                 owl_function_debugmsg("Freeing timer %s: %p", t->name ? t->name : "(unnamed)", t);
    547                 owl_select_remove_timer(t);
    548 
    549517MODULE = BarnOwl                PACKAGE = BarnOwl::Editwin
    550518
Note: See TracChangeset for help on using the changeset viewer.