Annotation of freem/src/events.h, revision 1.3

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>