home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
asm_programming
/
MJRDEVEL.ARC
/
MESSAGE.H
< prev
next >
Wrap
Text File
|
1989-03-17
|
14KB
|
226 lines
/* Header file for use with messages: E-Mail and SIGs */
/* Copyright (C) 1988 GALACTICOMM, Inc. All Rights Reserved. */
#define SIGSTT 9 /* SIG and E-Mail state codes - don't change */
#define EMLSTT 11 /* unless also changing module struct names */
#define NSOFAR 20 /* number of quickscan SIGs per user */
#define MAXSIG 200 /* max number of SIGs total */
#define MXKWLN 25 /* max keyword group length (incl. '\0')*/
#define NQSKWG 5 /* number of quickscan keyword groups */
extern
struct sofars { /* highest-msg-#-so-far quickscan info */
char signo; /* SIG number in quickscan */
long msgno; /* highest msg # read so far in SIG */
} *sfrptr; /* scratch ptr for scanning thru sofars */
extern
struct qscfg { /* quickscan/config per-user data */
char userid[UIDSIZ]; /* master key for lookups */
struct sofars sofars[NSOFAR]; /* highest-msg-#-so-far quickscan info */
char access[MAXSIG/2]; /* SIG access bits, 4/SIG/user (packed) */
char qskwds[NQSKWG][MXKWLN]; /* quickscan keywords */
char cursig; /* current SIG */
char flags; /* SIG-related account attributes */
char spare[338-337]; /* spare space, decrease when adding on */
} *sopqsc, /* singular SYSOP/SIG-Op scratch area */
*qscfgs, /* base ptr to dynam allocated array */
*qscptr; /* ptr to current user's qscfgs entry */
extern
struct usracc *sopusa; /* singular SYSOP/SIG-Op scratch acct */
extern
char dftnlv[MAXSIG/2], /* default non-live SIG access bits */
dftliv[MAXSIG/2], /* default live SIG access bits */
maxnlv[MAXSIG/2]; /* maximum non-live SIG access bits */
/* SIG access level codes */
#define NOAXES 0 /* no access */
#define RDAXES 2 /* read access */
#define DLAXES 4 /* download access */
#define WRAXES 6 /* write access */
#define ULAXES 8 /* upload access */
#define COAXES 10 /* Co-Op access */
#define OPAXES 12 /* (ret from readac() when SIG-Op) */
#define SYAXES 14 /* (ret from readac() when Sysop) */
#define NOTSET 15 /* not set yet (use default) */
/* SIG-related account attributes */
#define QSCFGD 1 /* quickscan has been configured */
#define TPCSIZ 41 /* topic field size (including the '\0')*/
#define AXTSIZ 33 /* aux topic size (including the '\0')*/
#define TXTSIZ 1921 /* messge text size (including the '\0')*/
/* esigs.dat message database key id's */
#define TOTOPIC 0 /* compos "to" User-ID + topic field */
#define FROMNUM 1 /* compos "from" User-ID + msg number */
#define TONUM 2 /* compos "to" User-ID + msg number */
#define FIRSTM 0L /* "first message" code, for searches */
#define LASTM 0x7FFFFFFFL /* "last message" code, for searches */
struct message {
long msgno; /* message number */
char from[UIDSIZ]; /* message originator */
char to[UIDSIZ]; /* recipient User-ID or SIG name */
char topic[TPCSIZ]; /* main topic, editable, carried over */
char auxtpc[AXTSIZ]; /* auxillary topic (reply to #88888, */
/* fw by Aaaaaaaaa, cc: of #99999) */
int crdate; /* message creation date */
int crtime; /* message creation time of day */
int nreply; /* number of times replied to */
char flags; /* message/attachment flag bits */
char text[TXTSIZ]; /* message text */
char spare[2034-2026]; /* spare space, decrease when adding on */
};
/* message flag bits */
#define ISSHDR 0x01 /* message is SIG header format */
#define RECREQ 0x10 /* return-receipt requested when read */
#define INDRCT 0x20 /* "indirect" att, direct has filespec*/
#define FILATT 0x40 /* file is attached to this message */
#define APPVED 0x80 /* file attached is ok to download */
struct sighdr {
long msgno; /* message number */
char from[UIDSIZ]; /* SIG-Op User-ID */
char to[UIDSIZ]; /* SIG name (with leading slash) */
char topic[TPCSIZ]; /* SIG short description */
char signo; /* SIG number */
int nmsgs; /* number of messages in the SIG */
int nfiles; /* number of files in the SIG */
int nw4app; /* number of files waiting for apprvl */
char ispare[AXTSIZ-13]; /* a little internal spare space here */
int dfnlv; /* default non-live access setting */
int dfliv; /* default live access setting */
int mxnlv; /* maximum non-live access setting */
int crdate; /* SIG creation date */
int crtime; /* SIG creation time of day */
int nreply; /* number of times replied to */
char flags; /* settable SIG options */
char text[TXTSIZ]; /* SIG introductory msg (w/"thoughts") */
char spare[2034-2026]; /* spare space, decrease when adding on */
};
#define SIGIDC '/' /* SIG identifier character */
#define NOSIG 255 /* code for absence-of-SIG */
#define UPLTYPS 10 /* addend for upload protocol type codes*/
#define NPREVS 5 /* previous-msg file pos's maintained */
#define FSPSIZ 64 /* filespec size (including the '\0') */
struct esgusr { /* esigs user data */
long fpos; /* message file position */
long prethr; /* fpos in effect b4 starting to thread */
int keynum; /* key number in use */
FILE *fp; /* attachment/source file handle */
FILE *fpout; /* destination file handle when copying */
int fxftyp; /* file transfer method type code */
int blknum; /* block number in progress */
int lstsiz; /* DL: last block size UL: last byte count */
long curpos; /* current position within download file */
int (*whndun)(); /* esgutl when-done "return address" */
struct message msg; /* esigs message data block */
int ccount; /* carbon copy count toward maximum allowed*/
char dftinp; /* default input letter if CR hit */
char usigno; /* SIG number that user is in, or NOSIG */
int sigtck; /* "ticks" (credits) per SIG msg in cursig */
int sattck; /* "ticks" (credits) per upload in cursig */
char keywds[MXKWLN]; /* keywords being searched for (input stg) */
int sflags; /* run-time control flags */
long prvpos[NPREVS]; /* previous-message file positions */
int pvpidx; /* index position now active in prvpos[] */
};
/* run-time control flags */
#define SCNNXT 1 /* scan direction is forward ("next") */
#define SCNCIS 2 /* scan continuing in SIG (!starting anew) */
#define SCNQUI 4 /* quickscan in progress */
#define SCNCIQ 8 /* continuing quickscan (!first qs pass) */
#define SCN4AT 16 /* scanning for attachments (download) */
#define SCN4UA 32 /* scanning for unapproved attachments */
#define SCNKWD 64 /* scanning (searching) for keywords */
#define SCN2LT 128 /* scanning (listing) in 2-line-title mode */
#define SCNFTX 256 /* scanning (listing) in full-text mode */
#define CPYIPG 512 /* file-copy operation in progress */
#define esgptr ((struct esgusr *)vdaptr) /* volatile data pointer casts */
#define esgarr(u) ((struct esgusr *)(vdarea+((long)(u)*vdasiz)))
extern
struct compos { /* composite user-id/msg# for searches */
char userid[UIDSIZ]; /* user-id to or from, or SIG name */
long msgno; /* message number */
} compos;
extern
struct sigdat { /* ram-resident SIG data tables */
char sigop[UIDSIZ]; /* User-ID of SIG-Op */
char signam[UIDSIZ]; /* SIG name */
char descrp[TPCSIZ]; /* SIG short description */
char signo; /* SIG number */
int nmsgs; /* number of messages in the SIG */
int nfiles; /* number of files in the SIG */
int nw4app; /* number of files waiting for approval */
} *sigdat, /* base ptr to dynamically allocated array */
*sdtptr; /* scratch ptr for scanning thru sigdat */
extern
FILE *esgmb; /* esigs named-message file block ptr */
extern
BTVFILE *esgbb, /* esigs btrieve message file block ptr */
*qscbb; /* esigs quickscan/config btrieve file ptr */
extern
BTVFILE *accbb; /* user account btrieve file block pointer */
extern
long filen; /* length of attachment found, from opnatt() */
extern
int esgstt; /* current/new usrptr->substt hold register */
extern
char *accstg[]; /* names of access levels */
char *attfs(), /* form attachment filespec for current msg */
*attfsp(), /* form just primary (non-INDRCT) filespec */
*attfsd(), /* form destination filespec for copy/fwd */
*attfsu(), /* utility for use by attfsp() and attfsd() */
*formax(), /* form auxillary topic phrase, using msg # */
*axtstg(), /* aux topic string, suitable for "%s" fill */
*emlsig(), /* string "E-Mail" or "SIG", dep'ing on cntxt*/
*findkw(); /* find quickscan keyword list in qscfg table*/
struct qscfg *getqsc(); /* get ptr to a user's config data */
#define FOUND 1 /* return values for CYCLE-mediated activity */
#define KEEPON -1
#define DONE 0
/*--- OPTIONS FROM ESIGS.MSG ---*/
extern
int emllif, /* lifetime of an E-Mail message, in days */
nlveml, /* flag: may non-live users write E-Mail? */
nlveat, /* flag: may non-live users make attachments?*/
nlvrrr, /* flag: may non-live users read RRR msgs? */
emltck, /* "ticks" (credits) eaten per E-Mail msg */
eattck, /* "ticks" (credits) eaten per attachment */
rrrtck, /* "ticks" (credits) eaten per return receipt*/
ednaud, /* Do audit trail entry per E-Mail download? */
eupaud; /* Do audit trail entry per E-Mail upload? */
extern
int nsigs, /* number of SIGs allowed for */
sigccr, /* default SIG credit consumption rate */
siglif, /* default lifetime of a SIG message, in days*/
sigtck, /* default "ticks" (credits) per SIG msg */
sattck, /* default "ticks" (credits) per file upload */
sdnaud, /* Do audit trail entry per SIG download? */
supaud, /* Do audit trail entry per SIG upload? */
sopmhd; /* allow SIG-Ops to modify SIG headers? */
extern
char dftsig[]; /* default SIG for new users etc. */