home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / OS2OMMM.SRC / OMMM.H < prev    next >
Text File  |  1989-06-01  |  13KB  |  371 lines

  1. /***---------------------------------------------------------------------***/
  2. /*--                                                                     --*/
  3. /*--               oMMM - The Outbound Matrix Message Masher             --*/
  4. /*--                     Copyright 1989 by BS Software                     --*/
  5. /*--                         See License for Details                     --*/
  6. /*--                                                                     --*/
  7. /*--                            FILENAME: OMMM.H                         --*/
  8. /*--                                                                     --*/
  9. /*--                          oMMM Main Header file                      --*/
  10. /*--                                                                     --*/
  11. /*--                 Based on the original oMMM, a portion of             --*/
  12. /*--               the Opus Computer-Based Conversation System             --*/
  13. /*--                     Copyright 1986, Wynn Wagner III                 --*/
  14. /*--                                                                     --*/
  15. /***---------------------------------------------------------------------***/
  16. /*--                                                                     --*/
  17. /*--                    Tabs set at every 4th column                     --*/
  18. /*--                                                                     --*/
  19. /***---------------------------------------------------------------------***/
  20.  
  21. /*
  22.     Polytron Version Control System Comments:
  23.  
  24.     The revision of this file is *** $Revision:   1.40    $ ***
  25.  
  26.     History of changes from 1.30 release version
  27.  
  28.     $Log:    C:/OMMM/PROJFILE/OMMM.H_V  $
  29.  
  30.       Rev 1.40BP 2 June 1989 20:37:00    Bill Andrus
  31.    Public Release Version 1.40BP (OS/2 Protected and Bound)
  32.  
  33.       Rev 1.40     12 Feb 1989  4:57:06    Marshall Presnell
  34.    Public Release Version 1.40
  35.  
  36.       Rev 1.36     01 Feb 1989 15:20:16    Marshall Presnell
  37.    Solves (hopefully) the year and misformatting problems permanently!
  38.  
  39.       Rev 1.35     31 Jan 1989  0:59:14    Marshall Presnell
  40.    oMMM 1.35 Beta Release Version
  41.  
  42.       Rev 1.34     30 Jan 1989 21:41:08    Marshall Presnell
  43.    Month and year in packet header now to FTSC specification
  44.  
  45.       Rev 1.33     30 Jan 1989 21:38:18    Marshall Presnell
  46.    Multiple file requests from single messages now insert CR/LF in the .REQ file
  47.  
  48.       Rev 1.32     23 Jan 1989 18:00:28    Marshall Presnell
  49.    Net number now being inserted into header
  50.  
  51.       Rev 1.31     23 Jan 1989 17:58:14    Marshall Presnell
  52.    Output line while scanning messages cleared of debris
  53.  
  54.       Rev 1.30     23 Jan 1989 17:53:54    Marshall Presnell
  55.    Public Source Code Release - Version 1.30
  56.  
  57. */
  58.  
  59. /***************************************************************************/
  60. /*                                                                           */
  61. /*                     VERSION DECLARATION IS IN THIS FILE                   */
  62. /*                                                                           */
  63. /***************************************************************************/
  64.  
  65. /*
  66. ||    Define your environment type here.......
  67. ||
  68. ||    xMSDOS    = MS-DOS/PC-DOS Environment (the default)
  69. ||
  70. ||          MSC        define for Microsoft C 5.0 and above
  71. ||          TURBO_C    define for Turbo C 1.5 and above
  72. ||          WATCOM    define for Watcom C 6.0 and above
  73. ||          ZTC        define for Zortech C 1.07 and above
  74. ||
  75. ||    xUNIX = Unix Environment
  76. ||
  77. ||    xANSI = ANSI Standard Environment
  78. ||
  79. ||    Ask Marshall or Jim if you need an identifier for your environment
  80. ||    specific compiles!
  81. */
  82.  
  83. /*--------------------------------------------------------------------------*/
  84. /*---                                                                     ---*/
  85. /*--- Operating System Definition                                         ---*/
  86. /*---                                                                     ---*/
  87. /*--------------------------------------------------------------------------*/
  88.  
  89. #define xMSDOS
  90. /*#define    xUNIX    */
  91. /*#define    xANSI    */
  92.  
  93. /*--------------------------------------------------------------------------*/
  94. /*---                                                                     ---*/
  95. /*--- Manual Compiler Identification and definition                      ---*/
  96. /*---                                                                     ---*/
  97. /*--------------------------------------------------------------------------*/
  98.  
  99. #define MSC             /* Define for Microsoft C                            */
  100. /*#ifdef IBMC              /* IBM C/2 1.1 with SSCANF bug                        */
  101. /*#define MSC                                                                    */
  102. /*#endif                                                                        */
  103.  
  104. /*#define    WATCOM            /* Define for Watcom C                                */
  105.  
  106. /*--------------------------------------------------------------------------*/
  107. /*---                                                                     ---*/
  108. /*--- Automatic Compiler Identification and definition                     ---*/
  109. /*---                                                                     ---*/
  110. /*--------------------------------------------------------------------------*/
  111.  
  112. #ifdef __ZTC__            /* Automatically defined under Zortech C            */
  113. #    define ZTC
  114. #endif
  115.  
  116.  
  117. #ifdef __TURBOC__        /* Automatically defined under Turbo-C                */
  118. #    define TURBO_C
  119. #endif
  120.  
  121. /*--------------------------------------------------------------------------*/
  122. /* System-wide include files                                                */
  123. /*--------------------------------------------------------------------------*/
  124.  
  125. #include  <stdio.h>
  126. #include  <dos.h>
  127. #include  <process.h>
  128. #include  <conio.h>
  129. #include  "ommmptyp.h"
  130.  
  131. /*--------------------------------------------------------------------------*/
  132. /* System-wide macro definitions                                            */
  133. /*--------------------------------------------------------------------------*/
  134.  
  135. #define VERSION         "1.40BP"          /* Version Declaration          */
  136.  
  137. #define RETAIN            0xfa97            /* 11111010 10010111            */
  138.  
  139. #define ADD_STUFF                        /* This includes the "Add-Verbs"*/
  140.  
  141. #define OURNET            ctlnet[0].net    /* Out net address                */
  142. #define OURNODE         ctlnet[0].node    /* Our node address             */
  143. #define BUNDLE_VERSION    0x02            /* Bundler version                */
  144. #define BUFFER_SIZE     2048            /* Static buffer size            */
  145.  
  146. #define DO_OTHERS        0xffff
  147. #define DO_ALL            0xfffe
  148. #define DO_ILLEGAL        0xfffd
  149. #define DO_OURNET        0xfffc
  150. #define ALIAS_CNT        15                /* number of aka addresses        */
  151.  
  152. #define NORMAL            0                /* Normal file attribute        */
  153.  
  154. #ifdef    MSC
  155. #    pragma    pack(1)
  156. #endif
  157.  
  158. #ifdef    TURBO_C
  159. #    define    printf    cprintf
  160. #endif
  161.  
  162. #ifdef    ZTC
  163. #    define    cputs    puts
  164. #endif
  165.  
  166. extern unsigned int _memavl();
  167.  
  168. /*--------------------------------------------------------------------------*/
  169. /* List of message numbers                                                    */
  170. /*--------------------------------------------------------------------------*/
  171.  
  172. struct _msglist {
  173.     int                 number;
  174.     struct _msglist *    next;
  175.     struct _msglist *    prev;
  176. };
  177.  
  178. /*--------------------------------------------------------------------------*/
  179. /* List of nodes                                                            */
  180. /*--------------------------------------------------------------------------*/
  181.  
  182. struct x_node {
  183.     int                 node;
  184.     int                 net;
  185. };
  186.  
  187. /*--------------------------------------------------------------------------*/
  188. /* What an "address" is as far as oMMM is concerned                         */
  189. /*--------------------------------------------------------------------------*/
  190.  
  191. typedef struct s_addr {
  192.     int                 zone;
  193.     int                 net;
  194.     int                 node;
  195. }    NETADDRESS;
  196.  
  197. /*--------------------------------------------------------------------------*/
  198. /* Pending messages structure (for router)                                    */
  199. /*--------------------------------------------------------------------------*/
  200.  
  201. struct _pending {
  202.     unsigned int        id1;
  203.     unsigned int        id2;
  204.     unsigned int        id3;
  205.     FILE *                bundle;
  206.     struct _pending *    next;
  207.     struct _msglist *    firstmsg;
  208.     struct _msglist *    lastmsg;
  209. };
  210.  
  211. /*--------------------------------------------------------------------------*/
  212. /* Message Header (inside a packet)                                         */
  213. /*--------------------------------------------------------------------------*/
  214.  
  215. struct _msghdr {
  216.     int                 ver;
  217.     int                 orignode;
  218.     int                 destnode;
  219.     int                 orignet;
  220.     int                 destnet;
  221.     int                 attr;
  222.     int                 cost;
  223. };
  224.  
  225. /*--------------------------------------------------------------------------*/
  226. /* Passworded structure format                                                */
  227. /*--------------------------------------------------------------------------*/
  228.  
  229. typedef struct {
  230.     int                 zone;
  231.     int                 net;
  232.     int                 node;
  233.     char *                password;
  234. }    PW;
  235.  
  236. typedef PW * PW_PTR;
  237.  
  238. /*--------------------------------------------------------------------------*/
  239. /* TIME STAMP                                                                */
  240. /*--------------------------------------------------------------------------*/
  241.  
  242. struct _stamp {
  243.     unsigned int        date;
  244.     unsigned int        time;
  245. };
  246.  
  247. /*--------------------------------------------------------------------------*/
  248. /* Message header                                                            */
  249. /*--------------------------------------------------------------------------*/
  250.  
  251. struct _msg {
  252.     char            from[36];
  253.     char            to[36];
  254.     char            subj[72];
  255.     char            date[20];        /* ASCII date information                */
  256.     unsigned int    times;            /* FIDO<tm>: Number of times read        */
  257.     unsigned int    dest;            /* Destination node                     */
  258.     unsigned int    orig;            /* Origination node number                */
  259.     unsigned int    cost;            /* Unit cost charged to send the msg    */
  260.  
  261.     unsigned int    orig_net;        /* Origination network number            */
  262.     unsigned int    dest_net;        /* Destination network number            */
  263.  
  264.     struct _stamp    date_written;    /* When user wrote the msg (GMT)        */
  265.     struct _stamp    date_arrived;    /* When msg arrived on-line (GMT)        */
  266.  
  267.     unsigned int    reply;            /* Current msg is reply to this msg     */
  268.     unsigned int    attr;            /* Attribute (behavior) of message        */
  269.     unsigned int    up;             /* Next message in the thread            */
  270. };
  271.  
  272. /*--------------------------------------------------------------------------*/
  273. /* Message attributes                                                        */
  274. /*--------------------------------------------------------------------------*/
  275.  
  276. #define MSGPRIVATE    0x0001    /* private message,         0000 0000 0000 0001 */
  277. #define MSGCRASH    0x0002    /* accept for forwarding    0000 0000 0000 0010 */
  278. #define MSGREAD     0x0004    /* read by addressee        0000 0000 0000 0100 */
  279. #define MSGSENT     0x0008    /* sent OK (remote)         0000 0000 0000 1000 */
  280. #define MSGFILE     0x0010    /* file attached to msg     0000 0000 0001 0000 */
  281. #define MSGFWD        0x0020    /* being forwarded            0000 0000 0010 0000 */
  282. #define MSGORPHAN    0x0040    /* unknown dest node        0000 0000 0100 0000 */
  283. #define MSGKILL     0x0080    /* kill after mailing        0000 0000 1000 0000 */
  284. #define MSGLOCAL    0x0100    /* FidoNet vs. local        0000 0001 0000 0000 */
  285. #define MSGHOLD     0x0200    /* Hold, don't send         0000 0010 0000 0000 */
  286. #define MSGXX2        0x0400    /* STRIPPED by FidoNet<tm>    0000 0100 0000 0000 */
  287. #define MSGFRQ        0x0800    /* file request             0000 1000 0000 0000 */
  288. #define MSGRRQ        0x1000    /* receipt requested        0001 0000 0000 0000 */
  289. #define MSGCPT        0x2000    /* is a return receipt        0010 0000 0000 0000 */
  290. #define MSGARQ        0x4000    /* audit trail requested    0100 0000 0000 0000 */
  291. #define MSGURQ        0x8000    /* update request            1000 0000 0000 0000 */
  292.  
  293. /*--------------------------------------------------------------------------*/
  294. /* Message packet header                                                    */
  295. /*--------------------------------------------------------------------------*/
  296.  
  297. #define PKTVER        2
  298.  
  299. #define isFIDO        0        /* Fido<tm>'s product code                      */
  300. #define isSEADOG    0        /* Seadog<tm>'s product code                    */
  301. #define isOPUS        5        /* Opus<no_tm>'s product code                   */
  302.  
  303. struct _pkthdr    {
  304.     int     orig_node;        /* originating node                             */
  305.     int     dest_node;        /* destination node                             */
  306.     int     year;            /* 0..99  when packet was created                */
  307.     int     month;            /* 1..12  when packet was created                */
  308.     int     day;            /* 1..31  when packet was created                */
  309.     int     hour;            /* 0..23  when packet was created                */
  310.     int     minute;         /* 0..59  when packet was created                */
  311.     int     second;         /* 0..59  when packet was created                */
  312.     int     rate;            /* destination's baud rate                      */
  313.     int     ver;            /* packet version                                */
  314.     int     orig_net;        /* originating network number                    */
  315.     int     dest_net;        /* destination network number                    */
  316.     char    product;        /* product type                                 */
  317.     char    pktjunk;        /* extra byte of debris                         */
  318.     char    password[8];    /* pickup password                                */
  319.     char    extra[24];        /* extra space                                    */
  320. };
  321.  
  322. /*--------------------------------------------------------------------------*/
  323. /* DTA Structure for findfirst/findnext functions in MISC.C                 */
  324. /*--------------------------------------------------------------------------*/
  325.  
  326. struct _dta   {
  327.     char        reserved[21];
  328.     char        attribute;
  329.     unsigned    time;
  330.     unsigned    date;
  331.     long        size;
  332.     char        name[13];
  333. };
  334.  
  335. /*--------------------------------------------------------------------------*/
  336. /* Global variables (too many for my taste)                                 */
  337. /*--------------------------------------------------------------------------*/
  338.  
  339. #ifdef ADD_STUFF
  340.     extern int                AddFlag;    /* Used by "Add-Verbs"              */
  341. #endif
  342. extern int                    ArcType;    /* Used to indicate ZOO compression */
  343. extern unsigned int         i;
  344. extern int                    j;
  345. extern struct _pending *    root;
  346. extern struct _dta            dta;        /* used for findfirst/next            */
  347. extern FILE *                outfile;
  348. extern char *                buffer;
  349. extern FILE *                pms;
  350. extern unsigned int         mode;
  351. extern NETADDRESS               cur;
  352. extern NETADDRESS               dest;
  353. extern int                    our_zone;
  354. extern char                 message_path[80];
  355. extern char                 holding_path[80];
  356. extern char                 pre_route[80];
  357. extern char                 template[80];
  358.  
  359. extern unsigned int         date_conv;
  360. extern unsigned int         keepmsgs;
  361. extern unsigned int         pkarc;
  362. extern unsigned int         use_gates;
  363. extern unsigned int         noforward;
  364. extern char *                _months[12];
  365. extern char                 oldstyle;
  366.  
  367. /*--------------------------------------------------------------------------*/
  368. /*                                  END OF FILE                                */
  369. /*--------------------------------------------------------------------------*/
  370.  
  371.