/*************************************************************************
**
** mach.h
** Copyright (c) 1995,1996 Daniel Kahlin <tlr@stacken.kth.se>
**
******/


/*************************************************************************
**
** public function declarations
**
******/
void mach_startup(void);
void mach_noerror(void);
int mach_rdargs(char *thetemplate, LONG *array, char *params);
void mach_closeall(int ret);
char *mach_getargstr(void);

struct mach_matchstruct *mach_parsepattern(char *patternstr);
void mach_unparsepattern(struct mach_matchstruct *mms);
int mach_matchpattern(struct mach_matchstruct *mms, char *str);

struct mach_dirlock *mach_lockdir(char *path);
void mach_unlockdir(struct mach_dirlock *mdl);
struct mach_direntry *mach_examine(struct mach_dirlock *mdl);

char *mach_getpath(char *fileref, char *path, int maxsize);
void mach_addpart(char *path, char *name, int size);

#define MACH_FILENAMELEN	108
#define MACH_PATHLEN	108
#define MACH_FILEREFLEN	255


/*************************************************************************
**
** internal declarations
**
******/
#ifdef	AMIGA_VERSION

#include <dos/dos.h>
#include <dos/dosextens.h>

#define BOLD "\x9b" "0;1" "\x6d"
#define ITALICS "\x9b" "0;3" "\x6d"
#define NORMAL "\x9b" "0" "\x6d"

extern struct RDArgs *rdargs;
extern struct Process *myprocess;

#endif



/*************************************************************************
**
** mach definitions
**
******/
struct mach_matchstruct {
	char iswild;
#ifdef AMIGA_VERSION
	char parsedpattern[512];
#endif
};

struct mach_direntry {
#ifdef AMIGA_VERSION
	LONG	size;
	char *name;
	LONG	type;
#endif
};

struct mach_dirlock {
#ifdef AMIGA_VERSION
	BPTR	lock;
	struct FileInfoBlock fib;
	struct mach_direntry direntry;
#endif
};



/*************************************************************************
**
** Configuration definitions
**
******/

#define CONFIG_FILE	"PROGDIR:Over5.config"

/*
** configuration structure!
*/
struct O5Config {
	int device;				/* cbm device number */
#ifdef AMIGA_VERSION
	char *serdevice;	/* AMIGA */
	int serunitnum;		/* AMIGA */
#endif
};

#define CT_NUMBER	0x01
#define CT_STRING	0x02

struct ConfigTable {
	char *ct_name;
	int	ct_type;
	ULONG *ct_dest;
};

extern struct ConfigTable configtable[];
