home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
ODOORS34.ZIP
/
OPENDOOR.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-07
|
21KB
|
811 lines
/* ╔════════════════════════════════════════════════════╗
* ║ ┌─────┐ ║
* ║ │ │┌────┐┌───┐┌──┐ ║
* ║ │ ││ │├───┘│ │ ║
* ║ └─────┘├────┘└─── │ ├────┐ ║
* ║ │ │ │┌───┐┌───┐┌─── ┌── ║
* ║ │ ││ ││ ││ └──┐ ║
* ║ └────┘└───┘└───┘│ ──┘ ║
* ║ ──────────── ║
* ║ Version 3.40 ║
* ╚════════════════════════════════════════════════════╝
* (C) Copyright 1992, Brian Pirie. All Rights Reserved.
*
*
* UNREGISTERED EVALUATION VERSION
* ─────────
* This version of OpenDoors may be used for a reasonable evaluation
* period, and doors written with it may NOT be distributed. Your low $28
* registration fee will entitle you to continue using OpenDoors,
* distribute or even sell programs written with it, and you will be entitled
* to free upgrades to newer versions of OpenDoors. Unlike other libraries
* of this sort, OpenDoors requires no additional licencing fees - once you
* have paid your $28, you will be entitled to unlimited use of the
* product.
*/
#ifndef OPENDOOR_H
#define OPENDOOR_H
#define FALSE 0
#define TRUE !FALSE
#define MAYBE 2
#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_YELLOW L_YELLOW
#define B_WHITE L_WHITE
#define od_set_color(x,y) od_set_attrib(x|(y<<4))
extern int od_errno;
#define EFAULT -1
#define EZERO 0
#define EINVFNC 1
#define ENOFILE 2
#define ENOENT 2
#define ENOPATH 3
#define EMFILE 4
#define EACCES 5
#define EBADF 6
#define ECONTR 7
#define ENOMEM 8
#define EINVMEM 9
#define EINVENV 10
#define EINVFMT 11
#define EINVACC 12
#define EINVDAT 13
#define EINVDRV 15
#define ENODEV 15
#define ECURDIR 16
#define ENOTSAM 17
#define ENMFILE 18
#define EINVAL 19
#define E2BIG 20
#define ENOEXEC 21
#define EXDEV 22
#define EDOM 33
#define ERANGE 34
#define EEXIST 35
struct _od_control
{
char info_path[60];
char port;
unsigned int baud;
char system_name[40],
sysop_name[40];
long system_calls;
char system_last_caller[36],
timelog_start_date[9];
int timelog_busyperhour[24],
timelog_busyperday[7];
char user_name[36],
user_location[26],
user_password[16],
user_dataphone[13],
user_homephone[13],
user_lasttime[6],
user_lastdate[9],
user_attribute,
user_flags[4];
unsigned int user_credit,
user_pending,
user_messages,
user_lastread,
user_security,
user_numcalls,
user_uploads,
user_downloads,
user_upk,
user_downk,
user_todayk,
user_time_used,
user_screen_length;
char user_last_pwdchange,
user_attrib2,
event_status,
event_starttime[6],
event_errorlevel,
event_days,
event_force,
event_last_run[9],
caller_netmailentered,
caller_echomailentered,
caller_logintime[6],
caller_logindate[9];
int caller_timelimit;
long caller_loginsec;
long caller_credit;
int caller_userrecord,
caller_readthru,
caller_numpages,
caller_downlimit;
char caller_timeofcreation[6],
caller_logonpassword[16],
caller_wantchat,
caller_ansi;
int ra_deducted_time;
char ra_menustack[50][9],
ra_menustackpointer,
ra_userhandle[36],
ra_comment[81],
ra_firstcall[9],
ra_combinedrecord[25],
ra_birthday[9],
ra_subdate[9],
ra_screenwidth,
ra_error_free,
ra_sysop_next,
ra_emsi_session,
ra_emsi_crtdef[41],
ra_emsi_protocols[41],
ra_emsi_capabilities[41],
ra_emsi_requests[41],
ra_emsi_software[41],
ra_hold_attr1,
ra_hold_attr2,
ra_hold_len,
od_status_on,
od_okaytopage;
int od_pagestartmin,
od_pageendmin;
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);
char od_extended_info,
od_ra_info;
int od_inactivity;
char od_clear_on_exit,
od_user_keyboard_on,
od_chat_color1,
od_chat_color2,
od_list_title_col,
od_list_name_col,
od_list_size_col,
od_list_comment_col,
od_list_offline_col,
od_num_keys;
int od_hot_key[16],
od_last_hot;
char *od_before_shell,
*od_after_shell,
*od_help_text,
*od_before_chat,
*od_after_chat,
od_avatar,
od_info_type,
od_page_len;
unsigned char od_disable;
char od_rbbs_node,
od_nocopyright;
int caller_usernum;
char caller_callsign[12],
caller_sex;
unsigned int key_hangup,
key_drop2bbs,
key_dosshell,
key_chat,
key_sysopnext,
key_lockout,
key_help,
key_nohelp,
key_keyboardoff,
key_moretime,
key_lesstime;
};
extern char default_path[60];
extern char od_registered_to[36];
extern unsigned int od_registration_key;
extern char od_program_name[40];
#define DORINFO1 0
#define EXITINFO 1
#define RA1EXITINFO 2
#define CHAINTXT 3
#define SFDOORSDAT 4
#define CALLINFO 5
#define DOORSYS_GAP 6
#define DOORSYS_DRWY 7
#define DIS_INFOFILE 0x01
#define DIS_CARRIERDETECT 0x02
#define DIS_TIMEOUT 0x04
extern struct _od_control od_control;
struct _net_address
{
int zone,
net,
node,
point;
};
struct config
{
unsigned version_id;
char commport;
long baud;
char init_tries,
init_str[71],
busy_str[71],
init_resp[41],
busy_resp[41],
connect_300[41],
connect_1200[41],
connect_2400[41],
connect_4800[41],
connect_9600[41],
connect_19k[41],
connect_38k[41],
answer_phone,
ring_str[21],
answer_str[21],
flush_buffer;
int modem_delay,
minimum_baud,
graphics_baud,
transfer_baud;
char slow_baud_time_start[6],
slow_baud_time_end[6],
download_time_start[6],
download_time_end[6],
paging_time_start[6],
paging_time_end[6],
loading_msg[71],
list_prompt[71];
int pwd_expiry;
char menu_path[61],
text_path[61],
net_path[61],
nodelist_path[61],
msg_base_path[61],
sys_path[61],
external_ed_cmd[61];
struct _net_address address[10];
char system_name[31];
unsigned new_security;
int new_credit;
char new_flags[4],
origin_line[61],
quote_string[16],
sysop[36],
log_file_name[61],
fast_logon,
allow_sys_rem,
mono_mode,
strict_pwd_checking,
direct_write,
show_check;
int credit_factor,
user_time_out,
logon_time,
password_tried,
max_page,
page_length;
char check_for_multi_logon,
exclude_sysop_from_list,
one_word_names,
check_mail,
ask_voice_phone,
ask_data_phone,
do_full_mail_check,
allow_file_shells,
fix_upload_dates,
show_file_dates,
ansi,
clear_screen,
more_prompt,
upload_msgs,
kill_sent;
unsigned crash_ask_sec;
char crash_ask_flags[4];
unsigned crash_sec;
char crash_flags[4];
unsigned f_attach_sec;
char f_attach_flags[4];
char norm_fore,
norm_back,
stat_fore,
stat_back,
hi_back,
hi_fore,
wind_fore,
wind_back,
exit_local,
exit_300,
exit_1200,
exit_2400,
exit_4800,
exit_9600,
exit_19k,
exit_38k,
multi_line,
min_pwd_len;
unsigned min_up_space;
char hot_keys,
border_fore,
border_back,
bar_fore,
bar_back,
log_style,
multi_tasker,
pwd_board;
unsigned buffer_size;
char f_keys[10][61],
why_page,
leave_msg,
show_missing_files,
missing_string[11],
allow_netmail_replies,
logon_prompt[41],
check_new_files,
reply_header[61],
blank_secs,
protocol_attrib[6],
error_free_string[16],
default_combined[25];
unsigned renum_threshold;
char left_bracket,
right_bracket,
ask_for_handle,
ask_for_birthdate;
unsigned unused;
char confirm_msg_deletes,
location_prompt[61],
page_prompt[61],
user_file_prompt[41],
new_user_group,
avatar,
bad_pwd_area,
location[41],
do_after_action,
cr_prompt[41],
cr_fore,
cr_back,
continue_prompt[41],
send_break,
list_path[61],
full_msg_view,
emsi_enable,
emsi_new_user,
future_expansion[492],
config_path[80],
config_type;
};
extern struct config *cfg;
#define BBS_RA 0
#define YES 0
#define NO 1
#define ASK 2
struct file_area
{
char name[31];
unsigned char attrib;
char path[41],
space[41];
unsigned int security;
unsigned char flags_a,
flags_b,
flags_c,
flags_d;
unsigned int private_security;
unsigned char priv_flags_a,
priv_flags_b,
priv_flags_c,
priv_flags_d;
};
struct files_info
{
struct file_area area[200];
char files_path[80];
char files_type;
};
extern struct files_info *file_info;
struct message_area
{
char name[41],
area_type,
message_kinds;
unsigned char attrib,
days_kill,
recv_kill;
unsigned int max_msgs,
read_sec;
unsigned char read_flags_a,
read_flags_b,
read_flags_c,
read_flags_d;
unsigned int write_sec;
unsigned char write_flags_a,
write_flags_b,
write_flags_c,
write_flags_d;
unsigned int sysop_sec;
unsigned char sysop_flags_a,
sysop_flags_b,
sysop_flags_c,
sysop_flags_d;
char origin_line[61];
unsigned char which_aka;
};
struct msg_info
{
struct message_area area[200];
char msg_path[80];
char msg_type;
};
extern struct msg_info *message_info;
#define AREA_ECHOINFO 0x01
#define AREA_COMBINED 0x02
#define AREA_FILEATTACH 0x04
#define AREA_ALIASES 0x08
#define AREA_HANDLE 0x10
#define KIND_BOTH 0
#define KIND_PRIVATE 1
#define KIND_PUBLIC 2
#define KIND_READONLY 3
#define TYPE_LOCAL 0
#define TYPE_NETMAIL 1
#define TYPE_ECHOMAIL 2
struct user_rec
{
char name[36],
location[26],
password[16],
data_phone[13],
voice_phone[13],
last_time[6],
last_date[9];
unsigned char attrib1,
flag[4];
unsigned int netmail_credit,
credit_pending,
msgs_posted,
last_read,
security,
num_calls,
uploads,
downloads,
upload_k,
download_k,
today_k;
int elapsed_time;
unsigned int screen_length;
unsigned char last_pwd_change,
attrib2,
group;
unsigned int xi_record;
char space[3],
handle[36],
comment[81],
first_date[9];
unsigned char combined_areas[25];
char birth_date[9],
expiry_date[9];
unsigned char screen_width,
extra_space[83];
};
extern struct user_rec *user_record;
extern char user_type;
extern int num_users;
extern int user_number;
#define USER_RA100 0
#define USER_RA_QBBS 1
struct _timelog
{
char start_date[9];
unsigned int busy_per_hour[24];
unsigned int busy_per_day[7];
};
extern struct _timelog *timelog;
struct eventrecord
{
unsigned char status;
char time[6];
unsigned char errorlevel,
days;
char forced,
last_date_run[9];
};
struct _event_file
{
struct eventrecord event[20];
char filename[80];
};
extern struct _event_file *event_file;
#define ES_DELETED 0
#define ES_ENABLED 1
#define ES_DISABLED 2
struct protocolrecord
{
char name[16],
active_key,
opus_ctl_file,
batch_avail,
enabled,
log_file[81],
ctl_file[81],
down_cmd[81],
down_ctl[81],
up_cmd[81],
up_ctl[81],
up_log_keyword[21],
down_log_keyword[21],
desc_word_num,
name_word_num;
};
struct _protocol_file
{
struct protocolrecord record[15];
char filename[80];
};
extern struct _protocol_file *protocol_file;
struct _user_on
{
char name[36];
unsigned char node;
unsigned int baud;
char location[26],
do_not_disturb;
unsigned char status;
};
extern struct _user_on user_on;
#define STATUS_BROWSE 0
#define STATUS_XFER 1
#define STATUS_MESSAGE 2
#define STATUS_DOOR 3
#define STATUS_CHAT 4
#define STATUS_QUEST 5
struct _call_history
{
unsigned char node;
char name[36],
location[26];
unsigned int baud_rate;
unsigned long times;
char logon_time[6],
logoff_time[6];
unsigned long total_system_calls;
unsigned char last_system_caller[36];
};
extern struct _call_history call_history;
struct _menuentry
{
unsigned char type;
unsigned int security;
unsigned char flag[4];
char display[76],
hotkey,
options[81];
unsigned char foreground,
background;
};
struct _menufile
{
struct _menuentry entry[32];
char num_entries;
char filename[80];
};
extern struct _menufile *menufile;
struct _msg_hdr
{
unsigned int message_number,
previous_reply,
next_reply,
times_read,
start_block,
num_blocks,
dest_net,
dest_node,
origin_net,
origin_node;
unsigned char dest_zone,
origin_zone;
unsigned int cost;
unsigned char msg_attr,
net_attr,
board;
char time[6],
date[9],
who_to[36],
who_from[36],
subject[73];
};
extern struct _msg_hdr *msg_hdr;
#define NEXT_MESSAGE 65535
struct _msg_info
{
unsigned int first_msg,
last_msg,
total_msgs,
total_on_board[200];
};
extern struct _msg_info *msg_info;
#define MSG_DELETED 0x01
#define MSG_OUTGOING_NET 0x02
#define MSG_NETMAIL 0x04
#define MSG_PRIVATE 0x08
#define MSG_RECEIVED 0x10
#define MSG_OUTGOING_ECHO 0x20
#define MSG_LOCAL 0x40
#define NET_KILL_SENT 0x01
#define NET_SENT 0x02
#define NET_FILE_ATTACH 0x04
#define NET_CRASH 0x08
#define NET_REQ_RECEIPT 0x10
#define NET_REQ_AUDIT 0x20
#define NET_RETURN_RECEIPT 0x40
void od_init(void);
void od_kernal(void);
void od_exit(int errorlevel,char term_call);
void od_page(void);
void od_disp_str(char *string);
void od_printf(char *format,...);
void od_clr_scr(void);
void od_set_cursor(int row,int col);
void od_set_attrib(int color);
void od_clear_keybuffer(void);
int od_get_key(int wait);
void od_input_str(char *string,int max_len,unsigned char minchar,unsigned char maxchar);
void od_repeat(char value,unsigned char times);
void od_clr_line(void);
void od_disp(char *buffer,int size,char local_echo);
void od_emulate(register char in_char);
int od_send_file(char *filename);
int od_list_files(char *directory);
int od_read_config(void);
int od_write_config(void);
int od_read_files(void);
int od_write_files(void);
int od_read_msgs(void);
int od_write_msgs(void);
int od_read_events(void);
int od_write_events(void);
int od_read_protocols(void);
int od_write_protocols(void);
int od_calls_open(void);
int od_calls_read_next(void);
int od_calls_add(void);
int od_calls_close(void);
int od_useron_open(void);
int od_useron_read(unsigned char node);
int od_useron_write(void);
int od_useron_close(void);
int od_open_users(char *path);
int od_read_user(int num);
int od_write_user(void);
int od_add_user(void);
int od_close_users(void);
int od_read_timelog(void);
int od_read_menu(char *filename);
int od_write_menu(void);
int od_msg_open(void);
int od_msg_read_text(char *text,unsigned int max_len);
int od_msg_read_hdr(unsigned int num);
int od_msg_post(char *text);
int od_msg_change_hdr(void);
int od_msg_close(void);
#endif