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

OpenDoor.h 43.5 KB
Newer Older
rswindell's avatar
rswindell committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* OpenDoors Online Software Programming Toolkit
 * (C) Copyright 1991 - 1999 by Brian Pirie.
 *
 * Oct-2001 door32.sys/socket modifications by Rob Swindell (www.synchro.net)
 *
 * 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
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
rswindell's avatar
rswindell committed
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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
 *
 *
 *        File: OpenDoor.h
 *
 * Description: C/C++ definition of the OpenDoors API. Any program source file
 *              that uses OpenDoors must #include this file.
 *
 *   Revisions: Date          Ver   Who  Change
 *              ---------------------------------------------------------------
 *              Dec 02, 1995  6.00  BP   New file header format.
 *              Dec 09, 1995  6.00  BP   Added od_multiline_edit() prototype.
 *              Dec 12, 1995  6.00  BP   Cleaned up, added DLL definitions.
 *              Dec 12, 1995  6.00  BP   Moved ODPLAT_??? to OpenDoor.h.
 *              Dec 21, 1995  6.00  BP   Add ability to use already open port.
 *              Dec 22, 1995  6.00  BP   Added od_connect_speed.
 *              Dec 23, 1995  6.00  BP   Added EDIT_FLAG_SHOW_SIZE.
 *              Dec 30, 1995  6.00  BP   Added ODCALL for calling convention.
 *              Jan 01, 1996  6.00  BP   BCC32 compatibility changes.
 *              Jan 01, 1996  6.00  BP   Added new mulitline editor options.
 *              Jan 01, 1996  6.00  BP   Added od_disable_dtr, DIS_DTR_DISABLE.
 *              Jan 03, 1996  6.00  BP   Further BCC32 compatiblity changes.
 *              Jan 04, 1996  6.00  BP   Added od_get_input() and related defs.
 *              Jan 07, 1996  6.00  BP   Added OD_GLOBAL_CONV.
 *              Jan 19, 1996  6.00  BP   Removed some unused stuff.
 *              Jan 19, 1996  6.00  BP   Added od_internal_debug.
 *              Jan 23, 1996  6.00  BP   Added od_exiting and ERR_UNSUPPORTED.
 *              Jan 30, 1996  6.00  BP   New extern "C" decl for od_control.
 *              Jan 30, 1996  6.00  BP   Replaced od_yield() with od_sleep().
 *              Jan 31, 1996  6.00  BP   Added DIS_NAME_PROMPT.
 *              Jan 31, 1996  6.00  BP   Added tODMilliSec, OD_NO_TIMEOUT.
 *              Jan 31, 1996  6.00  BP   Added timeout for od_get_input().
 *              Feb 02, 1996  6.00  BP   Add RA 2.50-related od_control vars.
 *              Feb 03, 1996  6.00  BP   Added more editor options.
 *              Feb 06, 1996  6.00  BP   Added od_silent_mode.
 *              Feb 08, 1996  6.00  BP   Added editor buffer grow option.
 *              Feb 13, 1996  6.00  BP   Added od_get_input() flags parameter.
 *              Feb 14, 1996  6.00  BP   Recognize Borland's __WIN32__ define.
 *              Feb 17, 1996  6.00  BP   Added OD_KEY_F1 thru OD_KEY_F10.
 *              Feb 19, 1996  6.00  BP   Changed version number to 6.00.
 *              Feb 27, 1996  6.00  BP   Added od_max_key_latency.
 *              Mar 03, 1996  6.10  BP   Begin version 6.10.
 *              Mar 03, 1996  6.10  BP   Fixed OD_COMPONENT for medium mem mod.
 *              Mar 06, 1996  6.10  BP   Added TRIBBS.SYS support.
 *              Mar 06, 1996  6.10  BP   Added COM_DOOR32.
 *              Mar 11, 1996  6.10  BP   Added OD_VERSION.
 *              Mar 13, 1996  6.10  BP   Added od_get_cursor().
 *              Mar 13, 1996  6.10  BP   Added od_local_win_col.
 *              Mar 14, 1996  6.10  BP   Added od_config_callback.
 *              Mar 21, 1996  6.10  BP   Added od_control_get().
 *              Apr 08, 1996  6.10  BP   Added command-line parsing callbacks.
 *              Oct 19, 2001  6.20  RS   Added door32.sys and socket support.
 *              Oct 19, 2001  6.21  RS   Fixed socket disconnect bug.
 */

/* Only parse OpenDoor.h once. */
#ifndef _INC_OPENDOOR
#define _INC_OPENDOOR


/* ========================================================================= */
/* Version and platform definitions.                                         */
/* ========================================================================= */

/* OpenDoors API version number. */
83
#define OD_VERSION 0x624
rswindell's avatar
rswindell committed
84

deuce's avatar
deuce committed
85 86 87
#define DIRSEP		'\\'
#define DIRSEP_STR	"\\"

rswindell's avatar
rswindell committed
88 89 90 91 92 93 94 95 96 97 98
/* OpenDoors target platform. */
#if defined(WIN32) || defined(__WIN32__) || defined(_WIN32)
#define ODPLAT_WIN32
#undef ODPLAT_DOS
#ifdef OD_WIN32_STATIC
#pragma message("Compiling for Win32 static version of OpenDoors")
#else /* !OD_WIN32_STATIC */
#pragma message("Compiling for Win32 DLL version of OpenDoors")
#define OD_DLL
#endif /* !OD_WIN32_STATIC */
#else /* !WIN32 */
deuce's avatar
deuce committed
99
#if defined(__unix__) || defined(__NetBSD__) || defined(__APPLE__)
deuce's avatar
deuce committed
100 101
#define ODPLAT_NIX
#undef ODPLAT_DOS
deuce's avatar
deuce committed
102 103 104 105
#undef DIRSEP
#define DIRSEP '/'
#undef DIRSEP_STR
#define DIRSEP_STR "/"
deuce's avatar
deuce committed
106
#else
rswindell's avatar
rswindell committed
107 108 109
#define ODPLAT_DOS
#undef ODPLAT_WIN32
#pragma message("Compiling for DOS version of OpenDoors")
deuce's avatar
deuce committed
110
#endif /* !NIX */
rswindell's avatar
rswindell committed
111 112
#endif /* !WIN32 */

deuce's avatar
deuce committed
113

