System Events

Name

System Events -- Event dispatching facility.

Synopsis


enum        sys_event_t;
void        system_event                    (sys_event_t type,
                                             gpointer data);
void        system_event_receive            (sys_event_t type,
                                             sys_event_callback func);

Description

This facility allows for non related code to be informed of some events.

For an example look at: src/CPU/drawings/bars.c, src/CPU/drawings/overlapped_bars.c or /src/CPU/drawings/state.c

Details

enum sys_event_t

typedef enum {
	SYS_EVENT_PROC_CREATE=0,	/* there is a new process */
	SYS_EVENT_PROC_DESTROY,		/* a process terminated */
	SYS_EVENT_PROC_READY,		/* a process is now ready to run */
	SYS_EVENT_PROC_QUEUED,		/* a process put in a ready queue */
	SYS_EVENT_PROC_RUNNING,		/* a process is now running */
	SYS_EVENT_PROC_WAITING,		/* a process is now blocked */
	SYS_EVENT_PROC_SELECT,		/* a process has been selected by
					   the user */
	SYS_EVENT_FRAME_SELECT		/* the user selected a memory frame */
}sys_event_t;


system_event ()

void        system_event                    (sys_event_t type,
                                             gpointer data);

Generate a system event of type type with argument data.

type : type of the event.
data : agument of the event.


system_event_receive ()

void        system_event_receive            (sys_event_t type,
                                             sys_event_callback func);

Instruct the system events code to call func when ever an event of type type ocurs.

type : type of event to receive.
func : function to call.