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

    r23fddad r18fdd5f9  
    315315}
    316316
    317 void owl_process_input(owl_dispatch *d)
     317void owl_process_input(const owl_io_dispatch *d, void *data)
    318318{
    319319  owl_input j;
     
    444444
    445445/* Sends stderr (read from rfd) messages to the error console */
    446 void stderr_redirect_handler(owl_dispatch *d)
     446void stderr_redirect_handler(const owl_io_dispatch *d, void *data)
    447447{
    448448  int navail, bread;
     
    521521  owl_global_set_haveaim(&g);
    522522
    523   /* prepare stdin dispatch */
    524   {
    525     owl_dispatch *d = owl_malloc(sizeof(owl_dispatch));
    526     d->fd = STDIN;
    527     d->cfunc = &owl_process_input;
    528     d->destroy = NULL;
    529     owl_select_add_dispatch(d);
    530   }
    531 
     523  /* register STDIN dispatch; throw away return, we won't need it */
     524  owl_select_add_io_dispatch(STDIN, OWL_IO_READ, &owl_process_input, NULL, NULL);
    532525  owl_zephyr_initialize();
    533526
    534527#if OWL_STDERR_REDIR
    535528  /* Do this only after we've started curses up... */
    536   {
    537     owl_dispatch *d = owl_malloc(sizeof(owl_dispatch));
    538     owl_function_debugmsg("startup: doing stderr redirection");
    539     d->fd = stderr_replace();
    540     d->cfunc = stderr_redirect_handler;
    541     d->destroy = NULL;
    542     owl_select_add_dispatch(d);
    543   }
     529  owl_function_debugmsg("startup: doing stderr redirection");
     530  owl_select_add_io_dispatch(stderr_replace(), OWL_IO_READ, &stderr_redirect_handler, NULL, NULL);
    544531#endif
    545532
Note: See TracChangeset for help on using the changeset viewer.