rswindell's avatar
rswindell committed
114 115 116 117 118 119 120 121
/* Include any other headers required by OpenDoor.h. */
#ifdef ODPLAT_WIN32 
#include "windows.h"
#endif /* ODPLAT_WIN32 */

/* For DLL versions, definitions of function or data that is exported from */
/* a module or imported into a module.                                     */
#ifdef OD_DLL
122
#if defined(_MSC_VER) || defined(__BORLANDC__)
rswindell's avatar
rswindell committed
123
#define OD_EXPORT __declspec(dllexport)
124
#else /* !_MSC_VER || __BORLANDC__ */
rswindell's avatar
rswindell committed
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
#define OD_EXPORT _export
#endif /* !_MSC_VER */
#define OD_IMPORT DECLSPEC_IMPORT
#else /* !OD_DLL */
#define OD_EXPORT
#define OD_IMPORT
#endif /* !OD_DLL */

/* Definition of function naming convention used by OpenDoors. */
#ifdef __cplusplus
#define OD_NAMING_CONVENTION extern "C"
#else /* !__cplusplus */
#define OD_NAMING_CONVENTION
#endif /* !__cplusplus */

/* Definition of function calling convention used by OpenDoors. */
#ifdef ODPLAT_WIN32
#define ODCALL WINAPI
#define ODVCALL WINAPIV
#define OD_GLOBAL_CONV WINAPI
#else /* !ODPLAT_WIN32 */
#define ODCALL
#define ODVCALL
#define OD_GLOBAL_CONV
#endif /* !ODPLAT_WIN32 */

/* OpenDoors API function declaration type. */
#ifdef BUILDING_OPENDOORS
#define ODAPIDEF OD_NAMING_CONVENTION OD_EXPORT
#else /* !BUILDING_OPENDOORS */
#define ODAPIDEF OD_NAMING_CONVENTION OD_IMPORT
#endif /* !BUILDING_OPENDOORS */

/* OpenDoors API global variable definition and declaration types. */
#define OD_API_VAR_DEFN OD_NAMING_CONVENTION OD_EXPORT

#ifdef BUILDING_OPENDOORS
#define OD_API_VAR_DECL extern OD_EXPORT
#else /* !BUILDING_OPENDOORS */
#define OD_API_VAR_DECL extern OD_IMPORT
#endif /* !BUILDING_OPENDOORS */

/* Explicitly far pointers. */
#ifdef ODPLAT_DOS
#define ODFAR far
#else /* !ODPLAT_DOS */
#define ODFAR
#endif /* !ODPLAT_DOS */


/* ========================================================================= */
/* Primitive data types.                                                     */
/* ========================================================================= */

/* Portable types that are the same size across all platforms */
#ifndef ODPLAT_WIN32
181
#ifndef BYTE
rswindell's avatar
rswindell committed
182
typedef unsigned char      BYTE;                        /* Unsigned, 8 bits. */
183 184
#endif
#ifndef WORD
rswindell's avatar
rswindell committed
185
typedef unsigned short     WORD;                       /* Unsigned, 16 bits. */
186 187
#endif
#ifndef DWORD
rswindell's avatar
rswindell committed
188
typedef unsigned long      DWORD;                      /* Unsigned, 32 bits. */
189 190
#endif
#ifndef CHAR
rswindell's avatar
rswindell committed
191
typedef char               CHAR;         /* Native character representation. */
192
#endif
193 194
#define DWORD_DEFINED
#define WORD_DEFINED
rswindell's avatar
rswindell committed
195 196 197 198
#endif /* !ODPLAT_WIN32 */

typedef signed char        INT8;                          /* Signed, 8 bits. */
typedef signed short int   INT16;                        /* Signed, 16 bits. */
199
#ifndef ODPLAT_WIN32	/* avoid type redefinition from basetsd.h */
rswindell's avatar
rswindell committed
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
typedef signed long int    INT32;                        /* Signed, 32 bits. */
#endif


/* Types that vary in size depending on platform. These are guranteed to be */
/* at least the given size, but may be larger if this platform can          */
/* represent a larger value more efficiently (or as efficiently).           */
#ifndef ODPLAT_WIN32
typedef int                INT;                /* Integer, at least 16 bits. */
typedef unsigned int       UINT;      /* Unsigned integer, at least 16 bits. */
#ifndef BOOL
typedef char               BOOL;           /* Boolean value, at least 1 bit. */
#endif /* !BOOL */
#endif /* !ODPLAT_WIN32 */

/* TRUE and FALSE manifest constants, for use with BOOL data type. */
#ifndef FALSE
#define FALSE 0
#endif /* !FALSE */
#ifndef TRUE
#define TRUE 1
#endif /* !TRUE */


/* ========================================================================= */
/* OpenDoors complex data types and defines.                                 */
/* ========================================================================= */

/* Millisecond time type. */
typedef DWORD tODMilliSec;

/* Special value tODMilliSec value for no timeouts. */
#ifdef ODPLAT_WIN32
#define OD_NO_TIMEOUT INFINITE
#else /* !ODPLAT_WIN32 */
#define OD_NO_TIMEOUT 0xffffffffL
#endif /* !ODPLAT_WIN32 */


/* Multi-line editor defintions. */

/* Editor text formats. */
typedef enum
{
244 245 246 247
    FORMAT_PARAGRAPH_BREAKS
   ,FORMAT_LINE_BREAKS
   ,FORMAT_FTSC_MESSAGE
   ,FORMAT_NO_WORDWRAP
rswindell's avatar
rswindell committed
248 249 250 251 252
} tODEditTextFormat;

/* Menu callback function return values. */
typedef enum
{
253 254
    EDIT_MENU_DO_NOTHING
   ,EDIT_MENU_EXIT_EDITOR
rswindell's avatar
rswindell committed
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
} tODEditMenuResult;

/* Editor flags. */
#define EFLAG_NORMAL       0x00000000

/* Optional multi-line editor settings. */
typedef struct
{
   INT nAreaLeft;
   INT nAreaTop;
   INT nAreaRight;
   INT nAreaBottom;
   tODEditTextFormat TextFormat;
   tODEditMenuResult (*pfMenuCallback)(void *pUnused);
   void * (*pfBufferRealloc)(void *pOriginalBuffer, UINT unNewSize);
   DWORD dwEditFlags;
   char *pszFinalBuffer;
   UINT unFinalBufferSize;
} tODEditOptions;

