Changeset f36cd97 for perlconfig.c


Ignore:
Timestamp:
Dec 17, 2008, 5:12:37 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
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:
1895c29
Parents:
1631825
git-author:
Nelson Elhage <nelhage@mit.edu> (12/17/08 15:44:15)
git-committer:
Nelson Elhage <nelhage@mit.edu> (12/17/08 17:12:37)
Message:
Add a void* data to owl_dispatch and pass it around.

Add a void* data field for the use of dispatches, and pass around the
owl_dispatch. This allows one dispatch function to be used for
multiple fd's, and lets us eliminate perl-specific code from the
dispatch loop. In addition, we need to add a destructor to
owl_dispatch so that perl dispatches can have their SV* decref'd on
destroy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r1631825 rf36cd97  
    446446void owl_perlconfig_dispatch_free(owl_dispatch *d)
    447447{
    448   SvREFCNT_dec(d->pfunc);
     448  SvREFCNT_dec(d->data);
    449449}
    450450
     
    494494}
    495495
    496 void owl_perlconfig_do_dispatch(owl_dispatch *d)
    497 {
    498   SV *cb = d->pfunc;
     496void owl_perlconfig_dispatch(owl_dispatch *d)
     497{
     498  SV *cb = d->data;
    499499  dSP;
    500500  if(cb == NULL) {
    501501    owl_function_error("Perl callback is NULL!");
     502    return;
    502503  }
    503504
Note: See TracChangeset for help on using the changeset viewer.