#ifdef __STDC__ #define ANSI_HDRS 1 #define ANSI_C 1 #endif #ifdef ANSI_C #ifdef APOLLO #define DIR_H #else #include #include #include #endif #endif #ifdef __GNUC__ #include #endif #ifdef ANSI_HDRS #define ANSI_PARMS( x ) x #else #define ANSI_PARMS( x ) () #endif #ifndef ANSI_C #define VOIDPARM #else #define VOIDPARM void #endif #include #include #include #include #include #include #include #ifdef DIR_H #include #define dirent direct #else #include #endif #if SCO #define SCO #endif #ifdef SCO #define MAXPATHLEN PATHSIZE + 1 #endif #include /* To make programs "prettier"... */ /* Logical functions made readable */ #ifndef boolean typedef int boolean; #endif #ifndef FALSE #define FALSE (0) #endif #ifndef TRUE #define TRUE (1) #endif #define IS == #define ISNT != #define AND && #define OR || #define NOT ! /* Bitwise functions made readable */ typedef unsigned char byte; typedef unsigned int bits; #define AND_ & #define OR_ | #define XOR_ ^ #define SHR_ >> #define SHL_ << #define CMP1S_ ~ /* Assorted character constants */ #define NULLTERM '\0' #define TAB '\t' #define EOL '\n' #define CR '\r' #define BELL '\7' #define SLASH '/' #define SPACE ' ' #define QUOTE '"' #define DOT '.' #define DASH '-' #define COMMA ',' #define POUNDSIGN '#' #define EQUALSIGN '=' #define ZERO '0' #define ONE '1' #define TWO '2' #define THREE '3' #define FOUR '4' #define FIVE '5' #define SIX '6' #define SEVEN '7' #define EIGHT '8' #define NINE '9' #define alphaNumeric( c ) \ ( ( ( c >= ZERO ) AND ( c <= NINE ) ) OR \ ( ( c >= 'A' ) AND ( c <= 'Z' ) ) OR \ ( ( c >= 'a' ) AND ( c <= 'z' ) ) ) /* Structure for a directory listing (DE). Structure allows linked lists. */ /* This listing can either span multiple levels, or be a file. */ typedef struct DirEntry DirEntry; struct DirEntry { char *name; DirEntry *nDEDE; DirEntry *lDEDE; }; #define gDEName( dl ) ( dl )->name #define rDEName( dl, val ) gDEName( dl ) = copyString( val ) #define nDE( dl ) ( dl )->nDEDE #define lDE( dl ) ( dl )->lDEDE #define UNKNOWN 0 #define GIF 1 #define JFIF 2 #define PM 3 #define PBM 4 #define XBM 5 #define PIC 6 #define USERKEY "USER=" #define USERALIASKEY "USERALIAS=" #define USERHOSTKEY "USERHOST=" #define SIGPATHKEY "SIGPATH=" #define SITEHOSTKEY "SITEHOST=" #define SITEPATHKEY "SITEPATH=" extern int errno; extern char *reasonForFail; extern boolean DEBUG_PROC; extern boolean noConfirm; extern boolean verboseOutput; extern char *tmpDir, *theFile, *partRoot, *scriptRoot, *fileRoot, *fileName; extern char *fileStats, *picRes; extern int fileType, topDECnt; extern DirEntry *topDE; extern char *anonUser; extern char *anonSite; extern char *anonHost; extern char *anonPath; extern char *anonSig; extern char *anonAlias; extern char *anonFile; extern char *anonOther; /* From xbfile.c... */ extern VOIDPARM getFileStats ANSI_PARMS( ( VOIDPARM ) ); /* From xbutil.c... */ extern char *copyString ANSI_PARMS( ( char *val ) ); extern VOIDPARM setString ANSI_PARMS( ( char **str, char *val ) ); extern char *addString ANSI_PARMS( ( char *str1, char *str2, char *str3 ) ); extern char *stringIn ANSI_PARMS( ( char *a, char *b ) ); extern char *getAnswer ANSI_PARMS( ( VOIDPARM ) ); extern boolean getRootName ANSI_PARMS( ( VOIDPARM ) ); extern boolean verifyEnvPath ANSI_PARMS( ( char *var ) ); extern char *descPath ANSI_PARMS( ( VOIDPARM ) ); extern boolean fileExists ANSI_PARMS( ( char *name ) ); extern VOIDPARM dirList ANSI_PARMS( ( char *pattern ) ); extern char *shellResult ANSI_PARMS( ( char *cmd, int *result ) ); extern VOIDPARM closePipes ANSI_PARMS( ( VOIDPARM ) ); extern boolean openTopShell ANSI_PARMS( ( VOIDPARM ) ); extern boolean closeTopShell ANSI_PARMS( ( VOIDPARM ) ); extern int lineRead ANSI_PARMS( ( FILE *src, char dst[] ) ); extern char *utilInPath ANSI_PARMS( ( char *util, boolean shouldBitch ) ); extern VOIDPARM suggest ANSI_PARMS( ( char *util, char *switches ) ); /* From xbanon.c... */ extern char *anonFileParse ANSI_PARMS( ( VOIDPARM ) ); extern char *anonDataFilePath ANSI_PARMS( ( VOIDPARM ) ); extern VOIDPARM addAnonHeader ANSI_PARMS( ( FILE *fd, int part ) );