/* Editor return values. */
#define OD_MULTIEDIT_ERROR          0
#define OD_MULTIEDIT_SUCCESS        1


/* Input event information. */

/* Input event types. */
typedef enum
{
285 286
    EVENT_CHARACTER
   ,EVENT_EXTENDED_KEY
rswindell's avatar
rswindell committed
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
} tODInputEventType;

/* Extended key codes. */
#define OD_KEY_F1          0x3b
#define OD_KEY_F2          0x3c
#define OD_KEY_F3          0x3d
#define OD_KEY_F4          0x3e
#define OD_KEY_F5          0x3f
#define OD_KEY_F6          0x40
#define OD_KEY_F7          0x41
#define OD_KEY_F8          0x42
#define OD_KEY_F9          0x43
#define OD_KEY_F10         0x44
#define OD_KEY_UP          0x48
#define OD_KEY_DOWN        0x50
#define OD_KEY_LEFT        0x4b
#define OD_KEY_RIGHT       0x4d
#define OD_KEY_INSERT      0x52
#define OD_KEY_DELETE      0x53
#define OD_KEY_HOME        0x47
#define OD_KEY_END         0x4f
#define OD_KEY_PGUP        0x49
#define OD_KEY_PGDN        0x51
deuce's avatar
deuce committed
310 311
#define OD_KEY_F11         0x85
#define OD_KEY_F12         0x86
rswindell's avatar
rswindell committed
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
#define OD_KEY_SHIFTTAB    0x0f

/* Input event structure. */
typedef struct
{
   tODInputEventType EventType;
   BOOL bFromRemote;
   char chKeyPress;
} tODInputEvent;


/* Third option (in addition to TRUE and FALSE) for tri-state options. */
#define MAYBE 2

/* od_spawnvpe() flags. */
#define P_WAIT                  0
#define P_NOWAIT                1
#define CURRENT                 0
#define IRET                    1

/* od_edit_str() flags. */
#define EDIT_FLAG_NORMAL        0x0000
#define EDIT_FLAG_NO_REDRAW     0x0001
#define EDIT_FLAG_FIELD_MODE    0x0002
#define EDIT_FLAG_EDIT_STRING   0x0004
#define EDIT_FLAG_STRICT_INPUT  0x0008
#define EDIT_FLAG_PASSWORD_MODE 0x0010
#define EDIT_FLAG_ALLOW_CANCEL  0x0020
#define EDIT_FLAG_FILL_STRING   0x0040
#define EDIT_FLAG_AUTO_ENTER    0x0080
#define EDIT_FLAG_AUTO_DELETE   0x0100
#define EDIT_FLAG_KEEP_BLANK    0x0200
#define EDIT_FLAG_PERMALITERAL  0x0400
#define EDIT_FLAG_LEAVE_BLANK   0x0800
#define EDIT_FLAG_SHOW_SIZE     0x1000

/* od_edit_str() return values. */
#define EDIT_RETURN_ERROR       0
#define EDIT_RETURN_CANCEL      1
#define EDIT_RETURN_ACCEPT      2
#define EDIT_RETURN_PREVIOUS    3
#define EDIT_RETURN_NEXT        4

/* od_popup_menu() flag values. */
#define MENU_NORMAL             0x0000
#define MENU_ALLOW_CANCEL       0x0001
#define MENU_PULLDOWN           0x0002
#define MENU_KEEP               0x0004
#define MENU_DESTROY            0x0008

/* od_autodetect() flag values. */
#define DETECT_NORMAL           0x0000

/* od_scroll() flags. */
#define SCROLL_NORMAL           0x0000
#define SCROLL_NO_CLEAR         0x0001

/* OpenDoors status line settings */
#define STATUS_NORMAL           0
#define STATUS_NONE             8
#define STATUS_ALTERNATE_1      1
#define STATUS_ALTERNATE_2      2
#define STATUS_ALTERNATE_3      3
#define STATUS_ALTERNATE_4      4
#define STATUS_ALTERNATE_5      5
#define STATUS_ALTERNATE_6      6
#define STATUS_ALTERNATE_7      7

/* OpenDoors color definitions. */
#define D_BLACK                 0
#define D_BLUE                  1
#define D_GREEN                 2
#define D_CYAN                  3
#define D_RED                   4
#define D_MAGENTA               5
#define D_BROWN                 6
#define D_GREY                  7
#define L_BLACK                 8
#define L_BLUE                  9
#define L_GREEN                 10
#define L_CYAN                  11
#define L_RED                   12
#define L_MAGENTA               13
#define L_YELLOW                14
#define L_WHITE                 15
#define B_BLACK                 L_BLACK
#define B_BLUE                  L_BLUE
#define B_GREEN                 L_GREEN
#define B_CYAN                  L_CYAN
#define B_RED                   L_RED
#define B_MAGENTA               L_MAGENTA
#define B_BROWN                 L_YELLOW
#define B_GREY                  L_WHITE

/* Door information file formats (od_control.od_info_type). */
#define DORINFO1              0                              /* DORINFO?.DEF */
#define EXITINFO              1     /* QBBS 2.6? EXITINFO.BBS & DORINFO?.DEF */
#define RA1EXITINFO           2       /* RA 1.?? EXITINFO.BBS & DORINFO?.DEF */
#define CHAINTXT              3                                 /* CHAIN.TXT */
#define SFDOORSDAT            4                               /* SFDOORS.DAT */
#define CALLINFO              5                              /* CALLINFO.BBS */
#define DOORSYS_GAP           6                     /* GAP/PC-Board DOOR.SYS */
#define DOORSYS_DRWY          7                          /* DoorWay DOOR.SYS */
#define QBBS275EXITINFO       8               /* QuickBBS 2.75+ EXITINFO.BBS */
#define CUSTOM                9                /* User-defined custom format */
#define DOORSYS_WILDCAT       10                        /* WildCat! DOOR.SYS */
#define RA2EXITINFO           11                    /* RA 2.00+ EXITINFO.BBS */
#define TRIBBSSYS             12                               /* TRIBBS.SYS */
#define DOOR32SYS             13                               /* DOOR32.SYS */
#define NO_DOOR_FILE          100      /* No door information file was found */

