#ifndef LIBRARIES_PATCHTAGS_H
#define LIBRARIES_PATCHTAGS_H
/*****************************************************************************/
/*
**	Filename:	libraries/patchtags.h
**	Release:	3.0
**	Date:		04.05.94
**
**	definition of patch.library tags
**
**	(C) Copyright 1993/94 Stefan Fuchs
**	All Rights Reserved
*/
/*****************************************************************************/

#ifndef	UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif


/*----------------------------------------------------------------------------*/
/* I: InstalPatchTags() */
/* R: RemovePatchTags() */
/* F: FindPatchTags()   */
/* S: SetPatch()        */
/* G: GetPatch()        */

#define PATT_TagBase		TAG_USER + 0x5000


#define PATT_LibraryName	PATT_TagBase+0	/* (STRPTR) (I) */
						/* Pointer to a library name */
#define PATT_DeviceName		PATT_TagBase+1	/* (STRPTR) (I) */
						/* Pointer to a device name */
#define PATT_LibraryBase	PATT_TagBase+2	/* (struct Library *) (I) */
						/* Pointer to a library, device or resource base */
						/* structure */

#define PATT_LibVersion		PATT_TagBase+3	/* (ULONG) (I) Default: (any version) */
						/* Versionnumber for exec.library/OpenLibrary */
#define PATT_Reserved01		PATT_TagBase+4	/* as it says */
#define PATT_DevFlags		PATT_TagBase+5  /* (ULONG) (I) Default: NULL */
						/* Flags for exec.library/OpenDevice() */
#define	PATT_DevUnit		PATT_TagBase+6	/* (ULONG) (I) Default: NULL */
						/* Unit for exec.library/OpenDevice() */

#define PATT_PatchName		PATT_TagBase+7	/* (STRPTR) (IF) Default: No ID-String */
						/* pointer to an IDString for the patch */
						/* (BOOL) (G) Default: False */
						/* Return the name of the patch */
#define	PATT_Priority		PATT_TagBase+8	/* (BYTE) (I) Default: NULL */
						/* priority (-127...+126) of the patch */
						/* Positive priorities indicate that the patchcode will be run before the Original */
						/* Negative priorities indicate that the patchcode will be run after the Original */
						/* the priority NULL (default) indicates that the patchcode will be run instead of the Original */
#define PATT_NewCodeSize	PATT_TagBase+9	/* (ULONG) (I) Default: NULL */
						/* size of code in bytes starting at funcEntry */
#define PATT_Result2		PATT_TagBase+10	/* (APTR) (IG) */
						/* pointer to longword for errorcodes */
						/* (see patch.h) */

#define	PATT_CreateTaskList	PATT_TagBase+11	/* (ULONG) (IS) (V3) */
						/* Creates a TaskList of the given type */
						/* (TL_TYPE_INCLUDE / TL_TYPE_EXCLUDE)  */
						/* (see patch.h) */
#define PATT_DeleteTaskList	PATT_TagBase+12	/* (BOOL) (IS) (V3) Default: False */
						/* Deletes any exisiting TaskList */
						/* This will be done implicitly, when a patch is removed */
#define	PATT_AddTaskID		PATT_TagBase+13	/* (struct Task *) (IS) (V3) */
						/* Adds a task address to the patch TaskList */
#define	PATT_AddTaskName	PATT_TagBase+14	/* (STRPTR) (IS) (V3) */
						/* Adds a task of the given name to address to the */
						/* patch TaskList */
#define PATT_Reserved02		PATT_TagBase+15	/* as it says */
#define PATT_RemTaskID		PATT_TagBase+16	/* (struct Task *) (IS) (V3) */
						/* Removes a task address from the patch TaskList */
#define	PATT_RemTaskName	PATT_TagBase+17	/* (STRPTR) (IS) (V3) */
						/* Removes a task of the given name to address from the */
						/* patch TaskList */
#define PATT_TaskListType	PATT_TagBase+18	/* (BOOL) (G) (V3) Default: False */
						/* Get the type of the TaskList */
#define PATT_TaskList		PATT_TagBase+19 /* (BOOL) (G) (V3) Default: False */
						/* Return a taglist containing all TaskIDs and TaskNames attached */
						/* to a patch */

#define	PATT_TimeOut		PATT_TagBase+30	/* (ULONG) (R) Default: NULL */
						/* The number of ticks (1/50 seconds) the function */
						/* should keep trying to remove the patch, if another */
						/* task is running in the patchcode. */
#define PATT_DelayedExpunge	PATT_TagBase+31	/* (BOOL) (R) Default: TRUE */
						/* If this tag is set to TRUE and a */
						/* non-patch.library patch was installed */
						/* after the patch.library patch for a */
						/* specific library function the specified */
						/* patch will nevertheless be removed. */
						/* BUT some resources will still be kept */
						/* allocated by patch.library (e.g.: the */
						/* Library Offset Vector will not be restored */
						/* to it's old state). */
						/* Patch.library will try to deallocate */
						/* those resources automatically, if the */
						/* system is getting low on memory or */
						/* if you call a patch.library function */
						/* that removes or installs patches. */

/*----------------------------------------------------------------------------*/
/* types for PATT_CreateTaskList tag: */
#define TL_TYPE_INCLUDE	1	/* Type of TaskList is include */
				/* (all specified tasks will use the patchroutine, all others will ignore it) */
#define TL_TYPE_EXCLUDE 2	/* Type of TaskList is exclude */
				/* (all specified tasks will ignore the patchroutine, all others will use it) */


#endif	/* LIBRARIES_PATCHTAGS_H */
