#ifndef _TRANSFORM_H_
#define _TRANSFORM_H_

/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd and Vincent Hayward.	    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

/*---------------------------------------------------------------------------
 *
 * DESCRIPTION:	Internal definitions for the RCCL 'transform' package.
 * 
 * AUTHOR/DATE:	John Lloyd, Fall 1988
 *
 * MODIFICATION HISTORY:
 *
 *--------------------------------------------------------------------------*/

#include "../h/robotTypes.h"
#include "../h/mutex.h"

typedef struct _TRSF {
	/* Block of memory containing the actual transform plus a bunch
	   of system-private support information. */

	TRSF trsf;		/* actual transform */
	struct _TRSF *source;   /* parent addr (planning task space) */
	struct _TRSF *parent;   /* parent addr (control task space) */

	struct _TRSF *prev;	/* links for putting transform into lists */
	struct _TRSF *next;

	int timestamp;		/* last update time */
	int (*fxn)();		/* modifying function */

	/* the following fields are used in the global transform only */

	MUTEX mutex;		/* read and write mutex flag */
	int arg;		/* function argument */
	int manipOwner;		/* code of updating manip */
	int taskOwner;		/* transform being updated by the task */
	int cpu;		/* cpu the transform is allocated on */
	int mark;		/* reference marking */
	int magic;		/* transform magic number */

	char *name;		/* diagnostic use only */
} TRSF_DESC;

#define TRSF_MAGIC		0x11223344

#define TRSF_GETFXN(t)		(((TRSF_DESC*)(t))->fxn)
#define TRSF_GETDESC(t)		((TRSF_DESC*)(t))

extern TRSF *doAllocTrans();

#endif
