Annotation of freem/src/events.h, revision 1.1
1.1 ! snw 1: /*
! 2: * *
! 3: * * *
! 4: * * *
! 5: * ***************
! 6: * * * * *
! 7: * * MUMPS *
! 8: * * * * *
! 9: * ***************
! 10: * * *
! 11: * * *
! 12: * *
! 13: *
! 14: * events.h
! 15: * event framework
! 16: *
! 17: *
! 18: * Author: Serena Willis <jpw@coherent-logic.com>
! 19: * Copyright (C) 1998 MUG Deutschland
! 20: * Copyright (C) 2020 Coherent Logic Development LLC
! 21: *
! 22: *
! 23: * This file is part of FreeM.
! 24: *
! 25: * FreeM is free software: you can redistribute it and/or modify
! 26: * it under the terms of the GNU Affero Public License as published by
! 27: * the Free Software Foundation, either version 3 of the License, or
! 28: * (at your option) any later version.
! 29: *
! 30: * FreeM is distributed in the hope that it will be useful,
! 31: * but WITHOUT ANY WARRANTY; without even the implied warranty of
! 32: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 33: * GNU Affero Public License for more details.
! 34: *
! 35: * You should have received a copy of the GNU Affero Public License
! 36: * along with FreeM. If not, see <https://www.gnu.org/licenses/>.
! 37: *
! 38: **/
! 39:
! 40: #if !defined(_EVENTS_H)
! 41: #define _EVENTS_H
! 42:
! 43: #include "freem.h"
! 44: #include "mref.h"
! 45:
! 46: #define EVT_QLENGTH 255
! 47: #define EVT_MAX 9
! 48:
! 49: #define EVT_CLS_COMM 0 /* Device events */
! 50: #define EVT_CLS_HALT 1 /* Process halted */
! 51: #define EVT_CLS_IPC 2 /* IPC received */
! 52: #define EVT_CLS_INTERRUPT 3 /* Interrupt received */
! 53: #define EVT_CLS_POWER 4 /* Power fail eminent */
! 54: #define EVT_CLS_TIMER 5 /* Timer interval expired */
! 55: #define EVT_CLS_USER 6 /* User-defined (ETRIGGER) events */
! 56: #define EVT_CLS_WAPI 7 /* MWAPI (synchronous only) */
! 57: #define EVT_CLS_TRIGGER 8 /* Database triggers */
! 58:
! 59: #define EVT_S_NOMODIFY -1
! 60: #define EVT_S_DISABLED 0
! 61: #define EVT_S_ASYNC 1
! 62: #define EVT_S_SYNC 2
! 63:
! 64: typedef struct evt_entry {
! 65:
! 66: char event_id[256]; /* Event identifier */
! 67: short evt_class; /* EVT_CLS_* */
! 68:
! 69: } evt_entry;
! 70:
! 71: typedef struct evt_status_t {
! 72:
! 73: short comm;
! 74: short halt;
! 75: short ipc;
! 76: short interrupt;
! 77: short power;
! 78: short timer;
! 79: short user;
! 80: short wapi;
! 81: short trigger;
! 82:
! 83: } evt_status_t;
! 84:
! 85: extern short evt_async_enabled;
! 86: extern short evt_async_restore;
! 87: extern short evt_async_initial;
! 88:
! 89: extern short evt_queue_rear;
! 90: extern short evt_queue_front;
! 91: extern evt_entry *evt_queue[];
! 92: extern short evt_status[];
! 93: extern int evt_blocks[EVT_MAX];
! 94: extern int evt_depth;
! 95:
! 96: extern int pending_signal_type;
! 97:
! 98: /* evt_init(): initialize event framework */
! 99: extern void evt_init (void);
! 100:
! 101: extern int evt_ablock (short evt_class);
! 102: extern int evt_aunblock (short evt_class);
! 103:
! 104: /* evt_enqueue(): enqueue an event. interrupt should be non-zero if you wish to immediately interrupt the interpreter */
! 105: extern int evt_enqueue (char *event_id, short evt_class, short interrupt);
! 106: extern evt_entry *evt_dequeue (void);
! 107: extern char *evt_class_name (evt_entry *e);
! 108: extern char *evt_class_name_c (int c);
! 109: extern int evt_get_handlers (char *buf);
! 110: extern short evt_registered(char *event_id, short evt_class);
! 111:
! 112: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>