/* Error type (od_control.od_error). */
#define ERR_NONE              0                              /* No error yet */
#define ERR_MEMORY            1          /* Unable to allocate enough memory */
#define ERR_NOGRAPHICS        2    /* Function requires ANSI/AVATAR/RIP mode */
#define ERR_PARAMETER         3    /* Invalid value was passed to a function */
#define ERR_FILEOPEN          4                       /* Unable to open file */
#define ERR_LIMIT             5       /* An internal limit has been exceeded */
#define ERR_FILEREAD          6                  /* Unable to read from file */
#define ERR_NOREMOTE          7  /* Function may not be called in local mode */
#define ERR_GENERALFAILURE    8       /* Percise cause of failure is unknown */
#define ERR_NOTHINGWAITING    9    /* A request for data when none was ready */
#define ERR_NOMATCH           10                       /* No match was found */
#define ERR_UNSUPPORTED       11            /* Not supported in this version */

/* od_control.od_errorlevel indicies. */
#define ERRORLEVEL_ENABLE     0
#define ERRORLEVEL_CRITICAL   1
#define ERRORLEVEL_NOCARRIER  2
#define ERRORLEVEL_HANGUP     3
#define ERRORLEVEL_TIMEOUT    4
#define ERRORLEVEL_INACTIVITY 5
#define ERRORLEVEL_DROPTOBBS  6
#define ERRORLEVEL_NORMAL     7

/* Special od_popup_menu() return values. */
#define POPUP_ERROR           -1
#define POPUP_ESCAPE          0
#define POPUP_LEFT            -2
#define POPUP_RIGHT           -3

/* od_get_input() flags. */
#define GETIN_NORMAL          0x0000
#define GETIN_RAW             0x0001
#define GETIN_RAWCTRL         0x0002

/* od_control.od_box_chars array indicies. */
#define BOX_UPPERLEFT         0
#define BOX_TOP               1
#define BOX_UPPERRIGHT        2
#define BOX_LEFT              3
#define BOX_LOWERLEFT         4
#define BOX_LOWERRIGHT        5
#define BOX_BOTTOM            6
#define BOX_RIGHT             7

/* od_control.od_okaytopage settings. */
#define PAGE_DISABLE          0
#define PAGE_ENABLE           1
#define PAGE_USE_HOURS        2

/*  Method used for serial I/O (od_control.od_com_method). */
#define COM_FOSSIL            1
#define COM_INTERNAL          2
#define COM_WIN32             3
#define COM_DOOR32            4
#define COM_SOCKET				5
479
#define COM_STDIO			  6
rswindell's avatar
rswindell committed
480 481 482 483 484 485 486 487 488 489 490 491

/* Flow control method (od_control.od_com_flow_control). */
#define COM_DEFAULT_FLOW      0
#define COM_RTSCTS_FLOW       1
#define COM_NO_FLOW           2

/* Optional component initialization functions. */
ODAPIDEF void ODCALL ODConfigInit(void);
ODAPIDEF void ODCALL ODLogEnable(void);
ODAPIDEF void ODCALL ODMPSEnable(void);

/* Optional OpenDoors component settings. */
deuce's avatar
deuce committed
492
typedef void(ODFAR OD_COMPONENT)(void);
rswindell's avatar
rswindell committed
493 494 495 496 497 498 499 500 501 502 503 504 505 506
#define INCLUDE_CONFIG_FILE   (OD_COMPONENT *)ODConfigInit
#define NO_CONFIG_FILE        NULL
#define INCLUDE_LOGFILE       (OD_COMPONENT *)ODLogEnable
#define NO_LOGFILE            NULL
#define INCLUDE_MPS           (OD_COMPONENT *)ODMPSEnable
#define NO_MPS                NULL

/* Built-in personality defintion functions. */
ODAPIDEF void ODCALL pdef_opendoors(BYTE btOperation);
ODAPIDEF void ODCALL pdef_pcboard(BYTE btOperation);
ODAPIDEF void ODCALL pdef_ra(BYTE btOperation);
ODAPIDEF void ODCALL pdef_wildcat(BYTE btOperation);

/* Personality proc type. */
deuce's avatar
deuce committed
507
typedef void(ODFAR OD_PERSONALITY_PROC)(BYTE);
rswindell's avatar
rswindell committed
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557

/* Personality identifiers. */
#define PER_OPENDOORS         (void *)pdef_opendoors
#define PER_PCBOARD           (void *)pdef_pcboard
#define PER_RA                (void *)pdef_ra
#define PER_WILDCAT           (void *)pdef_wildcat

/* od_control.od_disable flags. */
#define DIS_INFOFILE          0x0001
#define DIS_CARRIERDETECT     0x0002
#define DIS_TIMEOUT           0x0004
#define DIS_LOCAL_OVERRIDE    0x0008
#define DIS_BPS_SETTING       0x0010
#define DIS_LOCAL_INPUT       0x0020
#define DIS_SYSOP_KEYS        0x0040
#define DIS_DTR_DISABLE       0x0080
#define DIS_NAME_PROMPT       0x0100

/* Event status settings. */
#define ES_DELETED            0
#define ES_ENABLED            1
#define ES_DISABLED           2

/* Personality proceedure operations. */
#define PEROP_DISPLAY1        0
#define PEROP_DISPLAY2        1
#define PEROP_DISPLAY3        2
#define PEROP_DISPLAY4        3
#define PEROP_DISPLAY5        4
#define PEROP_DISPLAY6        5
#define PEROP_DISPLAY7        6
#define PEROP_DISPLAY8        7
#define PEROP_UPDATE1         10
#define PEROP_UPDATE2         11
#define PEROP_UPDATE3         12
#define PEROP_UPDATE4         13
#define PEROP_UPDATE5         14
#define PEROP_UPDATE6         15
#define PEROP_UPDATE7         16
#define PEROP_UPDATE8         17
#define PEROP_INITIALIZE      20
#define PEROP_CUSTOMKEY       21
#define PEROP_DEINITIALIZE    22


/* ========================================================================= */
/* The OpenDoors control structure (od_control)                              */
/* ========================================================================= */

/* Force byte alignment, if possible */
deuce's avatar
deuce committed
558 559 560 561 562 563 564 565
#ifdef __TURBOC__
#if(__TURBOC__ >= 0x295)
#pragma option -a-
#endif /* __TURBOC__ >= 0x295 */
#endif /* __TURBOC__ */
#ifdef _MSC_VER
#pragma pack(1)
#endif /* _MSC_VER */
rswindell's avatar
rswindell committed
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722

