#ifndef __RELOCATE_H
#define __RELOCATE_H

#include "vdi.h"

/*
 * Structure definitions
 */
typedef struct _Prgheader {
   short magic;
   long  tsize;
   long  dsize;
   long  bsize;
   long  ssize;
   long  reserved;
   long  flags;
   short relocflag;
} Prgheader;

typedef struct _Funcs {
	void (*copymem)(void *s, void *d, int n);
	const char *(*next_line)(const char *ptr);
	const char *(*skip_space)(const char *ptr);
	const char *(*get_token)(const char *ptr, char *buf, int n);
	int  (*equal)(const char *str1, const char *str2);
	int  (*length)(const char *text);
	void (*copy)(const char *src, char *dest);
	void (*cat)(const char *src, char *dest);
	int  (*numeric)(char ch);
	void (*error)(const char *text1, const char *text2);
	char *(*malloc)(long size, int type);			/* Uses Mxalloc if possible */
	void (*free)(char *);
	void (*puts)(char *);
	void (*ltoa)(char *, long);
	int  (*apply)(int (*)(int));
} Funcs;

typedef struct _Vars {
	short	count;
} Vars;

typedef struct _Access {
	Funcs	funcs;
	Vars  vars;	
} Access;

typedef struct _Locator {
	char 	magic[10];
	short version;
	int 	(*init)(Access *, Virtual *, char *);
} Locator;

typedef struct _Registered {
	int (*func)(int);
} Registered;

#endif
