home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / vrac / odoors50.zip / OPENDOOR.H < prev    next >
C/C++ Source or Header  |  1994-09-24  |  32KB  |  748 lines

  1. /*
  2.  * ██████████                         ███████▄
  3.  * ███▀▀▀▀███                         ███▀▀▀███
  4.  * ███    ███ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ███   ███ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄
  5.  * ███    ███ ███▀███ ███▀███ ███▀███ ███   ███ ███▀███ ███▀███ ███▀▀▀ ███▀▀▀▀
  6.  * ███▄▄▄▄███ ███ ███ ███▀▀▀▀ ███ ███ ███▄▄▄███ ███ ███ ███ ███ ███    ▀▀▀▀███
  7.  * ██████████ ███████ ███████ ███ ███ ███████▀  ███████ ███████ ███    ███████
  8.  *            ███
  9.  *            ███
  10.  *            ▀▀▀                                     Door Programming Toolkit
  11.  * ───────────────────────────────────────────────────────────────────────────
  12.  *
  13.  *      (C) Copyright 1991 - 1994 by Brian Pirie. All Rights Reserved.
  14.  *
  15.  *
  16.  *
  17.  *
  18.  *     Filename : OPENDOOR.H
  19.  *  Description : This header file contains information needed by a C compiler
  20.  *                in order to permit your program to interface with OpenDoors.
  21.  *                This file must be #included in any program using OpenDoors,
  22.  *                and the program must be linked with the appropriate
  23.  *                OpenDoors libary file (ODOORx.LIB).
  24.  *      Version : 5.00
  25.  */
  26.  
  27.  
  28. #ifndef INC_OPENDOOR                           /* Only parse OPENDOOR.H once */
  29. #define INC_OPENDOOR
  30.  
  31.  
  32.  
  33.                                           /* MULTIPLE COMPILER COMPATIBILITY */
  34.                                           /* ------------------------------- */
  35.  
  36. #ifdef __cplusplus                /* Compiler-dependant function definitions */
  37. #define FUNCDEF extern "C"
  38. #else
  39. #define FUNCDEF
  40. #endif
  41.  
  42.  
  43.  
  44.                                         /* OPENDOORS API FUNCTION PROTOTYPES */
  45.                                         /* --------------------------------- */
  46.  
  47. /* Programs interface with OpenDoors by calling any of the door toolkit
  48.  * functions. A summary of these functions appears below, followed by the
  49.  * function definition prototypes. Full information on these functions appears
  50.  * in the OpenDoors manual. Functions denoted (ANS/AVT) require ANSI or AVATAR
  51.  * display modes to be active.
  52.  *
  53.  * OUTPUT FUNCTIONS - TEXT DISPLAY
  54.  *    od_printf()         - Performs formatted output, with colour settings
  55.  *    od_disp_str()       - Displays a normal, NULL-terminated string.
  56.  *    od_disp()           - Sends characters to modem, with/without local echo
  57.  *    od_disp_emu()       - Displays a string, interpreting ANSI/AVATAR codes
  58.  *    od_repeat()         - Efficiently displays a character repeatedly
  59.  *    od_putch()          - Displays a single character.
  60.  *
  61.  * OUTPUT FUNCTIONS - COLOUR AND CURSOR CONTROL
  62.  *    od_set_colour()     - Sets colour according to fore/background values
  63.  *    od_set_attrib()     - Sets current colour to specified IBM-PC attribute
  64.  *    od_set_cursor()     - Positions cursor on screen in ANSI & AVATAR modes
  65.  *
  66.  * OUTPUT FUNCTIONS - SCREEN MANIPULATION
  67.  *    od_clr_scr()        - Clears the screen, if screen clearing enabled
  68.  *    od_save_screen()    - Saves the contents of entire screen, in any mode
  69.  *    od_restore_screen() - Restores the contents of entire screen, in any mode
  70.  *
  71.  * OUTPUT FUNCTIONS - BLOCK MANIPULATION
  72.  *    od_clr_line()       - Clears the remainder of the current line
  73.  *    od_gettext()        - Gets the contents of an area on the screen(ANS/AVT)
  74.  *    od_puttext()        - Displays block retrieved with gettext()   (ANS/AVT)
  75.  *    od_scroll()         - Scrolls a portion of the screen           (ANS/AVT)
  76.  *
  77.  * OUTPUT FUNCTIONS - WINDOWS & MENUS
  78.  *    od_draw_box()       - Draws a box on the screen                 (ANS/AVT)
  79.  *    od_window_create()  - Creates a window, storing underlying text (ANS/AVT)
  80.  *    od_window_remove()  - Removes window, restoring underlying text (ANS/AVT)
  81.  *    od_popup_menu()     - Displays popup menu with menu bar         (ANS/AVT)
  82.  *
  83.  * OUTPUT FUNCTIONS - FILE DISPLAY
  84.  *    od_send_file()      - Displays an ASCII/ANSI/AVATAR/RIP file
  85.  *    od_hotkey_menu()    - Displays ASCII/ANSI/AVATAR/RIP menu, with hotkeys
  86.  *    od_list_files()     - Lists files available for download using FILES.BBS
  87.  *
  88.  * INPUT FUNCTIONS
  89.  *    od_get_answer()     - Inputs a key, allowing only particular responses
  90.  *    od_get_key()        - Inputs a key, optionally waiting for next keypress
  91.  *    od_input_str()      - Inputs string of specified length from keyboard
  92.  *    od_edit_str()       - Fancy formatted string input function     (ANS/AVT)
  93.  *    od_clear_keybuffer()- Removes any waiting keys in keyboard input buffer
  94.  *
  95.  * COMMON DOOR ACTIVITY FUNCTIONS
  96.  *    od_page()           - Allows user to page sysop
  97.  *    od_spawn()          - Suspends OpenDoors & starts another program
  98.  *    od_spawnvpe()       - Like od_spawn, but with more options
  99.  *    od_log_write()      - Writes a logfile entry
  100.  *
  101.  * SPECIAL CONTROL FUNCTIONS
  102.  *    od_init()           - Immediately begins door & sets up od_control struct
  103.  *    od_colour_config()  - Translates colour configation line to colour value
  104.  *    od_add_personality()- Adds another personality definition
  105.  *    od_set_statusline() - Sets the current status line setting
  106.  *    od_autodetect()     - Determines the remote system terminal type
  107.  *    od_kernel()         - Call when not calling other functions for > 10 sec.
  108.  *    od_exit()           - Ends a door program and returns to BBS
  109.  *    od_carrier()        - Indicates whether remote connection is present
  110.  *    od_set_dtr()        - Raises / lowers the DTR signal to the modem
  111.  *    od_chat()           - Manually starts chat mode
  112.  */
  113.  
  114. FUNCDEF int           od_add_personality(char *name, char output_top,
  115.                                         char output_bottom,
  116.                                         void (*function)(unsigned char which));
  117. FUNCDEF void          od_autodetect(int flags);
  118. FUNCDEF int           od_carrier(void);
  119. FUNCDEF void          od_chat(void);
  120. FUNCDEF void          od_clear_keybuffer(void);
  121. FUNCDEF void          od_clr_line(void);
  122. FUNCDEF void          od_clr_scr(void);
  123. FUNCDEF unsigned char od_colour_config(char *config_line);
  124. FUNCDEF void          od_disp(char *buffer, int size, char local_echo);
  125. FUNCDEF void          od_disp_emu(char *string, char remote_echo);
  126. FUNCDEF void          od_disp_str(char *string);
  127. FUNCDEF int           od_draw_box(char left, char top, char right,
  128.                                   char bottom);
  129. FUNCDEF unsigned int  od_edit_str(char *input_string, char *format_string,
  130.                                   int row, int col,
  131.                                   unsigned char normal_colour,
  132.                                   unsigned char highlight_colour,
  133.                                   char character, unsigned int flags);
  134. FUNCDEF void          od_exit(int errorlevel, char term_call);
  135. FUNCDEF char          od_get_answer(char *string);
  136. FUNCDEF int           od_get_key(int wait);
  137. FUNCDEF int           od_gettext(int left, int top, int right, int bottom,
  138.                                  void *block);
  139. FUNCDEF char          od_hotkey_menu(char *filename, char *hotkeys, char wait);
  140. FUNCDEF void          od_init(void);
  141.  
  142. FUNCDEF void          od_input_str(char *string, int max_len,
  143.                                   unsigned char minchar,
  144.                                   unsigned char maxchar);
  145. FUNCDEF void          od_kernel(void);
  146. FUNCDEF int           od_list_files(char *directory);
  147. FUNCDEF int           od_log_write(char *message);
  148. FUNCDEF void          od_page(void);
  149. FUNCDEF int           od_popup_menu(char *title, char *text, int left, int top,
  150.                                     int level, unsigned int flags);
  151. FUNCDEF void          od_printf(char *format, ...);
  152. FUNCDEF void          od_putch(int character);
  153. FUNCDEF int           od_puttext(int left, int top, int right, int bottom,
  154.                                  void *block);
  155. FUNCDEF void          od_repeat(char value, unsigned char times);
  156. FUNCDEF int           od_restore_screen(void *buffer);
  157. FUNCDEF int           od_save_screen(void *buffer);
  158. FUNCDEF int           od_scroll(int left, int top, int right, int bottom,
  159.                                 int distance, unsigned int flags);
  160. FUNCDEF int           od_send_file(char *filename);
  161. FUNCDEF void          od_set_attrib(int colour);
  162. #define               od_set_colour(x, y) od_set_attrib(x|(y<<4))
  163. FUNCDEF void          od_set_cursor(int row, int col);
  164. FUNCDEF void          od_set_dtr(char high);
  165. FUNCDEF int           od_set_personality(char *name);
  166. FUNCDEF void          od_set_statusline(char setting);
  167. FUNCDEF int           od_spawn(char *command_line);
  168. FUNCDEF int           od_spawnvpe(int modeflag, char *path, char *argv[],
  169.                                   char *envp[]);
  170. FUNCDEF void *        od_window_create(int left, int top, int right,
  171.                                        int bottom, char *title, char boardcol,
  172.                                        char titlecol, char insidecol, 
  173.                                        int reserved);
  174. FUNCDEF int           od_window_remove(void *info);                                       
  175.  
  176.  
  177.  
  178.                                               /* OPENDOORS CONTROL STRUCTURE */
  179.                                               /* --------------------------- */
  180.  
  181.                                         /* Force byte alignment, if possible */
  182. #ifdef __TURBOC__                           /* If this is a Borland compiler */
  183. #if(__TURBOC__>=0x295)         /* If this version supports the option pragma */
  184. #pragma option -a-                    /* Turn off -a (word alignment) option */
  185. #endif
  186. #endif
  187. #ifdef _MSC_VER                           /* If this is a Microsoft compiler */
  188. #pragma pack(1)                           /* Set structure packing to 1 byte */
  189. #endif
  190.  
  191. struct _od_control               /* OpenDoors door toolkit control structure */
  192.    {
  193.    char          info_path[60];         /* Location of door information file */
  194.  
  195.  
  196.    unsigned long baud;                               /* Serial port settings */
  197.    int           od_com_address;
  198.    unsigned char od_com_irq;
  199.    char          od_com_method;
  200.    unsigned int  od_com_rx_buf;
  201.    unsigned int  od_com_tx_buf;
  202.    char          od_com_fifo_trigger;
  203.    char          od_com_no_fifo;
  204.    char          od_no_fossil;
  205.    char          port;
  206.  
  207.  
  208.    char          system_name[40];                /* Caller & BBS information */
  209.    char          sysop_name[40];
  210.    long          system_calls;
  211.    char          system_last_caller[36];
  212.    char          timelog_start_date[9];
  213.    int           timelog_busyperhour[24];
  214.    int           timelog_busyperday[7];
  215.  
  216.    char          user_name[36];
  217.    char          user_location[26];
  218.    char          user_password[16];
  219.    char          user_dataphone[16];
  220.    char          user_homephone[16];
  221.    char          user_lasttime[6];
  222.    char          user_lastdate[9];
  223.    char          user_attribute;
  224.    char          user_flags[4];
  225.    unsigned long user_net_credit;
  226.    unsigned long user_pending;
  227.    unsigned int  user_messages;
  228.    unsigned long user_lastread;
  229.    unsigned int  user_security;
  230.    unsigned long user_numcalls;
  231.    unsigned long user_uploads;
  232.    unsigned long user_downloads;
  233.    unsigned long user_upk;
  234.    unsigned long user_downk;
  235.    unsigned long user_todayk;
  236.    unsigned int  user_time_used;
  237.    unsigned int  user_screen_length;
  238.    char          user_last_pwdchange;
  239.    char          user_attrib2;
  240.    unsigned int  user_group;
  241.  
  242.    char          event_status;
  243.    char          event_starttime[6];
  244.    unsigned char event_errorlevel;
  245.    char          event_days;
  246.    char          event_force;
  247.    char          event_last_run[9];
  248.  
  249.    char          user_netmailentered;
  250.    char          user_echomailentered;
  251.    char          user_logintime[6];
  252.    char          user_logindate[9];
  253.    int           user_timelimit;
  254.    long          user_loginsec;
  255.    long          user_credit;
  256.    unsigned int  user_num;
  257.    int           user_readthru;
  258.    int           user_numpages;
  259.    int           user_downlimit;
  260.    char          user_timeofcreation[6];
  261.    char          user_logonpassword[16];
  262.    char          user_wantchat;
  263.    char          user_ansi;
  264.  
  265.    int           user_deducted_time;
  266.    char          user_menustack[50][9];
  267.    char          user_menustackpointer;
  268.    char          user_handle[36];
  269.    char          user_comment[81];
  270.    char          user_firstcall[9];
  271.    char          user_combinedrecord[200];
  272.    char          user_birthday[9];
  273.    char          user_subdate[9];
  274.    unsigned char user_screenwidth;
  275.    unsigned char user_language;
  276.    unsigned char user_date_format;
  277.    char          user_forward_to[36];
  278.    char          user_error_free;
  279.    char          sysop_next;
  280.    char          user_emsi_session;
  281.    char          user_emsi_crtdef[41];
  282.    char          user_emsi_protocols[41];
  283.    char          user_emsi_capabilities[41];
  284.    char          user_emsi_requests[41];
  285.    char          user_emsi_software[41];
  286.    unsigned char user_hold_attr1;
  287.    unsigned char user_hold_attr2;
  288.    unsigned char user_hold_len;
  289.  
  290.    char          user_reasonforchat[78];
  291.    char          user_callsign[12];
  292.    unsigned int  user_msg_area;
  293.    unsigned int  user_file_area;
  294.    char          user_protocol;
  295.    unsigned int  user_file_group;
  296.    unsigned char user_last_birthday_check;
  297.    char          user_sex;
  298.    unsigned long user_xi_record;
  299.    unsigned int  user_msg_group;
  300.    char          user_avatar;
  301.    char          user_org[51];
  302.    char          user_address[3][51];
  303.    long          user_pwd_crc;
  304.    long          user_logon_pwd_crc;
  305.    char          user_last_cost_menu[9];
  306.    unsigned int  user_menu_cost;
  307.    char          user_rip;
  308.  
  309.  
  310.    char          od_info_type;           /* Door information file statistics */
  311.    char          od_extended_info;
  312.    unsigned int  od_node;
  313.    char          od_ra_info;
  314.  
  315.  
  316.    char          od_always_clear;                           /* Door settings */
  317.    char          od_force_local;
  318.    char          od_chat_active;
  319.    char          od_current_statusline;
  320.    int           od_error;
  321.    char          od_last_input;
  322.    char          od_logfile_disable;
  323.    char          od_logfile_name[80];
  324.    unsigned int  od_maxtime;
  325.    int           od_maxtime_deduction;
  326.    char          od_okaytopage;
  327.    int           od_pagestartmin;
  328.    int           od_pageendmin;
  329.    char          od_page_pausing;
  330.    char          od_page_statusline;
  331.    char          od_user_keyboard_on;
  332.    char          od_update_status_now;
  333.    int           od_cur_attrib;
  334.  
  335.     
  336.    char          od_box_chars[8];       /* OpenDoors customization variables */
  337.    char          od_cfg_text[47][33];
  338.    char          od_cfg_lines[25][33];
  339.    void          (*od_config_file)(void);
  340.    char *        od_config_filename;
  341.    void          (*od_config_function)(char *keyword, char *options);
  342.    char          od_colour_char;
  343.    char          od_colour_delimiter;
  344.    char          od_colour_names[12][33];
  345.    char          od_clear_on_exit;
  346.    void          (*od_default_personality)(unsigned char operation);
  347.    char          od_default_rip_win;
  348.    unsigned int  od_disable;
  349.    unsigned char od_errorlevel[8];
  350.    char          od_full_colour;
  351.    char          od_full_put;
  352.    unsigned int  od_in_buf_size;
  353.    int           od_inactivity;
  354.    int           od_inactive_warning;
  355.    char          od_list_pause;
  356.    char          od_list_stop;
  357.    void          (*od_logfile)(void);
  358.    char          *od_logfile_messages[14];
  359.    void          (*od_mps)(void);
  360.    char          od_nocopyright;
  361.    char          od_noexit;
  362.    char          od_no_ra_codes;
  363.    char          od_page_len;
  364.    unsigned long od_reg_key;
  365.    char          od_reg_name[36];
  366.    char          od_status_on;
  367.    char          od_spawn_freeze_time;
  368.    char          od_swapping_disable;
  369.    char          od_swapping_noems;
  370.    char          od_swapping_path[80];
  371.    char          od_prog_name[40];
  372.    void          (*od_no_file_func)(void);
  373.  
  374.    void          (*od_before_exit)(void);           /* Custom function hooks */
  375.    void          (*od_cbefore_chat)(void);
  376.    void          (*od_cafter_chat)(void);
  377.    void          (*od_cbefore_shell)(void);
  378.    void          (*od_cafter_shell)(void);
  379.    void          (*od_time_msg_func)(char *string);
  380.    void          (*od_ker_exec)(void);
  381.    void          (*od_local_input)(int key);
  382.  
  383.  
  384.    unsigned int  key_chat;          /* OpenDoors function key customizations */   unsigned int        key_dosshell;
  385.    unsigned int  key_drop2bbs;
  386.    unsigned int  key_hangup;
  387.    unsigned int  key_keyboardoff;
  388.    unsigned int  key_lesstime;
  389.    unsigned int  key_lockout;
  390.    unsigned int  key_moretime;
  391.    unsigned int  key_status[9];
  392.    unsigned int  key_sysopnext;
  393.  
  394.    char          od_num_keys;                    /* Additional function keys */
  395.    int           od_hot_key[16];
  396.    int           od_last_hot;
  397.    void          (*od_hot_function[16])(void);
  398.  
  399.  
  400.    char *        od_after_chat;           /* OpenDoors prompt customizations */
  401.    char *        od_after_shell;
  402.    char *        od_before_chat;
  403.    char *        od_before_shell;
  404.    char *        od_chat_reason;
  405.    char *        od_day[7];
  406.    char *        od_hanging_up;
  407.    char *        od_help_text;
  408.    char *        od_help_text2;
  409.    char *        od_inactivity_timeout;
  410.    char *        od_inactivity_warning;
  411.    char *        od_month[12];
  412.    char *        od_no_keyboard;
  413.    char *        od_no_sysop;
  414.    char *        od_no_response;
  415.    char *        od_no_time;
  416.    char *        od_offline;
  417.    char *        od_paging;
  418.    char *        od_press_key;
  419.    char *        od_sending_rip;
  420.    char *        od_status_line[3];
  421.    char *        od_sysop_next;
  422.    char *        od_time_left;
  423.    char *        od_time_warning;
  424.    char *        od_want_chat;
  425.  
  426.    char *        od_continue;
  427.    char          od_continue_yes;
  428.    char          od_continue_no;
  429.    char          od_continue_nonstop;
  430.  
  431.  
  432.    char          od_chat_colour1;         /* OpenDoors colour customizations */
  433.    char          od_chat_colour2;
  434.    char          od_list_comment_col;
  435.    char          od_list_name_col;
  436.    char          od_list_offline_col;
  437.    char          od_list_size_col;
  438.    char          od_list_title_col;
  439.    char          od_continue_col;
  440.    char          od_menu_title_col;
  441.    char          od_menu_border_col;
  442.    char          od_menu_text_col;
  443.    char          od_menu_key_col;
  444.    char          od_menu_highlight_col;
  445.    char          od_menu_highkey_col;
  446.    };
  447.  
  448. extern struct _od_control od_control;        /* od_control external variable */
  449.  
  450. #ifdef _MSC_VER                           /* If this is a Microsoft compiler */
  451. #pragma pack()                      /* Set structure packing back to default */
  452. #endif
  453.  
  454.  
  455.  
  456.                                                        /* MANIFEST CONSTANTS */
  457.                                                        /* ------------------ */
  458.  
  459. #ifndef FALSE                                /* Boolean constant definitions */
  460. #define FALSE 0
  461. #endif
  462. #ifndef TRUE
  463. #define TRUE 1
  464. #endif
  465. #define MAYBE 2
  466.  
  467. #define P_WAIT                  0                     /* od_spawnvpe() flags */
  468. #define CURRENT                 0
  469. #define IRET                    1
  470.        
  471. #define EDIT_FLAG_NORMAL        0x0000                /* od_edit_str() flags */
  472. #define EDIT_FLAG_NO_REDRAW     0x0001
  473. #define EDIT_FLAG_FIELD_MODE    0x0002
  474. #define EDIT_FLAG_EDIT_STRING   0x0004
  475. #define EDIT_FLAG_STRICT_INPUT  0x0008
  476. #define EDIT_FLAG_PASSWORD_MODE 0x0010
  477. #define EDIT_FLAG_ALLOW_CANCEL  0x0020
  478. #define EDIT_FLAG_FILL_STRING   0x0040
  479. #define EDIT_FLAG_AUTO_ENTER    0x0080
  480. #define EDIT_FLAG_AUTO_DELETE   0x0100
  481. #define EDIT_FLAG_KEEP_BLANK    0x0200
  482. #define EDIT_FLAG_PERMALITERAL  0x0400
  483. #define EDIT_FLAG_LEAVE_BLANK   0x0800
  484.        
  485. #define EDIT_RETURN_ERROR       0             /* od_edit_str() return values */
  486. #define EDIT_RETURN_CANCEL      1
  487. #define EDIT_RETURN_ACCEPT      2
  488. #define EDIT_RETURN_PREVIOUS    3
  489. #define EDIT_RETURN_NEXT        4
  490.  
  491. #define MENU_NORMAL             0x0000        /* od_popup_menu() flag values */
  492. #define MENU_ALLOW_CANCEL       0x0001
  493. #define MENU_PULLDOWN           0x0002
  494. #define MENU_KEEP               0x0004
  495. #define MENU_DESTROY            0x0008
  496.  
  497. #define DETECT_NORMAL           0x0000        /* od_autodetect() flag values */
  498.  
  499. #define SCROLL_NORMAL           0x0000                  /* od_scroll() flags */
  500. #define SCROLL_NO_CLEAR         0x0001
  501.  
  502. #define STATUS_NORMAL           0          /* OpenDoors status line settings */
  503. #define STATUS_NONE             8
  504. #define STATUS_ALTERNATE_1      1
  505. #define STATUS_ALTERNATE_2      2
  506. #define STATUS_ALTERNATE_3      3
  507. #define STATUS_ALTERNATE_4      4
  508. #define STATUS_ALTERNATE_5      5
  509. #define STATUS_ALTERNATE_6      6
  510. #define STATUS_ALTERNATE_7      7
  511.  
  512. #define D_BLACK                 0            /* OpenDoors colour definitions */
  513. #define D_BLUE                  1
  514. #define D_GREEN                 2
  515. #define D_CYAN                  3
  516. #define D_RED                   4
  517. #define D_MAGENTA               5
  518. #define D_BROWN                 6
  519. #define D_GREY                  7
  520. #define L_BLACK                 8
  521. #define L_BLUE                  9
  522. #define L_GREEN                 10
  523. #define L_CYAN                  11
  524. #define L_RED                   12
  525. #define L_MAGENTA               13
  526. #define L_YELLOW                14
  527. #define L_WHITE                 15
  528. #define B_BLACK                 L_BLACK
  529. #define B_BLUE                  L_BLUE
  530. #define B_GREEN                 L_GREEN
  531. #define B_CYAN                  L_CYAN
  532. #define B_RED                   L_RED
  533. #define B_MAGENTA               L_MAGENTA
  534. #define B_BROWN                 L_YELLOW
  535. #define B_GREY                  L_WHITE
  536.  
  537.                   /* Door information file formats (od_control.od_info_type) */
  538. #define DORINFO1              0                              /* DORINFO?.DEF */
  539. #define EXITINFO              1     /* QBBS 2.6? EXITINFO.BBS & DORINFO?.DEF */
  540. #define RA1EXITINFO           2       /* RA 1.?? EXITINFO.BBS & DORINFO?.DEF */
  541. #define CHAINTXT              3                                 /* CHAIN.TXT */
  542. #define SFDOORSDAT            4                               /* SFDOORS.DAT */
  543. #define CALLINFO              5                              /* CALLINFO.BBS */
  544. #define DOORSYS_GAP           6                     /* GAP/PC-Board DOOR.SYS */
  545. #define DOORSYS_DRWY          7                          /* DoorWay DOOR.SYS */
  546. #define QBBS275EXITINFO       8               /* QuickBBS 2.75+ EXITINFO.BBS */
  547. #define CUSTOM                9                /* User-defined custom format */
  548. #define DOORSYS_WILDCAT       10                        /* WildCat! DOOR.SYS */
  549. #define RA2EXITINFO           11                    /* RA 2.00+ EXITINFO.BBS */
  550. #define NO_DOOR_FILE          100      /* No door information file was found */
  551.  
  552.                                          /* Error type (od_control.od_error) */
  553. #define ERR_NONE              0                              /* No error yet */
  554. #define ERR_MEMORY            1          /* Unable to allocate enough memory */
  555. #define ERR_NOGRAPHICS        2    /* Function requires ANSI/AVATAR/RIP mode */
  556. #define ERR_PARAMETER         3    /* Invalid value was passed to a function */
  557. #define ERR_FILEOPEN          4                       /* Unable to open file */
  558. #define ERR_LIMIT             5       /* An internal limit has been exceeded */
  559. #define ERR_FILEREAD          6                  /* Unable to read from file */
  560. #define ERR_NOREMOTE          7  /* Function may not be called in local mode */
  561.  
  562. #define ERRORLEVEL_ENABLE     0         /* od_control.od_errorlevel indicies */
  563. #define ERRORLEVEL_CRITICAL   1
  564. #define ERRORLEVEL_NOCARRIER  2
  565. #define ERRORLEVEL_HANGUP     3
  566. #define ERRORLEVEL_TIMEOUT    4
  567. #define ERRORLEVEL_INACTIVITY 5
  568. #define ERRORLEVEL_DROPTOBBS  6
  569. #define ERRORLEVEL_NORMAL     7
  570.  
  571. #define POPUP_ERROR           -1   /* Special od_popup_menu() return values. */
  572. #define POPUP_ESCAPE          0
  573. #define POPUP_LEFT            -2
  574. #define POPUP_RIGHT           -3
  575.  
  576. #define BOX_UPPERLEFT         0               /* od_box_chars array indicies */
  577. #define BOX_TOP               1
  578. #define BOX_UPPERRIGHT        2
  579. #define BOX_LEFT              3
  580. #define BOX_LOWERLEFT         4
  581. #define BOX_LOWERRIGHT        5
  582. #define BOX_BOTTOM            6
  583. #define BOX_RIGHT             7
  584.  
  585.                    /*  Method used for serial I/O (od_control.od_com_method) */
  586. #define COM_FOSSIL            1
  587. #define COM_INTERNAL          2
  588.  
  589.                               /* Optional component initialization functions */
  590. FUNCDEF void option_config(void);
  591. FUNCDEF void option_logfile(void);
  592. FUNCDEF void option_mps(void);
  593.  
  594. #define INCLUDE_CONFIG_FILE   option_config             /* Optional settings */
  595. #define NO_CONFIG_FILE        NULL
  596. #define INCLUDE_LOGFILE       option_logfile
  597. #define NO_LOGFILE            NULL
  598. #define INCLUDE_MPS           option_mps
  599. #define NO_MPS                NULL
  600.  
  601.                                  /* Built-in personality defintion functions */
  602. FUNCDEF void pdef_opendoors(unsigned char operation);
  603. FUNCDEF void pdef_pcboard(unsigned char operation);
  604. FUNCDEF void pdef_ra(unsigned char operation);
  605. FUNCDEF void pdef_wildcat(unsigned char operation);
  606.  
  607.                                          /* Personality definition constants */
  608. #define PER_OPENDOORS         pdef_opendoors
  609. #define PER_PCBOARD           pdef_pcboard
  610. #define PER_RA                pdef_ra
  611. #define PER_WILDCAT           pdef_wildcat
  612.  
  613. #define DIS_INFOFILE          0x0001                     /* od_disable flags */
  614. #define DIS_CARRIERDETECT     0x0002
  615. #define DIS_TIMEOUT           0x0004
  616. #define DIS_LOCAL_OVERRIDE    0x0008
  617. #define DIS_BPS_SETTING       0x0010
  618. #define DIS_LOCAL_INPUT       0x0020
  619.  
  620. #define ES_DELETED            0                     /* Event status settings */
  621. #define ES_ENABLED            1
  622. #define ES_DISABLED           2
  623.  
  624. #define PEROP_DISPLAY1        0                    /* Personality operations */
  625. #define PEROP_DISPLAY2        1
  626. #define PEROP_DISPLAY3        2
  627. #define PEROP_DISPLAY4        3
  628. #define PEROP_DISPLAY5        4
  629. #define PEROP_DISPLAY6        5
  630. #define PEROP_DISPLAY7        6
  631. #define PEROP_DISPLAY8        7
  632. #define PEROP_DISPLAY9        8
  633. #define PEROP_DISPLAY10       9
  634. #define PEROP_UPDATE1         10
  635. #define PEROP_UPDATE2         11
  636. #define PEROP_UPDATE3         12
  637. #define PEROP_UPDATE4         13
  638. #define PEROP_UPDATE5         14
  639. #define PEROP_UPDATE6         15
  640. #define PEROP_UPDATE7         16
  641. #define PEROP_UPDATE8         17
  642. #define PEROP_UPDATE9         18
  643. #define PEROP_UPDATE10        19
  644. #define PEROP_INITIALIZE      20
  645. #define PEROP_CUSTOMKEY       21
  646. #define PEROP_DEINITIALIZE    22
  647.  
  648.  
  649.  
  650.                                          /* ALTERNATIVE SPELLING DEFINITIONS */
  651.                                          /* -------------------------------- */
  652.  
  653. #define od_color_config                od_colour_config
  654. #define od_chat_color1                 od_chat_colour1
  655. #define od_chat_color2                 od_chat_colour2
  656. #define od_set_color(x, y)             od_set_attrib(x|(y<<4))
  657. #define od_color_char                  od_colour_char
  658. #define od_color_delimiter             od_colour_delimiter
  659. #define od_config_colors               od_config_colours
  660. #define od_color_names                 od_colour_names
  661. #define od_full_color                  od_full_colour
  662.  
  663.  
  664.  
  665.                                       /* BACKWARDS COMPATIBILITY DEFINITIONS */
  666.                                       /* ----------------------------------- */
  667.  
  668. #define key_help                       key_status[6]
  669. #define key_nohelp                     key_status[0]
  670. #define user_credit                    user_net_credit
  671. #define caller_netmailentered          user_netmailentered
  672. #define caller_echomailentered         user_echomailentered
  673. #define caller_logintime               user_logintime
  674. #define caller_logindate               user_logindate
  675. #define caller_timelimit               user_timelimit
  676. #define caller_loginsec                user_loginsec
  677. #define caller_credit                  user_credit
  678. #define caller_userrecord              user_num
  679. #define caller_readthru                user_readthru
  680. #define caller_numpages                user_numpages
  681. #define caller_downlimit               user_downlimit
  682. #define caller_timeofcreation          user_timeofcreation
  683. #define caller_logonpassword           user_logonpassword
  684. #define caller_wantchat                user_wantchat
  685. #define caller_ansi                    user_ansi
  686. #define ra_deducted_time               user_deducted_time
  687. #define ra_menustack                   user_menustack
  688. #define ra_menustackpointer            user_menustackpointer
  689. #define ra_userhandle                  user_handle
  690. #define ra_comment                     user_comment
  691. #define ra_firstcall                   user_firstcall
  692. #define ra_combinedrecord              user_combinedrecord
  693. #define ra_birthday                    user_birthday
  694. #define ra_subdate                     user_subdate
  695. #define ra_screenwidth                 user_screenwidth
  696. #define ra_msg_area                    user_msg_area
  697. #define ra_file_area                   user_file_area
  698. #define ra_language                    user_language
  699. #define ra_date_format                 user_date_format
  700. #define ra_forward_to                  user_forward_to
  701. #define ra_error_free                  user_error_free
  702. #define ra_sysop_next                  sysop_next
  703. #define ra_emsi_session                user_emsi_session
  704. #define ra_emsi_crtdef                 user_emsi_crtdef
  705. #define ra_emsi_protocols              user_emsi_protocols
  706. #define ra_emsi_capabilities           user_emsi_capabilities
  707. #define ra_emsi_requests               user_emsi_requests
  708. #define ra_emsi_software               user_emsi_software
  709. #define ra_hold_attr1                  user_hold_attr1
  710. #define ra_hold_attr2                  user_hold_attr2
  711. #define ra_hold_len                    user_hold_len
  712. #define caller_usernum                 user_num
  713. #define caller_callsign                user_callsign
  714. #define caller_sex                     user_sex
  715. #define od_avatar                      user_avatar
  716. #define B_YELLOW                       L_YELLOW
  717. #define B_WHITE                        L_WHITE
  718. #define od_rbbs_node                   od_node
  719. #define STATUS_USER1                   STATUS_ALTERNATE_1
  720. #define STATUS_USER2                   STATUS_ALTERNATE_2
  721. #define STATUS_USER3                   STATUS_ALTERNATE_3
  722. #define STATUS_USER4                   STATUS_ALTERNATE_4
  723. #define STATUS_SYSTEM                  STATUS_ALTERNATE_5
  724. #define STATUS_HELP                    STATUS_ALTERNATE_7
  725. #define od_init_with_config(filename,function)\
  726.                                   od_control.config_file=INCLUDE_CONFIG_FILE;\
  727.                                   od_control.config_filename=filename;\
  728.                                   od_control.config_function=function;\
  729.                                   od_init()
  730. #define od_registered_to               od_control.od_reg_name
  731. #define od_registration_key            od_control.od_reg_key
  732. #define od_program_name                od_control.od_prog_name
  733. #define od_log_messages                od_control.od_logfile_messages
  734. #define od_config_text                 od_control.od_cfg_text
  735. #define od_config_lines                od_control.od_cfg_lines
  736. #define od_config_colours              od_control.od_colour_names
  737. #define config_file                    od_config_file
  738. #define config_filename                od_config_filename
  739. #define config_function                od_config_function
  740. #define default_personality            od_default_personality
  741. #define logfile                        od_logfile
  742. #define mps                            od_mps
  743. #define od_kernal                      od_kernel
  744. FUNCDEF int                            od_log_open(void);
  745. FUNCDEF void                           od_emulate(register char in_char);
  746.  
  747. #endif /* INC_OPENDOOR */
  748.