typedef struct
{
   /* Location or name of door information file (if one is to be used). */
   char          info_path[60];

   /* Serial port settings. */
   DWORD         baud;
   DWORD         od_connect_speed;
   INT16         od_com_address;
   BYTE          od_com_irq;
   BYTE          od_com_method;
   BYTE          od_com_flow_control;
   WORD          od_com_rx_buf;
   WORD          od_com_tx_buf;
   BYTE          od_com_fifo_trigger;
   BOOL          od_com_no_fifo;
   BOOL          od_no_fossil;
   BOOL          od_use_socket;
   INT16         port;
   DWORD         od_open_handle;

   /* Caller and system information. */
   char          system_name[40];
   char          sysop_name[40];
   INT32         system_calls;
   char          system_last_caller[36];
   char          timelog_start_date[9];
   INT16         timelog_busyperhour[24];
   INT16         timelog_busyperday[7];

   char          user_name[36];
   char          user_location[26];
   char          user_password[16];
   char          user_dataphone[16];
   char          user_homephone[16];
   char          user_lasttime[6];
   char          user_lastdate[9];
   BYTE          user_attribute;
   BYTE          user_flags[4];
   DWORD         user_net_credit;
   DWORD         user_pending;
   WORD          user_messages;
   DWORD         user_lastread;
   WORD          user_security;
   DWORD         user_numcalls;
   DWORD         user_uploads;
   DWORD         user_downloads;
   DWORD         user_upk;
   DWORD         user_downk;
   DWORD         user_todayk;
   WORD          user_time_used;
   WORD          user_screen_length;
   BYTE          user_last_pwdchange;
   BYTE          user_attrib2;
   WORD          user_group;

   BYTE          event_status;
   char          event_starttime[6];
   BYTE          event_errorlevel;
   BYTE          event_days;
   BYTE          event_force;
   char          event_last_run[9];

   BYTE          user_netmailentered;
   BYTE          user_echomailentered;
   char          user_logintime[6];
   char          user_logindate[9];
   INT16         user_timelimit;
   INT32         user_loginsec;
   INT32         user_credit;
   WORD          user_num;
   INT16         user_readthru;
   INT16         user_numpages;
   INT16         user_downlimit;
   char          user_timeofcreation[6];
   char          user_logonpassword[16];
   BYTE          user_wantchat;
   BYTE          user_ansi;
   INT16         user_deducted_time;
   char          user_menustack[50][9];
   BYTE          user_menustackpointer;
   char          user_handle[36];
   char          user_comment[81];
   char          user_firstcall[9];
   BYTE          user_combinedrecord[200];
   char          user_birthday[9];
   char          user_subdate[9];
   BYTE          user_screenwidth;
   BYTE          user_language;
   BYTE          user_date_format;
   char          user_forward_to[36];
   BYTE          user_error_free;
   BYTE          sysop_next;
   BYTE          user_emsi_session;
   char          user_emsi_crtdef[41];
   char          user_emsi_protocols[41];
   char          user_emsi_capabilities[41];
   char          user_emsi_requests[41];
   char          user_emsi_software[41];
   BYTE          user_hold_attr1;
   BYTE          user_hold_attr2;
   BYTE          user_hold_len;
   char          user_reasonforchat[78];
   char          user_callsign[12];
   WORD          user_msg_area;
   WORD          user_file_area;
   char          user_protocol;
   WORD          user_file_group;
   BYTE          user_last_birthday_check;
   char          user_sex;
   DWORD         user_xi_record;
   WORD          user_msg_group;
   BYTE          user_avatar;
   char          user_org[51];
   char          user_address[3][51];
   INT32         user_pwd_crc;
   INT32         user_logon_pwd_crc;
   char          user_last_cost_menu[9];
   WORD          user_menu_cost;
   BYTE          user_rip;
   BYTE          user_rip_ver;
   BYTE          user_attrib3;
   BOOL          user_expert;
   char          system_last_handle[36];

   /* Door information file statistics. */
   BYTE          od_info_type;
   BYTE          od_extended_info;
   WORD          od_node;
   BYTE          od_ra_info;

   /* Current program settings. */
   BOOL          od_always_clear;
   BOOL          od_force_local;
   BOOL          od_chat_active;
   BOOL          od_current_statusline;
   INT16         od_error;
   BYTE          od_last_input;
   BOOL          od_logfile_disable;
   char          od_logfile_name[80];
   WORD          od_maxtime;
   INT16         od_maxtime_deduction;
   BOOL          od_okaytopage;
   INT16         od_pagestartmin;
   INT16         od_pageendmin;
   BOOL          od_page_pausing;
   INT16         od_page_statusline;
   BOOL          od_user_keyboard_on;
   BOOL          od_update_status_now;
   INT16         od_cur_attrib;

   /* OpenDoors customization settings. */
   char          od_box_chars[8];
   char          od_cfg_text[48][33];
   char          od_cfg_lines[25][33];
   OD_COMPONENT  *od_config_file;
deuce's avatar
deuce committed
723
   const char *  od_config_filename;
rswindell's avatar
rswindell committed
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927
   void          (*od_config_function)(char *keyword, char *options);
   char          od_color_char;
   char          od_color_delimiter;
   char          od_color_names[12][33];
   BOOL          od_clear_on_exit;
   void          (*od_cmd_line_handler)(char *pszKeyword, char *pszOptions);
   void          (*od_cmd_line_help_func)(void);
   void          (*od_default_personality)(BYTE operation);
   BOOL          od_default_rip_win;
   WORD          od_disable;
   char          od_disable_dtr[40];
   BOOL          od_disable_inactivity;
   BOOL          od_emu_simulate_modem;
   BYTE          od_errorlevel[8];
   BOOL          od_full_color;
   BOOL          od_full_put;
   WORD          od_in_buf_size;
   INT16         od_inactivity;
   INT16         od_inactive_warning;
   BOOL          od_internal_debug;
   tODMilliSec   od_max_key_latency;
   char          od_list_pause;
   char          od_list_stop;
   OD_COMPONENT  *od_logfile;
   char          *od_logfile_messages[14];
   OD_COMPONENT  *od_mps;
   BOOL          od_nocopyright;
   BOOL          od_noexit;
   BOOL          od_no_ra_codes;
   BYTE          od_page_len;
   char          od_prog_copyright[40];
   char          od_prog_name[40];
   char          od_prog_version[40];
   DWORD         od_reg_key;
   char          od_reg_name[36];
   BOOL          od_silent_mode;
   BOOL          od_status_on;
   BOOL          od_spawn_freeze_time;
   BOOL          od_swapping_disable;
   BOOL          od_swapping_noems;
   char          od_swapping_path[80];

   /* Custom function hooks. */
   void          (*od_no_file_func)(void);
   void          (*od_before_exit)(void);
   void          (*od_cbefore_chat)(void);
   void          (*od_cafter_chat)(void);
   void          (*od_cbefore_shell)(void);
   void          (*od_cafter_shell)(void);
   void          (*od_config_callback)(void);
   void          (*od_help_callback)(void);
   void          (*od_ker_exec)(void);
   void          (*od_local_input)(INT16 key);
   void          (*od_time_msg_func)(char *string);

   /* OpenDoors function key customizations. */
   WORD          key_chat;
   WORD          key_dosshell;
   WORD          key_drop2bbs;
   WORD          key_hangup;
   WORD          key_keyboardoff;
   WORD          key_lesstime;
   WORD          key_lockout;
   WORD          key_moretime;
   WORD          key_status[9];
   WORD          key_sysopnext;

   /* Additional function keys. */
   BYTE          od_num_keys;
   INT16         od_hot_key[16];
   INT16         od_last_hot;
   void          (*od_hot_function[16])(void);

   /* OpenDoors prompt customizations. */
   char *        od_after_chat;
   char *        od_after_shell;
   char *        od_before_chat;
   char *        od_before_shell;
   char *        od_chat_reason;
   char *        od_continue;
   char          od_continue_yes;
   char          od_continue_no;
   char          od_continue_nonstop;
   char *        od_day[7];
   char *        od_hanging_up;
   char *        od_exiting;
   char *        od_help_text;
   char *        od_help_text2;
   char *        od_inactivity_timeout;
   char *        od_inactivity_warning;
   char *        od_month[12];
   char *        od_no_keyboard;
   char *        od_no_sysop;
   char *        od_no_response;
   char *        od_no_time;
   char *        od_offline;
   char *        od_paging;
   char *        od_press_key;
   char *        od_sending_rip;
   char *        od_status_line[3];
   char *        od_sysop_next;
   char *        od_time_left;
   char *        od_time_warning;
   char *        od_want_chat;
   char *        od_cmd_line_help;

   /* OpenDoors color customizations. */
   BYTE          od_chat_color1;
   BYTE          od_chat_color2;
   BYTE          od_list_comment_col;
   BYTE          od_list_name_col;
   BYTE          od_list_offline_col;
   BYTE          od_list_size_col;
   BYTE          od_list_title_col;
   BYTE          od_local_win_col;
   BYTE          od_continue_col;
   BYTE          od_menu_title_col;
   BYTE          od_menu_border_col;
   BYTE          od_menu_text_col;
   BYTE          od_menu_key_col;
   BYTE          od_menu_highlight_col;
   BYTE          od_menu_highkey_col;

   /* Platform-specific settings. */
#ifdef ODPLAT_WIN32
   HICON         od_app_icon;
   int           od_cmd_show;
#endif /* ODPLAT_WIN32 */
} tODControl;

