1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It is one of the source files comprising zwgc, the Zephyr WindowGram
5 * Created by: Marc Horowitz <marc@athena.mit.edu>
9 * Copyright (c) 1989 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
15 #include <zephyr/mit-copyright.h>
21 * MAX_SOURCES - the greatest file descriptor # that can be waited on minus one
22 * This can not exceed FD_SETSIZE from <sys/types.h>.
25 #define MAX_SOURCES 32
28 * mux_end_loop_p - Setting this to true during a mux_loop causes the mux_loop
32 extern int mux_end_loop_p;
36 * Requires: mux_init has never been called before
37 * Effects: Initializes the mux module. Must be called before
41 extern void mux_init();
44 * void mux_add_input_source(int descriptior; void (*handler)(); void *arg)
45 * Requires: 0<=descriptor<MAX_SOURCES, mux_init has been called
46 * Modifies: Removes the previous input handler if any for descriptor
47 * Effects: Registers handler as the input handler for file descriptor
48 * descriptor. When mux_loop() is running and input is
49 * available on descriptor, handler will be called with
53 extern void mux_add_input_source();
57 * Requires: mux_init has been called.
58 * Effects: Loops until mux_end_loop_p becomes true. (Sets
59 * mux_end_loop_p false to start). Whenever input is
60 * available on an input source which has a registered
61 * handler (see mux_add_input_source), that handler is
62 * called with its argument. It is guarenteed that if
63 * input is available on a source, its respective input
64 * handler, if any, will eventually be called. No other
65 * ordering guarentees are made. When some signal handler
66 * or input handler eventually sets mux_end_loop_p to
70 extern void mux_loop();