home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
XGRP_000.SZH
/
XGROUP.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-21
|
11KB
|
354 lines
/* XGROUP.H file */
/* I hate a lot of little header files. Guess you'll figure that out. */
#ifdef TSC
#define OS2 _os2
#define _fastcall
#define _pascal pascal
#define _cdecl cdecl
#define elif elsif
#define searchpath(x) (x)
#define MAXDIR 256
#define SH_DENYNONE SH_DENYNO
#define INCL_DOS
#include <os2kernl.h>
#elif __TURBOC__
#define _fastcall pascal
#define _pascal pascal
#define _cdecl cdecl
#define SH_DENYNO SH_DENYNONE
/* you're on your own handling the OS/2 stuff... */
#else
#ifdef DEBUG
#define _fastcall _pascal
#endif
#define searchpath(x) (x)
#define MAXDIR 256
#define SH_DENYNONE SH_DENYNO
#define INCL_DOS
#include <os2.h>
#endif
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/locking.h>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <process.h>
#include <share.h>
#include <stdarg.h>
#include <conio.h>
#include <errno.h>
typedef unsigned int word;
typedef unsigned int bit;
typedef unsigned char byte;
typedef unsigned long ulong;
typedef unsigned char uchar;
/*------------------------------------------------------*/
/* FIDO Message attributes (attr) */
/*------------------------------------------------------*/
#define MSGPRIVATE 0x0001 /* private message, */
#define MSGCRASH 0x0002 /* accept for forwarding */
#define MSGREAD 0x0004 /* read by addressee */
#define MSGSENT 0x0008 /* sent OK (remote) */
#define MSGFILE 0x0010 /* file attached to msg */
#define MSGFWD 0x0020 /* being forwarded */
#define MSGORPHAN 0x0040 /* unknown dest node */
#define MSGKILL 0x0080 /* kill after mailing */
#define MSGLOCAL 0x0100 /* FidoNet vs. local */
#define MSGXX1 0x0200 /* */
#define MSGXX2 0x0400 /* STRIPPED by FidoNet<tm> */
#define MSGFRQ 0x0800 /* file request */
#define MSGRRQ 0x1000 /* receipt requested */
#define MSGCPT 0x2000 /* is a return receipt */
#define MSGARQ 0x4000 /* audit trail requested */
#define MSGURQ 0x8000 /* update request */
/*------------------------------------------------------*/
/* XBBS Message header */
/*------------------------------------------------------*/
struct __xmsg__ {
char from[36];
char to[36];
char subj[64];
word o_point;
word length; /* Length of message */
ulong start; /* Starting postition in text file */
char date[20];
word times; /* Number of times read */
word dest; /* Destination node */
word orig; /* Origination node number */
word cost; /* Unit cost charged to send the message */
word orig_net; /* Origination network number */
word dest_net; /* Destination network number */
char indate[4]; /* import date (YMD(null)) */
word m_attr; /* Extra attributes */
word d_zone; /* Destination zone */
word o_zone; /* Origination zone */
word attr; /* Attribute (behavior) of the message */
word d_point;
};
typedef struct __xmsg__ XMSG;
/* These apply to m_attr */
#define MSGDELETED 0x0001 /* deleted message, */
#define MSGANON 0x0002 /* anonymous message */
#define MSGECHO 0x0004 /* unmoved echo message */
#define MSGNET 0x0008 /* unmoved net message */
#define MSGHOLD 0x0010 /* file attached to msg */
#define MSGHOST 0x0020 /* being forwarded */
#define MSGSCANNED 0x0040 /* already scanned */
#define MSGKEEP 0x0080 /* don't delete */
#define MSGTREATED 0x0100 /* soft cr's & lf's removed */
#define MSGPACKED 0x0200 /* message LZSS compressed */
#define MSGGSCAN 0x0400 /* message scanned by groupmail */
#define MSGRSCAN 0x0800 /* message scanned by RFC0822 */
/*
#define 0x1000 all reserved
#define 0x2000
#define 0x4000
*/
#define MSGTAGGED 0x8000 /* used by offline readers */
/* Packet header structure per FSC-0045 */
struct __pkthdr__ {
unsigned int
onode,
dnode,
opoint,
dpoint;
char
zeros[8];
unsigned int
subver,
version,
onet,
dnet;
char
product,
rev_lev,
password[8];
unsigned int
ozone,
dzone;
char
odomain[8],
ddomain[8];
long
specific;
};
typedef struct __pkthdr__ PKTHDR;
struct __oldpkthdr__ { /* got this from JoHo */
word
orig_node, /* originating node */
dest_node, /* destination node */
year, /* 1989 - nnnnn */
month,
day,
hour,
minute,
second,
rate, /* unused */
ver, /* 2 */
orig_net, /* originating net */
dest_net; /* destination net */
byte
product,
rev_lev, /* revision level */
password[8];
word
qm_orig_zone,
qm_dest_zone;
byte
domain[8];
word
orig_zone, /* originating zone */
dest_zone, /* destination zone */
orig_point, /* originating point */
dest_point; /* destination point */
long
pr_data;
};
typedef struct __oldpkthdr__ OLDPKTHDR;
struct __dupes__ {
long msgidcrc;
long serialno;
};
typedef struct __dupes__ DUPES;
#define MAXDUPES 1000
struct __address__ {
word zone,net,node,point;
char *domain;
struct __address__ *next;
};
typedef struct __address__ ADDR;
struct __groups__ { /* groupmail area control structure */
char *id;
ADDR *uplink;
word areano;
word imported;
word exported;
word forwarded;
word numdays;
char *password;
bit style: 2;
bit reserved: 6;
struct __groups__ *next;
};
typedef struct __groups__ GROUP;
struct __controls__ { /* miscellaneous control bits */
bit xbbsos2: 1;
bit tinysbs: 1;
bit noforward: 1;
bit nolocalfor: 1;
bit partialok: 1;
bit fullok: 1;
bit forfiles: 1;
bit noassholes: 1;
bit assexport: 1;
bit nodupes: 1;
bit keeppath: 1;
bit keepsbs: 1;
bit keepdupes: 1;
bit delbaddate: 1;
bit keepnoforwards: 1;
bit allowbadareas: 1;
bit reserved: 8;
};
typedef struct __controls__ CONTROLS;
struct __assholes__ {
char *name;
unsigned int from: 1;
unsigned int to: 1;
unsigned int del: 1;
unsigned int noin: 1;
unsigned int subj: 1;
unsigned int res: 3;
time_t expire;
struct __assholes__ *next;
};
typedef struct __assholes__ ASSHOLE;
struct __route__ {
char *mask;
char *archive;
char type;
ADDR *addr;
struct __route__ *next;
};
typedef struct __route__ ROUTE;
struct __sb__ {
word net,node;
};
typedef struct __sb__ SB;
struct __echorec__ {
char *tag;
word areano;
ADDR *addr;
word imported;
word exported;
word forwarded;
char *password;
struct __echorec__ *next;
};
typedef struct __echorec__ ECHOREC;
struct __to_names__ {
char *to;
char *prgname;
ADDR *addr;
bit msg: 1;
bit route: 1;
bit prog: 1;
bit reserved: 5;
struct __to_names__ *next;
};
typedef struct __to_names__ TONAMES;
/* global function definitions */
char * _fastcall assign (char *s,char *p);
int _fastcall parse_addr (char **p, ADDR *r,ADDR *rr);
int _fastcall guess_rest (ADDR *r, ADDR *m);
ADDR * _fastcall best_guess (ADDR *r,ADDR *m);
int _fastcall config (char *configfile);
char * _fastcall skip_white (char *p);
char * _fastcall skip_nonwhite (char *p);
char * _fastcall to_delim (char *p, char *delim);
char * _fastcall fgetsx (char *str,unsigned int num,unsigned int handle);
unsigned int _cdecl ffprintf (unsigned int handle,char *string,...);
char * _fastcall rstrip (char *a);
char * _fastcall lstrip (char *a);
char * _fastcall stripcr (char *a);
char * _fastcall strip_trail_bksl (char *a);
int _fastcall ext_reserved (char *ext);
char * _fastcall unpack_msg (char **hold);
char * _fastcall pack_msg (char *hold,XMSG *msg);
void _fastcall group_import_mail (void);
void _fastcall group_export_mail (void);
void _fastcall echo_import_mail (void);
void _fastcall echo_export_mail (void);
void _fastcall net_export_mail (void);
SB * _fastcall sort_sb (SB *s);
int _fastcall add_tiny_seenbys (SB *s,int x,ECHOREC *echos,
ADDR *pktaddr,int tsb);
SB * _fastcall parse_seenbys (char *sbs,ECHOREC *echos,
ADDR *pktaddr);
SB * _fastcall make_tinysbs (ECHOREC *echo,ADDR *pktaddr);
long _fastcall spit_seenbys (SB *s,int handle);
SB * _fastcall parse_oldpath (char *sbs);
long _fastcall spit_oldpath (SB *s,int handle);
ADDR * _fastcall parse_newpath (char *npth);
long _fastcall spit_newpath (SB *s,ADDR *addr,ADDR *maddr,int handle);
void _fastcall free_addresses (ADDR *top);
int _fastcall switch_to (char *dir);
int _fastcall switch_back (void);
void _fastcall free_assholes (void);
void _fastcall load_assholes (word areano);
void _fastcall rewrite_assholes (word areano);
long _fastcall crc32blk (char *str,int blklen);
long _fastcall crc32str(char *str,int casesensitive);
void _fastcall free_dupes (void);
void _fastcall load_dupes (word areano);
void _cdecl logf (char *szFormat, ...);
int _fastcall do_request_or_attach (XMSG *msg,ADDR *addr);
int _fastcall my_unlink(char *fname);
int _fastcall my_rename(char *oname,char *nname);
void _fastcall my_free (void *ptr);
/* END OF FILE: xgroup.h */