Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

ODKrnl.h 3.08 KB
Newer Older
rswindell's avatar
rswindell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/* OpenDoors Online Software Programming Toolkit
 * (C) Copyright 1991 - 1999 by Brian Pirie.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
Deucе's avatar
Deucе committed
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
rswindell's avatar
rswindell committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
 *
 *
 *        File: ODKrnl.h
 *
 * Description: Contains the public definitions related to odkrnl.c
 *
 *   Revisions: Date          Ver   Who  Change
 *              ---------------------------------------------------------------
 *              Jan 01, 1995  6.00  BP   Split off from odcore.c and oddoor.h
 *              Dec 12, 1995  6.00  BP   Added entry, exit and kernel macros.
 *              Jan 12, 1996  6.00  BP   Added bOnlyShiftArrow.
 *              Feb 19, 1996  6.00  BP   Changed version number to 6.00.
 *              Mar 03, 1996  6.10  BP   Begin version 6.10.
 *              Mar 13, 1996  6.10  BP   bOnlyShiftArrow -> nArrowUseCount.
 */

#ifndef _INC_ODKRNL
#define _INC_ODKRNL

#include "ODPlat.h"

/* Global kernel-related variables. */
extern tODTimer RunKernelTimer;
extern time_t nNextTimeDeductTime;
extern char chLastControlKey;
extern INT nArrowUseCount;
extern BOOL bForceStatusUpdate;
extern BOOL bSysopColor;
#ifdef OD_MULTITHREADED
extern tODSemaphoreHandle hODActiveSemaphore;
#endif /* OD_MULTITHREADED */

/* Chat mode global variables. */
extern BOOL bIsShell;
extern BOOL bChatted;

/* Kernel function prototypes. */
tODResult ODKrnlInitialize(void);
void ODKrnlShutdown(void);
void ODKrnlHandleLocalKey(WORD wKeyCode);
void ODKrnlEndChatMode(void);
void ODKrnlForceOpenDoorsShutdown(BYTE btReasonForShutdown);
#ifdef OD_MULTITHREADED
tODResult ODKrnlStartChatThread(BOOL bTriggeredInternally);
#endif /* OD_MULTITHREADED */

/* Macro used to generate the appropriate code (if any) to call */
/* the OpenDoors kernel from within OpenDoors code.             */
#ifdef OD_MULTITHREADED
#define CALL_KERNEL_IF_NEEDED()
#else /* !OD_MULTITHREADED */
68
#ifdef ODPLAT_NIX
69
#ifdef USE_KERNEL_SIGNAL
70 71
#define CALL_KERNEL_IF_NEEDED()
#else
rswindell's avatar
rswindell committed
72
#define CALL_KERNEL_IF_NEEDED()     od_kernel()
73 74 75
#endif
#else
#define CALL_KERNEL_IF_NEEDED()     od_kernel()
76
#endif /* !ODPLAT_NIX */
rswindell's avatar
rswindell committed
77 78 79 80 81 82 83 84 85 86 87 88
#endif /* !OD_MULTITHREADED */

/* Macro used to increment or decrement OpenDoors active semaphore. */
#ifdef OD_MULTITHREADED
#define OD_API_ENTRY()              ODSemaphoreUp(hODActiveSemaphore, 1);
#define OD_API_EXIT()               ODSemaphoreDown(hODActiveSemaphore, 1);
#else /* !OD_MULTITHREADED */
#define OD_API_ENTRY()
#define OD_API_EXIT()
#endif /* !OD_MULTITHREADED */

#endif /* _INC_ODKRNL */