home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
OS2OMMM.SRC
/
OMMM.H
< prev
next >
Wrap
Text File
|
1989-06-01
|
13KB
|
371 lines
/***---------------------------------------------------------------------***/
/*-- --*/
/*-- oMMM - The Outbound Matrix Message Masher --*/
/*-- Copyright 1989 by BS Software --*/
/*-- See License for Details --*/
/*-- --*/
/*-- FILENAME: OMMM.H --*/
/*-- --*/
/*-- oMMM Main Header file --*/
/*-- --*/
/*-- Based on the original oMMM, a portion of --*/
/*-- the Opus Computer-Based Conversation System --*/
/*-- Copyright 1986, Wynn Wagner III --*/
/*-- --*/
/***---------------------------------------------------------------------***/
/*-- --*/
/*-- Tabs set at every 4th column --*/
/*-- --*/
/***---------------------------------------------------------------------***/
/*
Polytron Version Control System Comments:
The revision of this file is *** $Revision: 1.40 $ ***
History of changes from 1.30 release version
$Log: C:/OMMM/PROJFILE/OMMM.H_V $
Rev 1.40BP 2 June 1989 20:37:00 Bill Andrus
Public Release Version 1.40BP (OS/2 Protected and Bound)
Rev 1.40 12 Feb 1989 4:57:06 Marshall Presnell
Public Release Version 1.40
Rev 1.36 01 Feb 1989 15:20:16 Marshall Presnell
Solves (hopefully) the year and misformatting problems permanently!
Rev 1.35 31 Jan 1989 0:59:14 Marshall Presnell
oMMM 1.35 Beta Release Version
Rev 1.34 30 Jan 1989 21:41:08 Marshall Presnell
Month and year in packet header now to FTSC specification
Rev 1.33 30 Jan 1989 21:38:18 Marshall Presnell
Multiple file requests from single messages now insert CR/LF in the .REQ file
Rev 1.32 23 Jan 1989 18:00:28 Marshall Presnell
Net number now being inserted into header
Rev 1.31 23 Jan 1989 17:58:14 Marshall Presnell
Output line while scanning messages cleared of debris
Rev 1.30 23 Jan 1989 17:53:54 Marshall Presnell
Public Source Code Release - Version 1.30
*/
/***************************************************************************/
/* */
/* VERSION DECLARATION IS IN THIS FILE */
/* */
/***************************************************************************/
/*
|| Define your environment type here.......
||
|| xMSDOS = MS-DOS/PC-DOS Environment (the default)
||
|| MSC define for Microsoft C 5.0 and above
|| TURBO_C define for Turbo C 1.5 and above
|| WATCOM define for Watcom C 6.0 and above
|| ZTC define for Zortech C 1.07 and above
||
|| xUNIX = Unix Environment
||
|| xANSI = ANSI Standard Environment
||
|| Ask Marshall or Jim if you need an identifier for your environment
|| specific compiles!
*/
/*--------------------------------------------------------------------------*/
/*--- ---*/
/*--- Operating System Definition ---*/
/*--- ---*/
/*--------------------------------------------------------------------------*/
#define xMSDOS
/*#define xUNIX */
/*#define xANSI */
/*--------------------------------------------------------------------------*/
/*--- ---*/
/*--- Manual Compiler Identification and definition ---*/
/*--- ---*/
/*--------------------------------------------------------------------------*/
#define MSC /* Define for Microsoft C */
/*#ifdef IBMC /* IBM C/2 1.1 with SSCANF bug */
/*#define MSC */
/*#endif */
/*#define WATCOM /* Define for Watcom C */
/*--------------------------------------------------------------------------*/
/*--- ---*/
/*--- Automatic Compiler Identification and definition ---*/
/*--- ---*/
/*--------------------------------------------------------------------------*/
#ifdef __ZTC__ /* Automatically defined under Zortech C */
# define ZTC
#endif
#ifdef __TURBOC__ /* Automatically defined under Turbo-C */
# define TURBO_C
#endif
/*--------------------------------------------------------------------------*/
/* System-wide include files */
/*--------------------------------------------------------------------------*/
#include <stdio.h>
#include <dos.h>
#include <process.h>
#include <conio.h>
#include "ommmptyp.h"
/*--------------------------------------------------------------------------*/
/* System-wide macro definitions */
/*--------------------------------------------------------------------------*/
#define VERSION "1.40BP" /* Version Declaration */
#define RETAIN 0xfa97 /* 11111010 10010111 */
#define ADD_STUFF /* This includes the "Add-Verbs"*/
#define OURNET ctlnet[0].net /* Out net address */
#define OURNODE ctlnet[0].node /* Our node address */
#define BUNDLE_VERSION 0x02 /* Bundler version */
#define BUFFER_SIZE 2048 /* Static buffer size */
#define DO_OTHERS 0xffff
#define DO_ALL 0xfffe
#define DO_ILLEGAL 0xfffd
#define DO_OURNET 0xfffc
#define ALIAS_CNT 15 /* number of aka addresses */
#define NORMAL 0 /* Normal file attribute */
#ifdef MSC
# pragma pack(1)
#endif
#ifdef TURBO_C
# define printf cprintf
#endif
#ifdef ZTC
# define cputs puts
#endif
extern unsigned int _memavl();
/*--------------------------------------------------------------------------*/
/* List of message numbers */
/*--------------------------------------------------------------------------*/
struct _msglist {
int number;
struct _msglist * next;
struct _msglist * prev;
};
/*--------------------------------------------------------------------------*/
/* List of nodes */
/*--------------------------------------------------------------------------*/
struct x_node {
int node;
int net;
};
/*--------------------------------------------------------------------------*/
/* What an "address" is as far as oMMM is concerned */
/*--------------------------------------------------------------------------*/
typedef struct s_addr {
int zone;
int net;
int node;
} NETADDRESS;
/*--------------------------------------------------------------------------*/
/* Pending messages structure (for router) */
/*--------------------------------------------------------------------------*/
struct _pending {
unsigned int id1;
unsigned int id2;
unsigned int id3;
FILE * bundle;
struct _pending * next;
struct _msglist * firstmsg;
struct _msglist * lastmsg;
};
/*--------------------------------------------------------------------------*/
/* Message Header (inside a packet) */
/*--------------------------------------------------------------------------*/
struct _msghdr {
int ver;
int orignode;
int destnode;
int orignet;
int destnet;
int attr;
int cost;
};
/*--------------------------------------------------------------------------*/
/* Passworded structure format */
/*--------------------------------------------------------------------------*/
typedef struct {
int zone;
int net;
int node;
char * password;
} PW;
typedef PW * PW_PTR;
/*--------------------------------------------------------------------------*/
/* TIME STAMP */
/*--------------------------------------------------------------------------*/
struct _stamp {
unsigned int date;
unsigned int time;
};
/*--------------------------------------------------------------------------*/
/* Message header */
/*--------------------------------------------------------------------------*/
struct _msg {
char from[36];
char to[36];
char subj[72];
char date[20]; /* ASCII date information */
unsigned int times; /* FIDO<tm>: Number of times read */
unsigned int dest; /* Destination node */
unsigned int orig; /* Origination node number */
unsigned int cost; /* Unit cost charged to send the msg */
unsigned int orig_net; /* Origination network number */
unsigned int dest_net; /* Destination network number */
struct _stamp date_written; /* When user wrote the msg (GMT) */
struct _stamp date_arrived; /* When msg arrived on-line (GMT) */
unsigned int reply; /* Current msg is reply to this msg */
unsigned int attr; /* Attribute (behavior) of message */
unsigned int up; /* Next message in the thread */
};
/*--------------------------------------------------------------------------*/
/* Message attributes */
/*--------------------------------------------------------------------------*/
#define MSGPRIVATE 0x0001 /* private message, 0000 0000 0000 0001 */
#define MSGCRASH 0x0002 /* accept for forwarding 0000 0000 0000 0010 */
#define MSGREAD 0x0004 /* read by addressee 0000 0000 0000 0100 */
#define MSGSENT 0x0008 /* sent OK (remote) 0000 0000 0000 1000 */
#define MSGFILE 0x0010 /* file attached to msg 0000 0000 0001 0000 */
#define MSGFWD 0x0020 /* being forwarded 0000 0000 0010 0000 */
#define MSGORPHAN 0x0040 /* unknown dest node 0000 0000 0100 0000 */
#define MSGKILL 0x0080 /* kill after mailing 0000 0000 1000 0000 */
#define MSGLOCAL 0x0100 /* FidoNet vs. local 0000 0001 0000 0000 */
#define MSGHOLD 0x0200 /* Hold, don't send 0000 0010 0000 0000 */
#define MSGXX2 0x0400 /* STRIPPED by FidoNet<tm> 0000 0100 0000 0000 */
#define MSGFRQ 0x0800 /* file request 0000 1000 0000 0000 */
#define MSGRRQ 0x1000 /* receipt requested 0001 0000 0000 0000 */
#define MSGCPT 0x2000 /* is a return receipt 0010 0000 0000 0000 */
#define MSGARQ 0x4000 /* audit trail requested 0100 0000 0000 0000 */
#define MSGURQ 0x8000 /* update request 1000 0000 0000 0000 */
/*--------------------------------------------------------------------------*/
/* Message packet header */
/*--------------------------------------------------------------------------*/
#define PKTVER 2
#define isFIDO 0 /* Fido<tm>'s product code */
#define isSEADOG 0 /* Seadog<tm>'s product code */
#define isOPUS 5 /* Opus<no_tm>'s product code */
struct _pkthdr {
int orig_node; /* originating node */
int dest_node; /* destination node */
int year; /* 0..99 when packet was created */
int month; /* 1..12 when packet was created */
int day; /* 1..31 when packet was created */
int hour; /* 0..23 when packet was created */
int minute; /* 0..59 when packet was created */
int second; /* 0..59 when packet was created */
int rate; /* destination's baud rate */
int ver; /* packet version */
int orig_net; /* originating network number */
int dest_net; /* destination network number */
char product; /* product type */
char pktjunk; /* extra byte of debris */
char password[8]; /* pickup password */
char extra[24]; /* extra space */
};
/*--------------------------------------------------------------------------*/
/* DTA Structure for findfirst/findnext functions in MISC.C */
/*--------------------------------------------------------------------------*/
struct _dta {
char reserved[21];
char attribute;
unsigned time;
unsigned date;
long size;
char name[13];
};
/*--------------------------------------------------------------------------*/
/* Global variables (too many for my taste) */
/*--------------------------------------------------------------------------*/
#ifdef ADD_STUFF
extern int AddFlag; /* Used by "Add-Verbs" */
#endif
extern int ArcType; /* Used to indicate ZOO compression */
extern unsigned int i;
extern int j;
extern struct _pending * root;
extern struct _dta dta; /* used for findfirst/next */
extern FILE * outfile;
extern char * buffer;
extern FILE * pms;
extern unsigned int mode;
extern NETADDRESS cur;
extern NETADDRESS dest;
extern int our_zone;
extern char message_path[80];
extern char holding_path[80];
extern char pre_route[80];
extern char template[80];
extern unsigned int date_conv;
extern unsigned int keepmsgs;
extern unsigned int pkarc;
extern unsigned int use_gates;
extern unsigned int noforward;
extern char * _months[12];
extern char oldstyle;
/*--------------------------------------------------------------------------*/
/* END OF FILE */
/*--------------------------------------------------------------------------*/