/* Restore original structure alignment, if possible. */
#ifdef _MSC_VER
#pragma pack()
#endif /* _MSC_VER */


/* The od_control external variable. */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
OD_API_VAR_DECL tODControl 
#ifndef _WIN32	/* warning C4229: anachronism used : modifiers on data are ignored */
OD_GLOBAL_CONV 
#endif
od_control;
#ifdef __cplusplus
}
#endif /* __cplusplus */


/* ========================================================================= */
/* OpenDoors API function prototypes.                                        */
/* ========================================================================= */

/* Programs interface with OpenDoors by calling any of the OpenDoors API
 * functions. A summary of these functions appears below, followed by the
 * function definition prototypes. Full information on these functions is
 * provided by the OpenDoors manual. Functions denoted (ANS/AVT) require ANSI
 * or AVATAR display modes to be active.
 *
 * OUTPUT FUNCTIONS - TEXT DISPLAY
 *    od_printf()             - Performs formatted output, with color settings
 *    od_disp_str()           - Displays a normal, nul-terminated string.
 *    od_disp()               - Sends chars to modem, with/without local echo
 *    od_disp_emu()           - Displays a string, translating ANSI/AVT codes
 *    od_repeat()             - Efficiently displays a character repeatedly
 *    od_putch()              - Displays a single character.
 *
 * OUTPUT FUNCTIONS - COLOUR AND CURSOR CONTROL
 *    od_set_color()          - Sets color according to fore/background values
 *    od_set_attrib()         - Sets color to specified IBM-PC attribute
 *    od_set_cursor()         - Positions cursor on screen            (ANS/AVT)
 *    od_get_cursor()         - Estimates the current cursor position on screen
 *
 * OUTPUT FUNCTIONS - SCREEN MANIPULATION
 *    od_clr_scr()            - Clears the screen
 *    od_save_screen()        - Saves the contents of entire screen
 *    od_restore_screen()     - Restores the contents of entire screen
 *
 * OUTPUT FUNCTIONS - BLOCK MANIPULATION
 *    od_clr_line()           - Clears the remainder of the current line
 *    od_gettext()            - Gets the contents a block of screen   (ANS/AVT)
 *    od_puttext()            - Displays block stored by gettext()    (ANS/AVT)
 *    od_scroll()             - Scrolls a portion of the screen       (ANS/AVT)
 *
 * OUTPUT FUNCTIONS - WINDOWS & MENUS
 *    od_draw_box()           - Draws a box on the screen             (ANS/AVT)
 *    od_window_create()      - Creates a window, storing underlying  (ANS/AVT)
 *    od_window_remove()      - Removes window, restoring underlying  (ANS/AVT)
 *    od_popup_menu()         - Displays popup menu with "light" bar  (ANS/AVT)
 *
 * OUTPUT FUNCTIONS - FILE DISPLAY
 *    od_send_file()          - Displays an ASCII/ANSI/AVATAR/RIP file
 *    od_hotkey_menu()        - Displays ASC/ANS/AVATAR/RIP menu, with hotkeys
 *    od_list_files()         - Lists files avail for download using FILES.BBS
 *
 * INPUT FUNCTIONS
 *    od_get_answer()         - Inputs a key, allowing only specified responses
 *    od_get_key()            - Inputs a key, optionally waiting for next key
 *    od_get_input()          - Obtains next input, with translation
 *    od_input_str()          - Inputs string of specified length from keyboard
 *    od_edit_str()           - Fancy formatted string input function (ANS/AVT)
 *    od_clear_keybuffer()    - Removes any waiting keys in keyboard buffer
 *    od_multiline_edit()     - Edits text that spans multiple lines  (ANS/AVT)
928
 *    od_key_pending()        - Returns TRUE if a key is waiting to be processed
rswindell's avatar
rswindell committed
929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
 *
 * COMMON DOOR ACTIVITY FUNCTIONS
 *    od_page()               - Allows user to page sysop
 *    od_spawn()              - Suspends OpenDoors & starts another program
 *    od_spawnvpe()           - Like od_spawn, but with more options
 *    od_log_write()          - Writes a logfile entry
 *    od_parse_cmd_line()     - Handles standard command-line parameters
 *
 * SPECIAL CONTROL FUNCTIONS
 *    od_init()               - Forces OpenDoors initialization
 *    od_color_config()       - Translates color description to color value
 *    od_add_personality()    - Adds another local interface personality
 *    od_set_statusline()     - Sets the current status line setting
 *    od_autodetect()         - Determines the remote system terminal type
 *    od_kernel()             - Call when not calling other functions
 *    od_exit()               - Ends OpenDoors program
 *    od_carrier()            - Indicates whether remote connection is present
 *    od_set_dtr()            - Raises / lowers the DTR signal to the modem
 *    od_chat()               - Manually starts chat mode
 *    od_sleep()              - Yield to other processes
 *    od_control_get()        - Returns a pointer to the od_control structure.
 */
