home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / bbsfiles / flkn6-4.arj / STRUCTS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-12  |  9.6 KB  |  326 lines

  1. /*
  2. ** This file defines common structures used by the INFO*SHARE
  3. ** message system.  These structures define file formats, user
  4. ** accounting information, and other items.
  5. **
  6. */
  7.  
  8. /* this structure identifies a record in the user account file */
  9.  
  10. #define uidlen 32
  11. #define maxchans 17
  12. #define outbufsiz 8192
  13. #define obufsz 2048
  14. #define ibufsz 1024
  15.  
  16. struct acct_rec
  17. {
  18.     char acctname[uidlen];        /* user name - null until it is claimed */
  19.     char realname[uidlen];        /* user's REAL name */
  20.     char street[32];            /* billing address */
  21.     char city[22];
  22.     char state[16];
  23.     char zip[12];
  24.     char phone[16];                /* billing phone number             */
  25.     char pword[12];                /* user - supplied password */
  26.     char compter;                /* single character computer type */
  27.     char linfed;                /* y=line feed reqd, n=not reqd */
  28.     unsigned log_date;            /* date/time of last logon     */
  29.     unsigned log_time;
  30.     unsigned creat_date;        /* date account was created */
  31.     unsigned expire_date;        /* date account expires */
  32.     unsigned birthday;            /* date field for birthday */
  33.     unsigned linlen;            /* number of bytes per screen line */
  34.     unsigned dloads;            /* number of files downloaded */
  35.     unsigned long logons;            /* number of logons this month */
  36.     unsigned long totlogons;         /* total number of logons */
  37.     unsigned long acctime;           /* total minutes of connect time this month */
  38.     unsigned long totacctime;        /* total minutes of connect time */
  39.     unsigned acmsgdate[64][2];  /* date/time of last message read  */
  40.     int priv_level;                /* this is the privilege level. */
  41.     /* system, unrestricted, restricted */
  42.     int verbose;                /* 1 = verbose, 0 = short */
  43.     unsigned long tlcf_time;
  44.     long msgskipflags[2];
  45.     long msgreadflags[2];
  46.     long msgpostflags[2];
  47.     long dloadflags;
  48.     long uploadflags;
  49.     long accessflags;
  50.     unsigned uploads;
  51.     char acctnum[10];            /* account number - optional */
  52.     char a_comment[30];
  53.     int dayacctime;                /* how long has he been on today ? */
  54.     int sex;
  55.     long bulreadtime;          /* date/time of last time bulletins read*/
  56.     unsigned AUTO1_date;        /* reserved fields! */
  57.     unsigned AUTO1_time;        /* do not disturb! */
  58.     unsigned prev_logdate;
  59.     unsigned prev_logtime;        /* date and time of previous log on */
  60.     char wphone[16];
  61.     int  lines_per_page;        /* normally 24 */
  62.     char unused_space_2[38];    /* for future expansion */
  63. };
  64.  
  65. /* current record size is 600 */
  66.  
  67. #define priv_system 5
  68. #define priv_sysop 4
  69. #define priv_unrestricted 3
  70. #define priv_demo 2
  71. #define non_paying 1
  72. #define priv_restricted 0
  73.  
  74. #define userbioaccess 1L
  75. #define tlcf_access 2L
  76. #define postemailaccess 4L
  77. #define filessaccess 8L
  78. #define subopaccess 16L
  79. #define sysopaccess 32L
  80. #define networkaccess 64L
  81. #define submenuaccess 128L
  82.  
  83. /* the next structure is used by the software to manage
  84.    each account while the user is on-line.
  85.    current menu information and other pertinent information
  86.    is kept in this structure.
  87. */
  88.  
  89. struct user_rec
  90. {
  91.     int u_stat;                    /* primary state - indicates current
  92.                                  * subsystem */
  93.     int u_stat2;                /* sub-state - function within subsystem */
  94.     int u_eltime;                /* elapsed time from logon */
  95.     unsigned int u_work1;        /* general purpose work variable */
  96.     unsigned int u_work2;        /* general purpose work variable */
  97.     int u_btusts;                /* current breakthru status */
  98.     int u_paged;                /* user paged flag */
  99.     int u_prflvl;                /* profanity level */
  100.     int visitor;                /* is this just a visitor ? */
  101.     int u_ansi;                    /* 1 =supports ansi graphics, 0 = not */
  102.     int u_idletime;                /* the amount of time to allow this user 2b
  103.                                  * idle */
  104.     int door_inq;                /* doors input queue number    user->door */
  105.     int door_outq;                /* doors output queue number   door->user */
  106.     char doors_id[10];            /* doors program ID string */
  107.     int u_doortcb;
  108.     int u_privateflag;
  109.     int u_timeroff;                /* activity timer disabled ? */
  110.     unsigned int u_ticker;        /* 1-second ticker for user programs */
  111.     int u_work3;                /* used by editor */
  112.     int u_curmenu;              /* menu number for return in main menu */
  113.     int connecttimer;
  114.     int idletimer;
  115.     char unused_u_space[48];    /* for future expansion, so doors won't
  116.                                  * change */
  117. };
  118.  
  119. #define vbsmsg 1
  120. #define shortmsg 0
  121.  
  122. struct timestamp
  123. {
  124.     unsigned ts_date;            /* bit fields for date */
  125.     unsigned ts_time;            /* bit fields for time */
  126.     int ts_year;
  127.     int ts_month;
  128.     int ts_day;
  129.     int ts_hour;
  130.     int ts_minute;
  131.     char ts_str[15];
  132. };
  133.  
  134. struct em_rec
  135. {
  136.     char em_acct[uidlen];        /* addressee */
  137.     char em_origid[uidlen];        /* sender's id */
  138.     char em_subject[40];        /* email subject */
  139.     char em_filename[14];        /* for attached files */
  140.     unsigned em_date;
  141.     unsigned em_time;
  142.     int em_new;                    /* 1 if this is new message */
  143.     char em_msg[4096];            /* 50 lines, 80 chars (approx) */
  144. };
  145.  
  146. struct u_em_rec
  147. {
  148.     char addr[uidlen];
  149.     unsigned long cur_pos;
  150.     int readnew;
  151.     char cur_list[20];
  152.     char subject[40];
  153.     unsigned long pos_list[20];
  154.     char fname[14];
  155.     int pos_list_count;
  156.     int list_indx;
  157.     int receipt;                /* return receipt requested ? */
  158. };
  159.  
  160. struct mail_list_rec
  161. {
  162.     char owner_id[uidlen];
  163.     char listname[20];
  164.     int entrycount;
  165.     char list_entry[64][32];
  166. };
  167.  
  168. /*
  169. ** Record structure for download file listings.
  170. */
  171.  
  172. struct dloadrec
  173. {
  174.     unsigned dl_btype;            /* the id number of the file */
  175.     char dl_name[14];            /* full name, spaces allowed */
  176.     long int dl_filesize;        /* file size */
  177.     char dl_acctid[32];            /* who uploaded it */
  178.     unsigned dl_date;            /* when was it uploaded */
  179.     unsigned dl_lastdl;            /* last time it was downloaded */
  180.     unsigned dl_count;            /* how many times it was dloaded */
  181.     char dl_password[8];        /* password for file, if req'd */
  182.     char dl_info[800];            /* variable text to describe file */
  183. };
  184.  
  185.  
  186. struct windows
  187. {
  188.     char w_name[20];
  189.     int x_max;
  190.     int y_max;
  191.     int last_x;
  192.     int x_pos;
  193.     int y_pos;
  194. };
  195.  
  196. #define maxresp 32
  197. #define msg_fixed_size 70
  198. #define msg_resp_size  40
  199.  
  200. struct msg_record
  201. {
  202.     unsigned msgfolder;
  203.     unsigned msgnum;
  204.     unsigned last_update[2];
  205.     char subject[60];
  206.     unsigned respcnt;
  207.     struct resp_rec
  208.     {
  209.         char orig_id[uidlen];
  210.         unsigned post_time[2];
  211.         unsigned long msgsequence;  /* uniquely identifies text */
  212.     }   resp[maxresp];
  213. };
  214.  
  215. #define xascii 0
  216. #define xmodem 1
  217. #define ACK 06
  218. #define EOT 04
  219. #define NAK 21
  220. #define SOH 01
  221. #define CAN 24
  222. #define STX 02
  223.  
  224. #define ufp xfer[who].xf_fp
  225.  
  226. /*
  227. ** The flags are defined as follows -
  228. **   bit  0   is eot-sent flag
  229. **   bit  1   is file-open flag
  230. */
  231.  
  232. #define eot_sent 1
  233. #define crcflag  2
  234. #define file_open 4
  235. #define sendcflag 8
  236. #define ymodemflag 16
  237. #define no_save -1
  238.  
  239. typedef int (*faddr) ();        /* function address */
  240.  
  241. struct xfer_rec
  242. {
  243.     FILE *xf_fp;
  244.     int xf_state;
  245.     int xf_flags;                /* various flags */
  246.     int xf_tocnt;                /* timeout counter */
  247.     int xf_count;
  248.     int xf_errcnt;
  249.     int xf_protocol;
  250.     int xf_block;                /* block number */
  251.     int xf_blsize;                /* block size gotten from file */
  252.     long xf_pos;                /* position in file */
  253.     faddr xf_ulcompfunc;        /* function to execute when upload done */
  254.     int bye_when_done;
  255.     char xf_name[40];
  256.     char xf_xkwd[4][40];        /* keywords to use in search */
  257. };
  258.  
  259. #define FALSE 0
  260. #define TRUE 1
  261.  
  262. /*
  263. ** State definitions for infoshare programs.
  264. */
  265.  
  266. #define st_idle           0     /* line not active */
  267. #define st_logon          1     /* ring detected, user logging on */
  268. #define st_newacct        2     /* new account processing */
  269. #define st_main           3     /* main menu has been shown */
  270. #define st_questionaire   4     /* answering questionaire */
  271. #define st_dload          5     /* download subsystem */
  272. #define st_extern         6     /* executing a 'doors' program   */
  273. #define st_email          7     /* electronic mail subsystem */
  274. #define st_edit           8     /* editting account information */
  275. #define st_tlcf           9     /* teleconferencing */
  276. #define st_editor        10     /* user is in editor */
  277. #define st_msg           11     /* user is in message base */
  278. #define st_exitting      12     /* logging off */
  279. #define st_feedback      13     /* leaving feedback */
  280. #define st_chat          14     /* chatting with sysop           */
  281. #define st_system        15     /* system users menu */
  282. #define st_system_kill   16     /* knocking a user off the system */
  283. #define st_system_disp   17     /* displaying user info */
  284. #define st_system_edit   18     /* editting a user account */
  285. #define st_upload        19     /* uploading a file */
  286. #define st_bios          20     /* reading/editting biography files */
  287. #define st_logoff        21     /* user is receiving logoff message */
  288. #define st_acctsetup     22     /* providing info for packaged account */
  289. #define st_frecv         23     /* file transfer - receiving */
  290. #define st_fsend         24     /* file transfer - sending   */
  291. #define st_userlist      25     /* user list                */
  292. #define st_network       26     /* dial-out on this line */
  293. #define st_bulletin      27     /* user is reading buleltins */
  294.  
  295. /*
  296. ** Operator (system console) state definitions
  297. */
  298.  
  299. #define opr_st_idle    0
  300. #define opr_st_quit    1
  301. #define opr_st_sendmenu   2
  302. #define opr_st_send    3
  303. #define opr_st_brcast  4
  304. #define opr_st_monitor 5
  305. #define opr_st_util    6
  306. #define opr_st_fback   7
  307. #define opr_st_hangup  8
  308. #define opr_st_tlcf    9
  309.  
  310. #define opr_st_send2   10
  311. #define opr_st_tlcf2   11
  312.  
  313. #define opr_st_showtlcf 12
  314. #define opr_st_sim0 13          /* simulating channel 0 */
  315. #define opr_st_sim1 14
  316. #define opr_st_acctdel 15
  317. #define opr_st_acctmyn 16
  318.  
  319. #define opr_st_acctedit  17
  320. #define opr_st_record    18
  321. #define opr_st_util3     19
  322. #define opr_st_dialout   20
  323. #define opr_st_dialout2  21
  324.  
  325.  
  326.