#ifndef GENERAL_H
#define GENERAL_H
#include <stdio.h>
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef NULL
#define NULL 0L
#endif
#define ON 1
#define OFF 0
#ifndef byte
typedef unsigned char byte; // 8 Bit
#endif
#ifndef word
typedef unsigned short int word; // 16 Bit
#endif
#ifndef ints
typedef signed int ints; // 16 Bit
#endif
#ifndef dword
typedef unsigned long int dword; // 32 Bit
#endif
#ifndef bool
#ifdef __MSDOS__
typedef unsigned char bool;
#else
//#ifndef _G_HAVE_BOOL
//#ifndef __CYGWIN32__
//typedef unsigned char bool;
//#endif
//#endif
#endif
#endif
#define mword(lo, hi) ((byte)(lo)+(((byte)(hi))<<8))
#define hi(x) (((x)>>8)&0xff)
#define lo(x) ((x)&0xff)
char upcase(char letter);
char dncase(char letter);
void upstring(char *s);
void dnstring(char *s);
void num2str(dword num, char *str, byte letters);
dword str2crc(const char *s);
dword str2icrc(const char *s);
byte checkjoker(const char *mask, const char *filename, bool casei=FALSE);
void stripendingblanks(char *s);
void memsetw(void *s, word c, size_t n);
void memcpyw(void *dest, const void *src, size_t n);
int readconfigline(FILE *infile, char *line1, char *line2, word maxlen);
bool filecopy(FILE *file, FILE *target, dword size);
bool filecopy(int handle, int target, dword size);
byte decodehex(char hex);
byte decodehex(char hex1, char hex2);
//#ifndef min
//#define min(a, b) ((a)<(b)?(a):(b))
//#define max(a, b) ((a)>(b)?(a):(b))
//#endif
#define strmaxcpy(dest, src, maxlen) ((strncpy(dest, src, maxlen))[maxlen]=0)
#define createdir(path) (bdosptr(0x39, path, 0)==-1?1:0)
#ifndef __MSDOS__
#ifndef WIN32
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif
#endif
#ifdef WIN32
#define snprintf _snprintf
#endif
#ifdef __MSDOS__
#define TIMER (*((int far *)0x0000046c))
#endif
#endif
syntax highlighted by Code2HTML, v. 0.9.1