deuce's avatar
deuce committed
951
ODAPIDEF BOOL ODCALL   od_add_personality(const char *pszName, BYTE btOutputTop,
rswindell's avatar
rswindell committed
952 953 954 955 956 957 958 959 960 961
                          BYTE btOutputBottom,
                          OD_PERSONALITY_PROC *pfPerFunc);
ODAPIDEF void ODCALL   od_autodetect(INT nFlags);
ODAPIDEF BOOL ODCALL   od_carrier(void);
ODAPIDEF void ODCALL   od_chat(void);
ODAPIDEF void ODCALL   od_clear_keybuffer(void);
ODAPIDEF void ODCALL   od_clr_line(void);
ODAPIDEF void ODCALL   od_clr_scr(void);
ODAPIDEF BYTE ODCALL   od_color_config(char *pszColorDesc);
ODAPIDEF tODControl *  ODCALL od_control_get(void);
deuce's avatar
deuce committed
962
ODAPIDEF void ODCALL   od_disp(const char *pachBuffer, INT nSize, BOOL bLocalEcho);
deuce's avatar
deuce committed
963
ODAPIDEF void ODCALL   od_disp_emu(const char *pszToDisplay, BOOL bRemoteEcho);
deuce's avatar
deuce committed
964
ODAPIDEF void ODCALL   od_disp_str(const char *pszToDisplay);
rswindell's avatar
rswindell committed
965 966 967 968 969 970 971
ODAPIDEF BOOL ODCALL   od_draw_box(BYTE btLeft, BYTE btTop, BYTE btRight,
                          BYTE btBottom);
ODAPIDEF WORD ODCALL   od_edit_str(char *pszInput, char *pszFormat, INT nRow,
                          INT nColumn, BYTE btNormalColour,
                          BYTE btHighlightColour, char chBlank,
                          WORD nFlags);
ODAPIDEF void ODCALL   od_exit(INT nErrorLevel, BOOL bTermCall);
deuce's avatar
deuce committed
972
ODAPIDEF char ODCALL   od_get_answer(const char *pszOptions);
rswindell's avatar
rswindell committed
973 974 975
ODAPIDEF void ODCALL   od_get_cursor(INT *pnRow, INT *pnColumn);
ODAPIDEF BOOL ODCALL   od_get_input(tODInputEvent *pInputEvent,
                          tODMilliSec TimeToWait, WORD wFlags);
976
ODAPIDEF BOOL ODCALL   od_key_pending(void);
rswindell's avatar
rswindell committed
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998
ODAPIDEF char ODCALL   od_get_key(BOOL bWait);
ODAPIDEF BOOL ODCALL   od_gettext(INT nLeft, INT nTop, INT nRight,
                          INT nBottom, void *pBlock);
ODAPIDEF char ODCALL   od_hotkey_menu(char *pszFileName, char *pszHotKeys,
                          BOOL bWait);
ODAPIDEF void ODCALL   od_init(void);
ODAPIDEF void ODCALL   od_input_str(char *pszInput, INT nMaxLength,
                          unsigned char chMin, unsigned char chMax);
ODAPIDEF void ODCALL   od_kernel(void);
ODAPIDEF BOOL ODCALL   od_list_files(char *pszFileSpec);
ODAPIDEF BOOL ODCALL   od_log_write(char *pszMessage);
ODAPIDEF INT ODCALL    od_multiline_edit(char *pszBufferToEdit,
                          UINT unBufferSize, tODEditOptions *pEditOptions);
ODAPIDEF void ODCALL   od_page(void);
#ifdef ODPLAT_WIN32
ODAPIDEF void ODCALL   od_parse_cmd_line(LPSTR pszCmdLine);
#else /* !ODPLAT_WIN32 */
ODAPIDEF void ODCALL   od_parse_cmd_line(INT nArgCount,
                          char *papszArguments[]);
#endif /* !ODPLAT_WIN32 */
ODAPIDEF INT ODCALL    od_popup_menu(char *pszTitle, char *pszText,
                          INT nLeft, INT nTop, INT nLevel, WORD uFlags);
deuce's avatar
deuce committed
999
ODAPIDEF void ODVCALL  od_printf(const char *pszFormat, ...);
rswindell's avatar
rswindell committed
1000 1001 1002 1003 1004 1005 1006 1007
ODAPIDEF void ODCALL   od_putch(char chToDisplay);
ODAPIDEF BOOL ODCALL   od_puttext(INT nLeft, INT nTop, INT nRight,
                          INT nBottom, void *pBlock);
