home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / com / bbs / lora / lora234s.exe / LORA.H < prev    next >
C/C++ Source or Header  |  1993-10-17  |  43KB  |  898 lines

  1. /*
  2.  
  3.                       LoraBBS (DOS / OS2) Ver. 2.33
  4.  
  5.     Copyright (c) 1989, 1990, 1991, 1992, 1993 by Marco Maccaferri.
  6.                           All rights reserved.
  7.  
  8.  
  9.                    Structure definitions for release
  10.  
  11.  
  12.  
  13.   You may use those structures at your own risk. The author cannot guarantee
  14.   that this structures are maintained in all future versions of the program.
  15.   You can freely (and you are encouraged on that) distribute this file
  16.   without limitations.
  17.  
  18.   You can contact the autor at one of the following address:
  19.  
  20.   Marco Maccaferri
  21.   BBS: 39-51-6331730 (2:332/402)
  22.  
  23. */
  24.  
  25. typedef unsigned short bit;
  26. typedef unsigned short word;
  27. typedef unsigned char  byte;
  28. typedef long           dword;
  29.  
  30. struct _stamp
  31. {
  32.    unsigned short date;      /* (year - 1980) * 512 + month * 32 + day */
  33.    unsigned short time;      /* hour * 2048 + minute * 32 + second/2 */
  34. };
  35.  
  36. struct _lastread
  37. {
  38.    word  area;               /* Message area number */
  39.    short msg_num;            /* Last message read */
  40. };
  41.  
  42. #define MAXLREAD   50
  43. #define MAXDLREAD  20
  44. #define MAXFLAGS   4
  45. #define MAXCOUNTER 10
  46.  
  47. struct _usridx       /* Structure for the USERS.IDX file */
  48. {
  49.    long id;              /* User-ID is the 32 bit CRC of the user's name */
  50. };
  51.  
  52. struct _usr          /* Structure for the USERS.BBS file */
  53. {
  54.    char  name[36];         /* User's name */
  55.    char  handle[36];       /* User's handle */
  56.    char  city[26];         /* User's city */
  57.  
  58.    struct _lastread lastread[MAXLREAD];   /* Last messages read for the last
  59.                                              MAXLREAD message areas (used for
  60.                                              QWK selections) */
  61.    struct _lastread lastread2[MAXDLREAD]; /* Last messages read for the last
  62.                                              MAXDLREAD message areas */
  63.    char  pwd[16];          /* User's password (crypted) (*) */
  64.    dword times;            /* Times the user has called the system */
  65.    word  nulls;            /* Number of nulls (0) sent after a CR/LF */
  66.    word  msg;              /* User's last message area visited */
  67.  
  68.    bit   avatar    :1;     /* 1=Avatar color/graphics enabled */
  69.    bit   color     :1;     /* 1=Color codes will be sent */
  70.    bit   scanmail  :1;     /* 1=Check for mail at logon */
  71.    bit   use_lore  :1;     /* 0=Use the Ansi full screen editor */
  72.    bit   more      :1;     /* 1=Pause at the end of each page */
  73.    bit   ansi      :1;     /* 1=Ansi color/graphics enabled */
  74.    bit   kludge    :1;     /* 1=Display the ^a kludge lines */
  75.    bit   formfeed  :1;     /* 1=Screen clearing codes will be sent */
  76.  
  77.    bit   hotkey    :1;     /* 1=Hot keyed menus */
  78.    bit   tabs      :1;     /* 0=tabs (9) are converted to spaces */
  79.    bit   full_read :1;     /* 1=Full screen message wiewer */
  80.    bit   badpwd    :1;     /* 1=Bad password for the last call */
  81.    bit   usrhidden :1;     /* 1=The user is hidden from the users list */
  82.    bit   nokill    :1;     /* 1=Don't kill this user */
  83.    bit   ibmset    :1;     /* 1=Character > 127 will be sent */
  84.    bit   deleted   :1;     /* 1=User is deleted from the list */
  85.  
  86.    byte  language;         /* User's language number */
  87.    byte  priv;             /* User's privilege level */
  88.    long  flags;            /* Flags settings */
  89.    char  ldate[20];        /* User's last call date */
  90.    short time;             /* Time the user has spent on-line today */
  91.    dword upld;             /* User's total kbytes uploaded */
  92.    dword dnld;             /* User's total kbytes downloaded */
  93.    word  dnldl;            /* Users' kbytes downloaded today */
  94.    word  n_upld;           /* Number of files uploaded */
  95.    word  n_dnld;           /* Number of files downloaded */
  96.    word  files;            /* User's last file area visited */
  97.    word  credit;           /* Netmail credit */
  98.    word  dbase;            /* <reserved> (**) */
  99.    char  signature[58];    /* User's personal signature */
  100.    char  voicephone[20];   /* User's voice telephone number */
  101.    char  dataphone[20];    /* User's data telephone number */
  102.    char  birthdate[10];    /* User's date of birth */
  103.    char  expiredate[10];   /* Expiration date */
  104.    char  firstdate[20];    /* User's first call date and time */
  105.    char  lastpwdchange[10];/* User's last password change date */
  106.    long  ptrquestion;      /* Pointer to the answer questionaire file */
  107.    byte  len;              /* User's screen length */
  108.    byte  width;            /* User's screen width */
  109.    long  id;               /* This is the 32 bit CRC of the user's name */
  110.    short msgposted;        /* Number of messages posted */
  111.    char  comment[80];      /* Comment for advanced user editors */
  112.    byte  help;             /* <reserved> (**) */
  113.    word  baud_rate;        /* Last call connection speed */
  114.    byte  counter[MAXCOUNTER]; /* General pourpouse counters */
  115.    word  chat_minutes;     /* Minutes used today to chat with Sysop */
  116.  
  117.    bit   xfer_prior:1;     /* 1=No download limits */
  118.    bit   quiet     :1;     /* <reserved> (**) */
  119.    bit   nerd      :1;     /* 1=Yell don't bell for this user */
  120.    bit   donotdisturb:1;   /* <reserved> (**) */
  121.    bit   robbed    :1;     /* <reserved> (**) */
  122.    bit   novote    :1;     /* <reserved> (**) */
  123.  
  124.    char  protocol;         /* User's default file trasnfer protocol */
  125.    char  archiver;         /* User's default compressor */
  126.  
  127.    struct _ovr_class_rec { 
  128.       short max_time;       /* Minutes per day */
  129.       short max_call;       /* Minutes per call */
  130.       short max_dl;         /* Download limit */
  131.       word  ratio;          /* Download/Upload ratio */
  132.       word  min_baud;       /* Minimum logon baud */
  133.       word  min_file_baud;  /* Minimum download bad */
  134.       word  start_ratio;    /* Start ratio */
  135.    } ovr_class;
  136.  
  137.    short msg_sig;          /* Default message group */
  138.    word  account;          /* Account for time bank */
  139.    word  f_account;        /* Account for file bank */
  140.    short votes;            /* Holds votes received */
  141.    short file_sig;         /* Default file group */
  142.  
  143.    char  extradata[290];   /* Reserved for future use */
  144.                            /* Total=1024 bytes */
  145. };
  146.  
  147. #define SIZEOF_MSGAREA    512
  148. #define SIZEOF_FILEAREA   640
  149.  
  150. struct _sys          /* Structure for the internal system records.
  151.                         The files SYSMSG.DAT and SYSFILE.DAT
  152.                         are composed by the respective portions of this
  153.                         structure */
  154. {
  155.    /* Begin of the SYSMSG.DAT file --------------------------------------- */
  156.    char  msg_name[70];      /* Message area name */
  157.    short msg_num;           /* Message area number */
  158.    char  msg_path[40];      /* Message area path */
  159.    char  origin[56];        /* Echomail origin line */
  160.    bit   echomail  :1;      /* 1=Echomail area */
  161.    bit   netmail   :1;      /* 1=Netmail area */
  162.    bit   public    :1;      /* 1=Public message allowed */
  163.    bit   private   :1;      /* 1=Private message allowed */
  164.    bit   anon_ok   :1;      /* 1=Use the user's handle in the from field */
  165.    bit   no_matrix :1;      /* <reserved> (**) */
  166.    bit   squish    :1;      /* Squish<tm> message area */
  167.    bit   kill_unlisted :1;  /* <reserved> (**) */
  168.    word  msg_sig;           /* Message area's group */
  169.    char  echotag[32];       /* Echotag name */
  170.    word  pip_board;         /* Pip-base board number */
  171.    byte  quick_board;       /* QuickBBS board number */
  172.    byte  msg_priv;          /* Minimum level to access this area */
  173.    long  msg_flags;         /* Flags settings */
  174.    byte  write_priv;        /* Minimum level to write messages */
  175.    long  write_flags;       /* Flags settings */
  176.    byte  use_alias;         /* Use alias # with this area */
  177.    short max_msgs;          /* Maximum number of messages in this area */
  178.    short max_age;           /* Max age of messages (days) */
  179.    short age_rcvd;          /* Max age of received messages (days) */
  180.    char  forward1[80];      /* Forward node list 1/3 */
  181.    char  forward2[80];      /* Forward node list 2/3 */
  182.    char  forward3[80];      /* Forward node list 3/3 */
  183.    bit   msg_restricted :1; /* Access restricted to message area's group */
  184.    bit   passthrough    :1; /* Pass-through area */
  185.    byte  areafix;           /* Areafix access level for that area */
  186.    char  qwk_name[14];      /* Short name used by the QWK mail packer */
  187.    char  filler1[32];
  188.    /* End of the SYSMSG.DAT file ----------------------------------------- */
  189.  
  190.    /* Begin of the SYSFILE.DAT file -------------------------------------- */
  191.    char  file_name[70];     /* File area name */
  192.    short file_num;          /* File area number */
  193.    char  uppath[40];        /* Upload path */
  194.    char  filepath[40];      /* Download path */
  195.    char  filelist[50];      /* CD-ROM list file name */
  196.    bit   freearea  :1;      /* Free download limit */
  197.    bit   norm_req  :1;      /* <reserved> (**) */
  198.    bit   know_req  :1;      /* <reserved> (**) */
  199.    bit   prot_req  :1;      /* <reserved> (**) */
  200.    bit   nonews    :1;      /* <reserved> (**) */
  201.    bit   no_global_search :1; /* 1=Exclude from global searches */
  202.    bit   no_filedate :1;    /* <reserved> (**) */
  203.    bit   file_restricted :1; /* Access restricted to file area's group */
  204.    word  file_sig;          /* <reserved> (**) */
  205.    byte  file_priv;         /* Minimum level to access this area */
  206.    long  file_flags;        /* Flags settings */
  207.    byte  download_priv;     /* Minimum level to download files */
  208.    long  download_flags;    /* Flags settings */
  209.    byte  upload_priv;       /* Minimum level to upload files */
  210.    long  upload_flags;      /* Flags settings */
  211.    byte  list_priv;         /* Minimum level to see the file titles */
  212.    long  list_flags;        /* Flags settings */
  213.    char  filler2[10];
  214.    char  short_name[13];    /* Area's short name */
  215.    char  filler3[8];
  216.    char  tic_tag[32];       /* TIC processor area's tag name */
  217.    char  tic_forward1[80];  /* Forward node list (1/3) */
  218.    char  tic_forward2[80];  /* Forward node list (2/3) */
  219.    char  tic_forward3[80];  /* Forward node list (3/3) */
  220.    byte  tic_level;         /* TIC area's level */
  221.    long  tic_flags;         /* TIC area's flags */
  222.    char  filler4[107];
  223.    /* End of the SYSFILE.DAT file ---------------------------------------- */
  224. };
  225.  
  226. struct _sys_idx     /* Structure for the SYSMSG.IDX, SYSFILE.IDX files */
  227. {
  228.    byte  priv;            /* Area's privilege level */
  229.    byte  flags[MAXFLAGS]; /* Flags settings */
  230.    char  key[13];         /* Area's name */
  231.    word  area;            /* Area absolute number */
  232.    word  sig;             /* Area group number */
  233. };
  234.  
  235. /* Privilege levels definitions */
  236.  
  237. #define  TWIT        0x10
  238. #define  DISGRACE    0x20
  239. #define  LIMITED     0x30
  240. #define  NORMAL      0x40
  241. #define  WORTHY      0x50
  242. #define  PRIVIL      0x60
  243. #define  FAVORED     0x70
  244. #define  EXTRA       0x80
  245. #define  CLERK       0x90
  246. #define  ASSTSYSOP   0xA0
  247. #define  SYSOP       0xB0
  248. #define  HIDDEN      0xC0
  249.  
  250. struct _daystat {    /* Record for statistics used in SYSINFO.DAT */
  251.    long timestamp;       /* Time-stamp check */
  252.  
  253.    long incalls;         /* Number of inbound calls */
  254.    long outcalls;        /* Number of outbound calls */
  255.    long humancalls;      /* Number of inbound human calls */
  256.    long filesent;        /* Number of files sent */
  257.    long bytesent;        /* Number of bytes sent */
  258.    long filerequest;     /* Number of file requests received */
  259.    long filereceived;    /* Number of files received */
  260.    long bytereceived;    /* Number of bytes received */
  261.    long completed;       /* Number of completed calls */
  262.    long failed;          /* Number of failed calls (including cost) */
  263.    long cost;            /* Number of cost failed calls */
  264.  
  265.    long emailreceived;   /* Number of netmail messages received */
  266.    long emailsent;       /* Number of netmail messages sent */
  267.    long echoreceived;    /* Number of echomail messages received */
  268.    long echosent;        /* Number of echomail messages sent */
  269.    long dupes;           /* Number of dupe echomail messages received */
  270.    long bad;             /* Number of bad echomail messages received */
  271.  
  272.    long exectime;        /* Seconds of system activity */
  273.    long idletime;        /* Seconds of idle time */
  274.    long interaction;     /* Seconds of operator's interaction */
  275.    long echoscan;        /* Seconds spent during echomail processing */
  276.    long inconnects;      /* Seconds spent on inbound calls */
  277.    long outconnects;     /* Seconds spent on outbound calls */
  278.    long humanconnects;   /* Seconds spent on human calls */
  279. };
  280.  
  281. struct _sysinfo      /* Structure for the SYSINFO.DAT file */
  282. {
  283.    long stamp_up;              /* <reserved> (**) */
  284.    long stamp_down;            /* <reserved> (**) */
  285.    long quote_position;        /* Last position in the quote file */
  286.    unsigned long total_calls;  /* Total system calls */
  287.    char pwd[40];               /* Keyboard password (crypted) (*) */
  288.    struct _daystat today;      /* Dayly system statistics */
  289.    struct _daystat yesterday;  /* Dayly system statistics (yesteday) */
  290.    struct _daystat week;       /* Weekly system statistics */
  291.    struct _daystat month;      /* Monthly system statistics */
  292.    struct _daystat year;       /* Yearly system statistics */
  293. };
  294.  
  295. #define BROWSING     1
  296. #define UPLDNLD      2
  297. #define READWRITE    3
  298. #define DOOR         4
  299. #define CHATTING     5
  300. #define QUESTIONAIRE 6
  301.  
  302. struct _useron       /* Structure for the USERON.BBS file */
  303. {
  304.    char  name[36];              /* User's name */
  305.    short line;                  /* Task number currently on */
  306.    word  baud;                  /* Baud rate */
  307.    char  city[26];              /* User's city */
  308.    bit   donotdisturb: 1;       /* Do not disturb flag */
  309.    bit   priv_chat   : 1;       /* <reserved> (**) */
  310.    short status;                /* User's status */
  311.    short cb_channel;            /* CB Chat System channel */
  312. };
  313.  
  314. struct _lastcall     /* Structure for the LASTCALL.BBS file */
  315. {
  316.    short line;                  /* Task number */
  317.    char  name[36];              /* User's name */
  318.    char  city[26];              /* User's city */
  319.    word  baud;                  /* Baud rate */
  320.    long  times;                 /* Times the user has called the system */
  321.    char  logon[6];              /* Logon time HH:MM */
  322.    char  logoff[6];             /* Logoff time HH:MM */
  323.    long  timestamp;             /* Logout time-stamp (binary format) */
  324. };
  325.  
  326. struct _menu_header  /* Header of the *.MNU files
  327.  
  328.                         Menus are structured as follow:
  329.  
  330.                         <_menu_header>
  331.                            <_cmd> \
  332.                            ......  |- _menu_header.n_elem
  333.                            <_cmd> /
  334.                         <_menu_header>
  335.                            <_cmd> \
  336.                            ......  |- _menu_header.n_elem
  337.                            <_cmd> /
  338.                         ..............
  339.                       */
  340. {
  341.    char name[14];    /* Menu' name */
  342.    short n_elem;      /* Number of struct _cmd records for this menu */
  343. };
  344.  
  345. struct _cmd          /* Structure for the *.MNU files */
  346. {
  347.    char   name[80];        /* User's display */
  348.    byte   priv;            /* Minimum level for this command */
  349.    byte   flags[MAXFLAGS]; /* Minimum flags setting */
  350.    short  flag_type;       /* Type of command */
  351.    bit    automatic: 1;    /* Automatic execution */
  352.    bit    dummy:     1;    /* <reserved> (**) */
  353.    bit    first_time:1;    /* Executed only the first time the menu' is read */
  354.    byte   color;           /* Normal background and foreground colors */
  355.    byte   first_color;     /* Hilight background and foreground colors */
  356.    byte   hotkey;          /* Key that activate the command */
  357.    char   argument[50];    /* Optional argument list */
  358. };
  359.  
  360. struct _mail         /* Structure for the MSGTOIDX.DAT file */
  361. {
  362.    long to;                    /* Recipient's name 32-bit CRC */
  363.    word area;                  /* Message area number */
  364.    word msg_num;               /* Message number */
  365. };
  366.  
  367. struct _lorainfo     /* Structure for the LORAINFO.Txx file.
  368.                         xx=Task number in two digit hex number */
  369. {
  370.    struct _usr usr;            /* The complete user record */
  371.    word  baud;                  /* The current baud rate */
  372.    short port;                  /* The current comm port number */
  373.    short time;                  /* Minutes remaining for this call */
  374.    char  log[40];               /* Log file name */
  375.    char  system[80];            /* System name */
  376.    char  sysop[36];             /* Sysop's name */
  377.    word  task;                  /* Current task number */
  378.    word  max_baud;              /* Maximum modem baud rate */
  379.    long  posuser;               /* User's position in the user file */
  380.    word  yelling;               /* Number of times the user has requested
  381.                                   for a chat */
  382.    word  downloadlimit;         /* User's download limit */
  383.    short max_time;              /* User's maximum on line time in 24h */
  384.    short max_call;              /* User's maximum on line time for call */
  385.    word  ratio;                 /* Download/upload ratio limit (0=No limit) */
  386.    word  min_baud;              /* Minimum baud rate for user's level */
  387.    word  min_file_baud;         /* Minimum baud rate for file transfers */
  388.    bit   wants_chat  :1;        /* 1=The user has request a chat */
  389.    bit   mnp_connect :1;        /* 1=MNP connection */
  390.    bit   keylock     :1;        /* 1=The keyboard is locked */
  391.    char  logindate[20];         /* User's login date */
  392.    char  password[40];          /* Keyboard password (crypted) (*) */
  393.    unsigned long total_calls;  /* Total system calls */
  394.    word  start_ratio;           /* User's ratio start value */
  395.    char  from[36];              /* From field of new messages */
  396.    char  to[36];                /* To field of new messages */
  397.    char  subj[72];              /* Subject field of new messages */
  398.    char  msgdate[20];           /* Date field of new messages */
  399.    word  attrib;                /* Attribute field of new messages */
  400. };
  401.  
  402. struct _bbslist      /* Structure for the BBSLIST.BBS file */
  403. {
  404.    char bbs_name[40];          /* System's name */
  405.    char sysop_name[36];        /* Sysop's name */
  406.    char number[20];            /* Telephone number */
  407.    word baud;                  /* Maximum baud rate */
  408.    char open_times[12];        /* Open hours */
  409.    char net[16];               /* Network address */
  410.    char bbs_soft[16];          /* Software used */
  411.    char other[60];             /* Other informations */
  412.    char extra_space[100];      /* Reserved for future use */
  413. };
  414.  
  415. #define CONFIG_VERSION   2
  416.  
  417. #define MAXNL            10
  418. #define MAXPACKER        10
  419. #define MAX_ALIAS        20
  420. #define MAX_LANG         20
  421.  
  422. #define DAY_SUNDAY       0x01
  423. #define DAY_MONDAY       0x02
  424. #define DAY_TUESDAY      0x04
  425. #define DAY_WEDNESDAY    0x08
  426. #define DAY_THURSDAY     0x10
  427. #define DAY_FRIDAY       0x20
  428. #define DAY_SATURDAY     0x40
  429. #define DAY_UNUSED       0x80
  430.  
  431. struct _alias
  432. {
  433.    short zone;              /* Zone number */
  434.    short net;               /* Net number */
  435.    short node;              /* Node number */
  436.    short point;             /* Point number */
  437.    word  fakenet;           /* Fake net number */
  438.    char  *domain;           /* <reserved> (**) */
  439. };
  440.  
  441. struct class_rec
  442. {
  443.    short priv;              /* Access level */
  444.    short max_time;          /* Dayly time limit */
  445.    short max_call;          /* Per call time limit */
  446.    short max_dl;            /* Default download limit */
  447.    short dl_300;            /* Speed specific download limit */
  448.    short dl_1200;           /* Speed specific download limit */
  449.    short dl_2400;           /* Speed specific download limit */
  450.    short dl_9600;           /* Speed specific download limit */
  451.    word  ratio;             /* Download/Upload ratio */
  452.    word  min_baud;          /* Minimum login speed */
  453.    word  min_file_baud;     /* Minimum file transfer speed */
  454.    word  start_ratio;       /* Start ratio after some downloads */
  455. };
  456.  
  457. struct _configuration     /* Structure for the CONFIG.DAT file */
  458. {
  459.    short version;                    /* Configuration file version */
  460.  
  461.    char  sys_path[40];               /* System directory */
  462.  
  463.    char  log_name[40];               /* Log file name */
  464.    char  log_style;                  /* Type of log: 0=Verbose, 1=Short */
  465.  
  466.    char  sched_name[40];             /* Scheduler file name */
  467.    char  user_file[40];              /* User's file base name (w/o extension) */
  468.  
  469.    char  norm_filepath[40];          /* Unknow nodes inbound */
  470.    char  know_filepath[40];          /* Know nodes inbound */
  471.    char  prot_filepath[40];          /* Protected nodes inbound */
  472.    char  outbound[40];               /* Outbound base directory */
  473.    char  netmail_dir[40];            /* Netmail directory */
  474.    char  bad_msgs[40];               /* Bad messages directory */
  475.    char  dupes[40];                  /* Dupe messages directory */
  476.    char  quick_msgpath[40];          /* QuickBBS (Hudson) message base path */
  477.    char  pip_msgpath[40];            /* Pip-base path */
  478.    char  ipc_path[40];               /* Temporary files storage */
  479.    char  net_info[40];               /* Nodelist directory */
  480.    char  glob_text_path[40];         /* Text files path */
  481.    char  menu_path[40];              /* Menu/Languages path */
  482.    char  flag_dir[40];               /* Activity flags directory */
  483.  
  484.    long  keycode;                    /* Registration key code (<2.33) */
  485.  
  486.    char  about[40];                  /* 'ABOUT' file to send */
  487.    char  files[40];                  /* 'FILES' file to send */
  488.    short norm_max_kbytes;            /* Unknow nodes f/req. kbytes limit */
  489.    short prot_max_kbytes;            /* Protected nodes f/req. kbytes limit */
  490.    short know_max_kbytes;            /* Know nodes f/req. kbytes limit */
  491.    short norm_max_requests;          /* Unknow nodes f/req. files limit */
  492.    short prot_max_requests;          /* Protected nodes f/req. files limit */
  493.    short know_max_requests;          /* Know nodes f/req. files limit */
  494.    char  def_pack;                   /* Default packer */
  495.  
  496.    char  enterbbs[70];               /* 'Press ESC to enter the BBS' */
  497.    char  banner[70];                 /* Initial mailer banner */
  498.    char  mail_only[70];              /* Mail only banner */
  499.  
  500.    short com_port;                   /* Serial port (0-based) */
  501.    short speed;                      /* Modem initial speed */
  502.    char  modem_busy[20];             /* Modem busy command */
  503.    char  dial[20];                   /* Modem default dial command */
  504.    char  init[40];                   /* Modem initialization command */
  505.    char  term_init[40];              /* Terminal mode initialization command */
  506.    char  answer[20];                 /* Answer command */
  507.  
  508.    struct _altern_dial {             /* Alternative dialing commands */
  509.        char prefix[20];              /* Prefix command */
  510.        char suffix[20];              /* Suffix command */
  511.    } altdial[10];                   
  512.  
  513.    bit   lock_baud   :1;             /* 1=Lock serial port to speed baud */
  514.    bit   ansilogon   :2;             /* 0=No ansi at logon, 1=Detect, 2=Ask, 3=Yes */
  515.    bit   birthdate   :1;             /* 1=Ask for birthdate */
  516.    bit   voicephone  :1;             /* 1=Ask for voice phone */
  517.    bit   dataphone   :1;             /* 1=Ask for data phone */
  518.    bit   emsi        :1;             /* 1=EMSI sessions enabled */
  519.    bit   ibmset      :1;             /* 1=Ask for IBM set display */
  520.  
  521.    bit   wazoo       :1;             /* 1=WAZOO sessions enabled */
  522.    bit   msgtrack    :1;             /* <reserved> (**) */
  523.    bit   keeptransit :1;             /* 1=Keep in-transit netmail */
  524.    bit   hslink      :1;             /* 1=HS-Link enabled */
  525.    bit   puma        :1;             /* 1=Puma enabled */
  526.    bit   secure      :1;             /* 1=Check import messages */
  527.    bit   janus       :1;             /* 1=Janus protocol enabled */
  528.    bit   terminal    :1;             /* 1=Null modem connections */
  529.  
  530.    bit   mono_attr   :1;             /* 1=Use monochrome attributes */
  531.    bit   no_direct   :1;             /* 1=Use BIOS screen writes */
  532.    bit   snooping    :1;             /* 1=Snoop user on-line */
  533.    bit   snow_check  :1;             /* 1=CGA snow check */
  534.    bit   unpack_norm :1;             /* <reserved> (**) */
  535.    bit   unpack_know :1;             /* <reserved> (**) */
  536.    bit   unpack_prot :1;             /* <reserved> (**) */
  537.  
  538.    short blank_timer;                /* Screen blanker timeout in minutes */
  539.  
  540.    struct _language {               /* Languages available for the users */
  541.        char txt_path[30];            /* Text files directory */
  542.        char descr[24];               /* Description */
  543.        char basename[10];            /* Base file name */
  544.    } language[MAX_LANG];
  545.  
  546.    char  sysop[36];                  /* Sysop name */
  547.    char  system_name[50];            /* System name */
  548.    char  location[50];               /* System's location */
  549.    char  phone[32];                  /* System's phone number */
  550.    char  flags[50];                  /* System's flags */
  551.  
  552.    struct _alias alias[MAX_ALIAS];   /* Network addresses */
  553.  
  554.    char  newareas_create[50];        /* Nodes that can create new areas */
  555.    char  newareas_link[50];          /* Nodes that are linked to new areas */
  556.  
  557.    short line_offset;                /* Task number */
  558.    short min_calls;                  /* <reserved> (**) */
  559.    short vote_limit;                 /* <reserved> (**) */
  560.    short target_up;                  /* <reserved> (**) */
  561.    short target_down;                /* <reserved> (**) */
  562.    byte  vote_priv;                  /* <reserved> (**) */
  563.    byte  max_readpriv;               /* <reserved> (**) */
  564.  
  565.    word  speed_graphics;             /* Speed for ANSI/Avatar graphics */
  566.  
  567.    byte  aftercaller_exit;           /* After caller exit errorlevel */
  568.    byte  aftermail_exit;             /* After mail exit errorlevel */
  569.    short max_connects;               /* <reserved> (**) */
  570.    short max_noconnects;             /* <reserved> (**) */
  571.  
  572.    byte  logon_level;                /* New users level */
  573.    long  logon_flags;                /* New users flags */
  574.  
  575.    char  areachange_key[4];          /* Hotkeys for the change area command */
  576.    char  dateformat[20];             /* Format of the date fields */
  577.    char  timeformat[20];             /* Format fo the time fields */
  578.    char  external_editor[50];        /* External BBS message editor */
  579.  
  580.    struct class_rec class[12];       /* Access level definitions */
  581.  
  582.    char  local_editor[50];           /* Local message editor */
  583.  
  584.    char  QWKDir[40];                 /* QWK mail packer work directory */
  585.    char  BBSid[10];                  /* QWK board name */
  586.    word  qwk_maxmsgs;                /* Maximum number of messages for QWK packets */
  587.  
  588.    char  galileo[30];                /* Clocksynch phone number */
  589.  
  590.    char  norm_okfile[40];            /* Unknow request list */
  591.    char  know_okfile[40];            /* Know request list */
  592.    char  prot_okfile[40];            /* Protected request list */
  593.  
  594.    char  reg_name[36];               /* <reserved> (**) */
  595.    long  betakey;                    /* <unused> */
  596.  
  597.    struct _packers {                /* Mail packers */
  598.        char id[10];                  /* Short name */
  599.        char packcmd[30];             /* Pack commands */
  600.        char unpackcmd[30];           /* unpack commands */
  601.    } packers[10];
  602.  
  603.    struct _nl {                      /* Nodelist database */
  604.        char list_name[14];           /* Nodelist base name */
  605.        char diff_name[14];           /* Nodediff base name */
  606.        char arc_name[14];            /* <reserved> (**) */
  607.    } nl[10];
  608.  
  609.    bit   ansigraphics   :2;          /* 0=No Ansi, 1=Yes, 2=Ask */
  610.    bit   avatargraphics :2;          /* 0=No Avatar, 1=Yes, 2=Ask */
  611.    bit   hotkeys        :2;          /* 0=No hotkeyed menu, 1=Yes, 2=Ask */
  612.    bit   screenclears   :2;          /* 0=No screen clears, 1=Yes, 2=Ask */
  613.  
  614.    bit   newfilescheck  :2;          /* 0=No new files check, 1=Yes, 2=Ask */
  615.    bit   moreprompt     :2;          /* 0=No more prompt, 1=Yes, 2=Ask */
  616.    bit   mailcheck      :2;          /* 0=No mail check, 1=Yes, 2=Ask */
  617.    bit   fullscrnedit   :2;          /* 0=No full screen editor, 1=Yes, 2=Ask */
  618.  
  619.    bit   autozmodem     :1;          /* Terminal mode auto zmodem download */
  620.    bit   avatar         :1;          /* Terminal mode Avatar emulation */
  621.    bit   ask_protocol   :1;          /* 1=Ask default protocol */
  622.    bit   ask_packer     :1;          /* 1=Ask default packer */
  623.  
  624.    short rookie_calls;               /* Number of calls for new users to be a rookie */
  625.  
  626.    char  pre_import[40];             /* Pre import batch */
  627.    char  after_import[40];           /* After import batch */
  628.    char  pre_export[40];             /* Pre export batch */
  629.    char  after_export[40];           /* After export batch */
  630.  
  631.    byte  emulation;                  /* <reserved> (**) */
  632.    char  dl_path[40];                /* Terminal emulator download path */
  633.    char  ul_path[40];                /* terminal emulator upload path */
  634.  
  635.    bit   manual_answer  :1;          /* Manually answers phone */
  636.    bit   limited_hours  :1;          /* Answer only at certain hours */
  637.    bit   solar          :1;          /* <reserved> (**) */
  638.    bit   areafix        :1;          /* 1=Use internal areafix */
  639.    bit   doflagfile     :1;          /* 1=Log semaphores creation/deletion */
  640.    bit   multitask      :1;          /* 1=Multitasking environment */
  641.    bit   ask_alias      :1;          /* 1=Ask for an alias name */
  642.    bit   random_birth   :1;          /* 1=Random birthdate check */
  643.  
  644.    short start_time;                 /* Answer start time in minutes */
  645.    short end_time;                   /* Answer end time in minutes */
  646.  
  647.    char  boxpath[40];                /* User's filebox base directory */
  648.    char  dial_suffix[20];            /* Dialing suffix command */
  649.  
  650.    char  galileo_dial[40];           /* Clocksynch dialing command */
  651.    char  galileo_suffix[40];         /* Clocksynch dialing suffix command */
  652.    char  galileo_init[40];           /* Clocksynch initialization command */
  653.  
  654.    char  areafix_help[40];           /* Areafix's help file name */
  655.    char  alert_nodes[50];            /* Nodes that receives a copy of all areafix response messages */
  656.  
  657.    char  automaint[40];              /* Batch to execute once a day */
  658.  
  659.    byte  min_login_level;            /* Minimum login level */
  660.    long  min_login_flags;            /* Minimul login flags */
  661.    byte  min_login_age;              /* Minimul login age */
  662.  
  663.    char  resync_nodes[50];           /* Nodes to resynch the clock with */
  664.    char  bbs_batch[40];              /* External BBS batch file */
  665.    byte  altx_errorlevel;            /* ALT-X command errorlevel */
  666.  
  667.    char  fax_response[20];           /* FAX response */
  668.    byte  fax_errorlevel;             /* Fax exit errorlevel */
  669.  
  670.    char  dl_counter_limits[4];       /* Download counter delimiters */
  671.  
  672.    char  areas_bbs[40];              /* AREAS.BBS path and file name */
  673.    byte  afx_remote_maint;           /* Areafix level for %FROM command */
  674.    byte  afx_change_tag;             /* Areafix level for #<old>:<new> command */
  675.  
  676.    bit   allow_rescan    :1;         /* 1=Allow rescan of new areas */
  677.    bit   check_city      :1;         /* 1=Check user's city at logon */
  678.    bit   check_echo_zone :1;         /* 1=Check zones in areafix's requests */
  679.    bit   save_my_mail    :1;         /* 1=Save mail directed to the Sysop */
  680.    bit   mail_method     :2;         /* 0=Separate netmail, 1=Net & echomail */
  681.                                      /* in the same packet */
  682.    bit   replace_tear    :2;         /* 0=No, 1=Link unlimited, 2=Link */
  683.                                      /* limited to 35 char, 3=Always */
  684.  
  685.    char  my_mail[40];                /* Path to Sysop's mail */
  686.  
  687.    bit   stripdash       :1;         /* 1=Strip dashes from phone numbers */
  688.    bit   use_iemsi       :1;         /* 1=Allows IEMSI logins */
  689.    bit   newmail_flash   :1;         /* 1=Flashing MAIL active */
  690.    bit   mymail_flash    :1;         /* 1=Flashing PERSONAL active */
  691.    bit   keep_empty      :1;         /* 1=Do not import empty netmail */
  692.    bit   show_missing    :1;         /* 1=Show missing files in file listings */
  693.    bit   random_redial   :1;         /* 1=Redial numbers at random time */
  694.  
  695.    char  override_pwd[20];           /* Mail only override password */
  696.    char  pre_pack[40];               /* Pre-PACK DOS command */
  697.    char  after_pack[40];             /* After-PACK DOS command */
  698.  
  699.    byte  modem_timeout;              /* Modem answer timeout (seconds) */
  700.    byte  login_timeout;              /* User's login timeout (minutes) */
  701.    byte  inactivity_timeout;         /* User's inactivity timeout (seconds) */
  702.  
  703.    struct _altern_prefix {
  704.        char flag[6];                 /* Nodelist flag (HST,V32B,etc.) */
  705.        char prefix[20];              /* Dialing prefix */
  706.    } prefixdial[10];
  707.  
  708.    char  iemsi_handle[36];           /* IEMSI: User's handle name */
  709.    char  iemsi_pwd[20];              /* IEMSI: Password */
  710.    short iemsi_infotime;             /* IEMSI: Seconds to display server */
  711.                                      /*        informations */
  712.  
  713.    bit   iemsi_on        :1;         /* IEMSI: 1=Active, 0=Ignore */
  714.    bit   iemsi_hotkeys   :1;         /* IEMSI: 1=Use hot-keyed menu */
  715.    bit   iemsi_quiet     :1;         /* IEMSI: 1=Do not disturb */
  716.    bit   iemsi_pausing   :1;         /* IEMSI: 1=Pause at end of screen */
  717.    bit   iemsi_editor    :1;         /* IEMSI: 1=Use full screen editor */
  718.    bit   iemsi_news      :1;         /* IEMSI: 1=Display news bulletins */
  719.    bit   iemsi_newmail   :1;         /* IEMSI: 1=Check for new mail */
  720.    bit   iemsi_newfiles  :1;         /* IEMSI: 1=Check for new files */
  721.  
  722.    bit   iemsi_screenclr :1;         /* IEMSI: 1=Send clearing screen codes */
  723.    bit   prot_xmodem     :1;         /* 1=Internal XMODEM active */
  724.    bit   prot_1kxmodem   :1;         /* 1=Internal 1K-XMODEM active */
  725.    bit   prot_zmodem     :1;         /* 1=Internal ZMODEM active */
  726.    bit   prot_sealink    :1;         /* 1=Internal SEALINK active */
  727.  
  728.    char  newkey_code[30];            /* Registration key code (>=2.33) */
  729.    char  tearline[36];               /* Custom tear line */
  730.  
  731.    char  uucp_gatename[20];          /* UUCP gateway name */
  732.    short uucp_zone;                  /* UUCP gateway zone */
  733.    short uucp_net;                   /* UUCP gateway net */
  734.    short uucp_node;                  /* UUCP gateway node */
  735.  
  736.    byte  carrier_mask;               /* Carrier detect bit mask */
  737.    byte  dcd_timeout;                /* Timeout after drop DCD before hangup */
  738.  
  739.    struct {
  740.       char display[20];              /* User's display packer name */
  741.       int  offset;                   /* Offset of the signature id */
  742.       char ident[20];                /* Packer's signature id */
  743.    } packid[10];
  744.  
  745.    char quote_string[5];             /* String to put in front of quoted lines */
  746.    char quote_header[50];            /* Quote text file header */
  747.  
  748.    char tic_help[40];                /* Help file name for TIC processor */
  749.    char tic_alert_nodes[50];         /* Nodes that receives a copy of all TIC response messages */
  750.    char tic_newareas_create[50];     /* Nodes that can create new TIC areas */
  751.    char tic_newareas_link[50];       /* Nodes that are linked to new TIC areas */
  752.    byte tic_remote_maint;            /* TIC level for %FROM command */
  753.    byte tic_change_tag;              /* TIC level for #<old>:<new> command */
  754.  
  755.    int  uucp_point;                  /* UUCP gateway point */
  756.  
  757.    byte filler[963];                 /* Filler to 8192 bytes */
  758. };
  759.  
  760. typedef struct _nodeinfo   /* Struct for the NODES.DAT file */
  761. {
  762.    short zone;                /* Zone number */
  763.    short net;                 /* Net number */
  764.    short node;                /* Node number */
  765.    short point;               /* Point number */
  766.    short afx_level;           /* Areafix level */
  767.    char  pw_session[20];      /* Session password */
  768.    char  pw_areafix[20];      /* Areafix password */
  769.    char  pw_tic[20];          /* <reserved> (**) */
  770.    char  pw_packet[9];        /* Packet password */
  771.    short modem_type;          /* >0=Use alternate dialing string */
  772.    char  phone[30];           /* Override phone number */
  773.    short packer;              /* Packer type */
  774.    char  sysop_name[36];      /* Sysop name */
  775.    char  System[36];          /* System name */
  776.    bit   remap4d      :1;     /* Remap to point */
  777.    bit   can_do_22pkt :1;     /* <reserved> (**) */
  778.    bit   wazoo        :1;     /* WAZOO sessions enabled */
  779.    bit   emsi         :1;     /* EMSI sessions enabled */
  780.    bit   janus        :1;     /* Janus protocol enabled */
  781.    bit   pkt_create   :2;     /* <reserved> (**) */
  782.    char  aka;                 /* >0 Aka number to use when sending mail to this node */
  783.    short tic_level;           /* TIC level */
  784.    long  afx_flags;           /* Areafix flags */
  785.    long  tic_flags;           /* TIC flags */
  786.    char  tic_aka;             /* >0 Aka number to use when sending TIC files */
  787.    char  filler[58];
  788. } NODEINFO;
  789.  
  790. typedef struct _idx_header    /* Header for the NODES.IDX file
  791.  
  792.                               The records are structured as follow:
  793.  
  794.                               <_idx_header>
  795.                                  <_idx_entry> \
  796.                                     ......     |- _idx_header.entry
  797.                                  <_idx_entry> /
  798.                               <_idx_header>
  799.                                  <_idx_entry> \
  800.                                     ......     |- _idx_header.entry
  801.                                  <_idx_entry> /
  802.                               ..............
  803.  
  804.                               Each _idx_entry marks the beginning of a
  805.                               net. When the application founds the net, it
  806.                               must scan the nodelist file from that position
  807.                               to found the node's entry.
  808.                               */
  809. {
  810.    char name[14];             /* Name of the St. Louis nodelist file */
  811.    long entry;                /* Number of _idx_entry that follows */
  812. } NODEHEADER;
  813.  
  814. typedef struct _idx_entry     /* Index record for the NODE.IDX file */
  815. {
  816.    short zone;                /* Zone number */
  817.    short net;                 /* Net number */
  818.    short node;                /* Node number (!= 0 only if related to a
  819.                                  point list */
  820.    long  offset;              /* Offset inside the nodelist file at which the
  821.                                  net zone:net begins */
  822. } NODEINDEX;
  823.  
  824. #define MAXCOST 20
  825.  
  826. typedef struct _translation  /* Structure for the COST.DAT file */
  827. {
  828.    char location[30];        /* Location's name */
  829.    char search[20];          /* International phone prefix */
  830.    char traslate[60];        /* Local phone prefix for that country */
  831.    struct _cost {            /* Cost table */
  832.       short days;            /* Days to apply */
  833.       short start;           /* Starting time in minutes */
  834.       short stop;            /* Ending time in minutes */
  835.       short cost_first;      /* First segment cost */
  836.       short time_first;      /* First segment length in seconds */
  837.       short cost;            /* Extra segments cost */
  838.       short time;            /* Extra segments length in seconds */
  839.       bit   crash    :1;     /* <reserved> */
  840.       bit   direct   :1;     /* <reserved> */
  841.       bit   normal   :1;     /* <reserved> */
  842.    } cost[MAXCOST];
  843. } ACCOUNT;
  844.  
  845. #define MAXDUPES      1000
  846.  
  847. typedef struct _dupecheck     /* Structure for the DUPES.DAT file */
  848. {
  849.    char  areatag[48];        /* Area's echomail tag */
  850.    short dupe_pos;           /* Position of the last record writtin in dupes[] */
  851.    short max_dupes;          /* <unused> */
  852.    long  area_pos;           /* Area record position inside DUPES.DAT file */
  853.    long  dupes[MAXDUPES];    /* Dupes array. Each record is a 32bit CRC */
  854. } DUPERECORD;
  855.  
  856. typedef struct _dupeindex    /* Structure for the DUPES.IDX file */
  857. {
  858.    char  areatag[48];        /* Area's echomail tag */
  859.    long  area_pos;           /* Area record position inside DUPES.DAT file */
  860. } DUPEINDEXRECORD;
  861.  
  862. typedef struct _protocol      /* Structure for the PROTOCOL.DAT file */
  863. {
  864.    char  name[30];            /* Protocol name (user's display) */
  865.    char  hotkey;              /* Command key */
  866.  
  867.    bit   active          :1;  /* 1=Protocol is available */
  868.    bit   batch           :1;  /* 1=The protocol doesn't require the file
  869.                                  name from the user during uploads */
  870.    bit   disable_fossil  :1;  /* 1=Disable the fossil before calling the
  871.                                  protocol */
  872.    bit   change_to_dl    :1;  /* 1=Change to the upload directory before
  873.                                  calling the protocol */
  874.  
  875.    char  dl_command[80];      /* Download command */
  876.    char  ul_command[80];      /* Upload command */
  877.    char  log_name[40];        /* Log name (DSZ format) */
  878.    char  ctl_name[40];        /* Control file name */
  879.    char  dl_ctl_string[40];   /* Download control string */
  880.    char  ul_ctl_string[40];   /* Upload control string */
  881.    char  dl_keyword[20];      /* Download keyword */
  882.    char  ul_keyword[20];      /* Upload keyword */
  883.    short filename;            /* Filename word position */
  884.    short size;                /* Size word position */
  885.    short cps;                 /* CPS word position */
  886. } PROTOCOL;
  887.  
  888.  
  889. /*
  890.     (*)  All the passwords are crypted with a proprietary algorithm for
  891.          system safety. Only known third party authors can request to the
  892.          autor the functions to perform the decryption/encryption.
  893.  
  894.     (**) Reserved fields are fields that aren't used as for now or are bytes
  895.          reserved for future enhancements.
  896. */
  897.  
  898.