Changeset ffc4df6 for select.c


Ignore:
Timestamp:
Oct 27, 2009, 12:41:17 AM (15 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
18fdd5f9
Parents:
df0138f
git-author:
Alejandro R. Sedeño <asedeno@mit.edu> (10/24/09 14:56:01)
git-committer:
Alejandro R. Sedeño <asedeno@mit.edu> (10/27/09 00:41:17)
Message:
Switch perl API to new I/O Dispatch API.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • select.c

    rdf0138f rffc4df6  
    156156{
    157157  return owl_list_get_size(owl_global_get_dispatchlist(&g));
    158 }
    159 
    160 int owl_select_add_perl_dispatch(int fd, SV *cb)
    161 {
    162   int elt;
    163   owl_dispatch *d;
    164   elt = owl_select_find_dispatch(fd);
    165   if (elt != -1) {
    166     d = owl_list_get_element(owl_global_get_dispatchlist(&g), elt);
    167     if (d->cfunc != owl_perlconfig_dispatch) {
    168       /* don't mess with non-perl dispatch functions from here. */
    169       return 1;
    170     }
    171   }
    172 
    173   d = owl_malloc(sizeof(owl_dispatch));
    174   d->fd = fd;
    175   d->cfunc = owl_perlconfig_dispatch;
    176   d->destroy = owl_perlconfig_dispatch_free;
    177   d->data = cb;
    178   owl_select_add_dispatch(d);
    179   return 0;
    180 }
    181 
    182 int owl_select_remove_perl_dispatch(int fd)
    183 {
    184   int elt;
    185   owl_dispatch *d;
    186  
    187   elt = owl_select_find_dispatch(fd);
    188   if (elt != -1) {
    189     d = owl_list_get_element(owl_global_get_dispatchlist(&g), elt);
    190     if (d->cfunc == owl_perlconfig_dispatch) {
    191       owl_select_remove_dispatch_at(elt);
    192       return 0;
    193     }
    194   }
    195   return 1;
    196158}
    197159
Note: See TracChangeset for help on using the changeset viewer.