Changeset 18fdd5f9 for popexec.c


Ignore:
Timestamp:
Oct 27, 2009, 12:41:17 AM (12 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
6fc40a7
Parents:
ffc4df6
git-author:
Alejandro R. Sedeño <asedeno@mit.edu> (10/24/09 17:31:48)
git-committer:
Alejandro R. Sedeño <asedeno@mit.edu> (10/27/09 00:41:17)
Message:
Switch C to the new I/O Dispatch API.

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

Legend:

Unmodified
Added
Removed
  • popexec.c

    r0e5afa2 r18fdd5f9  
    5353    pe->pid=pid;
    5454    pe->winactive=1;
    55     pe->dispatch.fd = parent_read_fd;
    56     pe->dispatch.cfunc = owl_popexec_inputhandler;
    57     pe->dispatch.destroy = owl_popexec_free_dispatch;
    58     pe->dispatch.data = pe;
    59     owl_select_add_dispatch(&pe->dispatch);
     55    pe->dispatch = owl_select_add_io_dispatch(parent_read_fd, OWL_IO_READ|OWL_IO_EXCEPT, &owl_popexec_inputhandler, &owl_popexec_delete_dispatch, pe);
    6056    pe->refcount++;
    6157  } else {
     
    7874}
    7975
    80 void owl_popexec_inputhandler(owl_dispatch *d)
     76void owl_popexec_inputhandler(const owl_io_dispatch *d, void *data)
    8177{
    82   owl_popexec *pe = d->data;
     78  owl_popexec *pe = data;
    8379  int navail, bread, rv_navail;
    8480  char *buf;
     
    9995  /* the viewwin has closed */
    10096  if (!pe->pid && !pe->winactive) {
    101     owl_select_remove_dispatch(d->fd);
     97    owl_select_remove_io_dispatch(d);
    10298    return;
    10399  }
     
    116112      owl_viewwin_redisplay(pe->vwin, 1);
    117113    }
    118     owl_select_remove_dispatch(d->fd);
     114    owl_select_remove_io_dispatch(d);
    119115    return;
    120116  }
     
    146142}
    147143
    148 void owl_popexec_free_dispatch(owl_dispatch *d)
     144void owl_popexec_delete_dispatch(const owl_io_dispatch *d)
    149145{
    150146  owl_popexec *pe = d->data;
     
    159155
    160156  pe->winactive = 0;
    161   if (pe->dispatch.fd>0) {
    162     owl_select_remove_dispatch(pe->dispatch.fd);
     157  if (pe->dispatch->fd > 0) {
     158    owl_select_remove_io_dispatch(pe->dispatch);
    163159  }
    164160  if (pe->pid) {
Note: See TracChangeset for help on using the changeset viewer.