ODAPIDEF void ODCALL   od_repeat(char chValue, BYTE btTimes);
ODAPIDEF BOOL ODCALL   od_restore_screen(void *pBuffer);
ODAPIDEF BOOL ODCALL   od_save_screen(void *pBuffer);
ODAPIDEF BOOL ODCALL   od_scroll(INT nLeft, INT nTop, INT nRight,
                          INT nBottom, INT nDistance, WORD nFlags);
deuce's avatar
deuce committed
1008
ODAPIDEF BOOL ODCALL   od_send_file(const char *pszFileName);
rswindell's avatar
rswindell committed
1009 1010 1011 1012 1013
ODAPIDEF BOOL ODCALL   od_send_file_section(char *pszFileName, char *pszSectionName);
ODAPIDEF void ODCALL   od_set_attrib(INT nColour);
ODAPIDEF void ODCALL   od_set_color(INT nForeground, INT nBackground);
ODAPIDEF void ODCALL   od_set_cursor(INT nRow, INT nColumn);
ODAPIDEF void ODCALL   od_set_dtr(BOOL bHigh);
deuce's avatar
deuce committed
1014
ODAPIDEF BOOL ODCALL   od_set_personality(const char *pszName);
rswindell's avatar
rswindell committed
1015 1016
ODAPIDEF void ODCALL   od_set_statusline(INT nSetting);
ODAPIDEF void ODCALL   od_sleep(tODMilliSec Milliseconds);
deuce's avatar
deuce committed
1017
ODAPIDEF BOOL ODCALL   od_spawn(const char *pszCommandLine);
rswindell's avatar
rswindell committed
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
ODAPIDEF INT16 ODCALL  od_spawnvpe(INT16 nModeFlag, char *pszPath,
                          char *papszArg[], char *papszEnv[]);
ODAPIDEF void * ODCALL od_window_create(INT nLeft, INT nTop, INT nRight,
                          INT nBottom, char *pszTitle, BYTE btBorderCol,
                          BYTE btTitleCol, BYTE btInsideCol, INT nReserved);
ODAPIDEF BOOL ODCALL   od_window_remove(void *pWinInfo);


/* ========================================================================= */
/* Definitions for compatibility with previous versions.                     */
/* ========================================================================= */

/* Alternative spelling for the word color (colour). */
#define od_chat_colour1                od_chat_color1
#define od_chat_colour2                od_chat_color2
#define od_colour_char                 od_color_char
#define od_colour_delimiter            od_color_delimiter
#define od_colour_names                od_color_names
#define od_full_colour                 od_full_color
#define od_colour_config               od_color_config
#define od_set_colour                  od_set_color

/* Definitions for renamed od_control members and manifest constants. */
#define key_help                       key_status[6]
#define key_nohelp                     key_status[0]
#define user_credit                    user_net_credit
#define caller_netmailentered          user_netmailentered
#define caller_echomailentered         user_echomailentered
#define caller_logintime               user_logintime
#define caller_logindate               user_logindate
#define caller_timelimit               user_timelimit
#define caller_loginsec                user_loginsec
#define caller_credit                  user_credit
#define caller_userrecord              user_num
#define caller_readthru                user_readthru
#define caller_numpages                user_numpages
#define caller_downlimit               user_downlimit
#define caller_timeofcreation          user_timeofcreation
#define caller_logonpassword           user_logonpassword
#define caller_wantchat                user_wantchat
#define caller_ansi                    user_ansi
#define ra_deducted_time               user_deducted_time
#define ra_menustack                   user_menustack
#define ra_menustackpointer            user_menustackpointer
#define ra_userhandle                  user_handle
#define ra_comment                     user_comment
#define ra_firstcall                   user_firstcall
#define ra_combinedrecord              user_combinedrecord
#define ra_birthday                    user_birthday
#define ra_subdate                     user_subdate
#define ra_screenwidth                 user_screenwidth
#define ra_msg_area                    user_msg_area
#define ra_file_area                   user_file_area
#define ra_language                    user_language
#define ra_date_format                 user_date_format
#define ra_forward_to                  user_forward_to
#define ra_error_free                  user_error_free
#define ra_sysop_next                  sysop_next
#define ra_emsi_session                user_emsi_session
#define ra_emsi_crtdef                 user_emsi_crtdef
#define ra_emsi_protocols              user_emsi_protocols
#define ra_emsi_capabilities           user_emsi_capabilities
#define ra_emsi_requests               user_emsi_requests
#define ra_emsi_software               user_emsi_software
#define ra_hold_attr1                  user_hold_attr1
#define ra_hold_attr2                  user_hold_attr2
#define ra_hold_len                    user_hold_len
#define caller_usernum                 user_num
#define caller_callsign                user_callsign
#define caller_sex                     user_sex
#define od_avatar                      user_avatar
#define B_YELLOW                       L_YELLOW
#define B_WHITE                        L_WHITE
#define od_rbbs_node                   od_node
#define STATUS_USER1                   STATUS_ALTERNATE_1
#define STATUS_USER2                   STATUS_ALTERNATE_2
#define STATUS_USER3                   STATUS_ALTERNATE_3
#define STATUS_USER4                   STATUS_ALTERNATE_4
#define STATUS_SYSTEM                  STATUS_ALTERNATE_5
#define STATUS_HELP                    STATUS_ALTERNATE_7
#define od_registered_to               od_control.od_reg_name
#define od_registration_key            od_control.od_reg_key
#define od_program_name                od_control.od_prog_name
#define od_log_messages                od_control.od_logfile_messages
#define od_config_text                 od_control.od_cfg_text
#define od_config_lines                od_control.od_cfg_lines
#define od_config_colours              od_control.od_colour_names
#define od_config_colors               od_control.od_colour_names
#define config_file                    od_config_file
#define config_filename                od_config_filename
#define config_function                od_config_function
#define default_personality            od_default_personality
#define logfile                        od_logfile
#define mps                            od_mps
#define od_kernal                      od_kernel

/* Obsolete functions. */
#define od_init_with_config(filename,function)\
                                  od_control.config_file=INCLUDE_CONFIG_FILE;\
                                  od_control.config_filename=filename;\
                                  od_control.config_function=function;\
                                  od_init()
ODAPIDEF BOOL ODCALL                   od_log_open(void);
ODAPIDEF void ODCALL                   od_emulate(register char in_char);

#endif /* _INC_OPENDOOR */