Changeset 18fdd5f9 for zephyr.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
  • zephyr.c

    r12e291a r18fdd5f9  
    3636  ZNotice_t req;
    3737  Code_t code;
    38   owl_dispatch *dispatch;
    3938
    4039  /*
     
    8079  }
    8180
    82   dispatch = owl_malloc(sizeof(*dispatch));
    83   dispatch->fd = ZGetFD();
    84   dispatch->cfunc = owl_zephyr_finish_initialization;
    85   dispatch->destroy = (void(*)(owl_dispatch*))owl_free;
    86 
    87   owl_select_add_dispatch(dispatch);
    88 }
    89 
    90 void owl_zephyr_finish_initialization(owl_dispatch *d) {
     81  owl_select_add_io_dispatch(ZGetFD(), OWL_IO_READ|OWL_IO_EXCEPT, &owl_zephyr_finish_initialization, NULL, NULL);
     82}
     83
     84void owl_zephyr_finish_initialization(const owl_io_dispatch *d, void *data) {
    9185  Code_t code;
    9286  char *perl;
    9387
    94   owl_select_remove_dispatch(d->fd);
     88  owl_select_remove_io_dispatch(d);
    9589
    9690  ZClosePort();
     
    106100  }
    107101
    108   d = owl_malloc(sizeof(owl_dispatch));
    109   d->fd = ZGetFD();
    110   d->cfunc = &owl_zephyr_process_events;
    111   d->destroy = NULL;
    112   owl_select_add_dispatch(d);
     102  owl_select_add_io_dispatch(ZGetFD(), OWL_IO_READ|OWL_IO_EXCEPT, &owl_zephyr_process_events, NULL, NULL);
     103
    113104  owl_global_set_havezephyr(&g);
    114105
     
    13501341}
    13511342
    1352 void owl_zephyr_process_events(owl_dispatch *d)
     1343void owl_zephyr_process_events(const owl_io_dispatch *d, void *data)
    13531344{
    13541345  _owl_zephyr_process_events();
Note: See TracChangeset for help on using the changeset viewer.