/* InstallationSupportExtras.c */
/* Copyright (C) 1991 by Xerox Corporation.  All rights reserved. */
/* Russ Atkinson, March 20, 1991 1:12:52 am PST */

typedef unsigned word;
typedef struct {word x,y;} pair;
typedef struct {word x,y,z;} triple;
typedef word (*procDesc)();

extern void XR←ImportProc();
extern void XR←ExportProc();
extern word XR←GetTypeIndex();
extern void XR←RaiseSignal();
extern void XR←RaiseError();
extern void XR←TypeIndex();

extern void XR←ImportInterfaceX (formal, actual, type, slots)
	word formal, actual, type, slots;
	{
	/* DUMMY for now until we can use actual */
	XR←ImportInterface(formal, type, slots);
	}

extern void XR←ImportProgramX (formal, actual, type, link)
	word formal, actual, type, link;
	{
	/* DUMMY for now until we can use actual */
	XR←ImportInterface(formal, type, link);
	}
	
extern void XR←ExportInterfaceX (formal, actual, type, slots)
	word formal, actual, type, slots;
	{
	/* DUMMY for now until we can use actual */
	XR←ExportInterface(formal, type, slots);
	}
	
extern void XR←ImportProcS (irLocal, encoded)
	word irLocal, encoded;
	{
	word unitsOut = encoded / (256*256*256);
	word unitsIn = (encoded / (256*256)) % 256;
	word index = (encoded / (256)) % 256;
	word nargs = encoded % 256;
	XR←ImportProc(irLocal, index, unitsOut, unitsIn, nargs);
	}
	
extern void XR←ExportProcS (irLocal, expr, encoded)
	word irLocal, expr, encoded;
	{
	word unitsOut = encoded / (256*256*256);
	word unitsIn = (encoded / (256*256)) % 256;
	word index = (encoded / (256)) % 256;
	word nargs = encoded % 256;
	XR←ExportProc(irLocal, index, expr, unitsOut, unitsIn, nargs);
	}
	
extern void XR←RaiseSignal0 (sig)
	word sig;
	{
	XR←RaiseSignal(sig, 0, 0);
	}

extern void XR←RaiseSignal1 (sig, arg1)
	word sig, arg1;
	{
	word v = arg1;
	XR←RaiseSignal(sig, 0, &v);
	}

extern void XR←RaiseSignal2 (sig, arg1, arg2)
	word sig, arg1, arg2;
	{
	pair v;
	v.x = arg1;
	v.y = arg2;
	XR←RaiseSignal(sig, 0, &v);
	}

extern void XR←RaiseSignal3 (sig, arg1, arg2, arg3)
	word sig, arg1, arg2;
	{
	triple v;
	v.x = arg1;
	v.y = arg2;
	v.z = arg3;
	XR←RaiseSignal(sig, 0, &v);
	}

extern void XR←RaiseError0 (err)
	word err;
	{
	XR←RaiseError(err, 0);
	}

extern void XR←RaiseError1 (err, arg1)
	word err, arg1;
	{
	word v = arg1;
	XR←RaiseError(err, &v);
	}

extern void XR←RaiseError2 (err, arg1, arg2)
	word err, arg1, arg2;
	{
	pair v;
	v.x = arg1;
	v.y = arg2;
	XR←RaiseError(err, &v);
	}

extern void XR←RaiseError3 (err, arg1, arg2, arg3)
	word err, arg1, arg2, arg3;
	{
	triple v;
	v.x = arg1;
	v.y = arg2;
	v.z = arg3;
	XR←RaiseError(err, &v);
	}

extern word XR←CallProc0 (pd)
	procDesc pd;
	{
	return ((*pd)(pd));
	}

extern word XR←CallProc1 (arg1, pd)
	procDesc pd; word arg1;
	{
	return ((*pd)(arg1, pd));
	}

extern word XR←CallProc2 (arg1, arg2, pd)
	procDesc pd; word arg1, arg2;
	{
	return ((*pd)(arg1, arg2, pd));
	}

extern word XR←CallProc3 (arg1, arg2, arg3, pd)
	procDesc pd; word arg1, arg2, arg3;
	{
	return ((*pd)(arg1, arg2, arg3, pd));
	}

extern word XR←CallProc4 (arg1, arg2, arg3, arg4, pd)
	procDesc pd; word arg1, arg2, arg3, arg4;
	{
	return ((*pd)(arg1, arg2, arg3, arg4, pd));
	}

extern word XR←CallProc5 (arg1, arg2, arg3, arg4, arg5, pd)
	procDesc pd; word arg1, arg2, arg3, arg4, arg5;
	{
	return ((*pd)(arg1, arg2, arg3, arg4, arg5, pd));
	}

extern word XR←GetTypeIndexS (ts) word ts; {
	return (XR←GetTypeIndex(ts, 0, 0));
	}