
	IFND LIBRARIES_DATAMASTER_I
LIBRARIES_DATAMASTER_I SET 1

;**
;**	$Filename: libraries/datamaster.i $
;**	$Release: 1.0 $
;**	$Revision: 1.0 $
;**
;**	datamaster.library definitions
;**
;**	(C) Copyright 1995 Alexis Nasr
;**	All Rights Reserved
;**

	incdir "includes:"

	IFND EXEC_LISTS_I
	include "exec/lists.i"
	ENDC

	IFND EXEC_LIBRARIES_I
	include "exec/libraries.i"
	ENDC

	IFND EXEC_SEMAPHORES_I
	include "exec/semaphores.i"
	ENDC

	IFND LIBRARIES_DOS_I
	include "libraries/dos.i"
	ENDC

	IFND LIBRARIES_DOSEXTENS_I
	include "libraries/dosextens.i"
	ENDC

	IFND GRAPHICS_TEXT_I
	include "graphics/text.i"
	ENDC

	IFND UTILITY_TAGITEM_I
	include "utility/tagitem.i"
	ENDC

DATAMASTERNAME:	   MACRO
   dc.b "datamaster.library",0
		   ENDM

DATAMASTER_VERSION	equ	 1
DATAMASTER_REVISION	equ	 0

DMV:	MACRO		;macros making the ASCII name of lib.
	dc.b	"1"	;so sad to have to use this shitty way of doing
	ENDM		;things but it's another lame bug of Asm-one that
			;doesn't handle correctly all the MACRO functions :-((
DMR:	MACRO		;( no \DATAMASTER_VERSION permitted grrrrrrrrr)
	dc.b	"0"
	ENDM

RECOHEADER:	MACRO
	moveq	#-1,d0
	rts
	dc.b	"DATARECO"
	dc.l	\1
	ENDM

RECOHEADER2:	MACRO		;for internals
	even
	dc.b	"DATARECO"
	dc.l	\1
	ENDM


;******************************************************************
;Library base
;******************************************************************

	STRUCTURE datamasterbase,LIB_SIZE
	LONG	dmb_Seglist
;lib_bases
	LONG	dmb_RecoAdr		;(internal) adr of array of recognizer segments.
	WORD	dmb_RecoNb		;number of  recognizers
	WORD	dmb_Flags		;see below
	LONG	dmb_LockNest		;count of LockCbases.Can only modify prefs if it is ZERO...means no user NOW.

	LONG	dmb_dosbase
	LONG	dmb_utilbase
	LONG	dmb_reqbase		;may be ZERO...
	LONG	dmb_resbase2
	LONG	dmb_resbase3

	LABEL	DmBase_SIZEOF

;dmb_flags

	BITDEF	DMflag,PrefsNow,0	;prefs are changing NOW!! please wait!!!


;******************************************************************
;Tags for external recognizer
;******************************************************************



DMR_TagBase	EQU	TAG_USER+"DM"		;DataMaster Recognizer

;'*' tags ***MUST*** be present!!

	ENUM	DMR_TagBase			; TagBase

	EITEM	DMR_Check		;pointer to checkroutine
	EITEM	DMR_Flags		;* see defs
	EITEM	DMR_Name		;* THAT one is used,*NOT* filename,so don't change it in new versions of recognizer :)
	EITEM	DMR_Descr		;$VER-like description (60 chars string max)
	EITEM	DMR_Version		;recoversion: Ver<<16+Rev (high W=ver/low W=rev)
	EITEM	DMR_DMVersion		;needed version of library
	EITEM	DMR_Pattern
	EITEM	DMR_Pri			;See PRI_xxx predefined values
	EITEM	DMR_RecoNumber		;default=1.Number of filetypes really included in this recognizer
	EITEM	DMR_InitRoutine		;optional init routine (libs needed etc)
	EITEM	DMR_ExitRoutine		;optional exit routine (libs needed etc)

;flag bits.(used both for DMR_Flags & for Testfile Mode)
	BITDEF	reco,Internal,0			;won't be Unloadseg'd ;-)
	BITDEF	reco,CheckPatt,1		;means the PatternTag valid
	BITDEF	reco,CheckData,2		;means the CheckTag valid
	BITDEF	reco,XPKload,3			;used for TestFile
	BITDEF	reco,Disabled,4			;NOT USED YET
	BITDEF	reco,GetName,5			;means DMR_Check() returns d0=string (& NOT d0=TRUE/FALSE)
	BITDEF	reco,NoCopy,6			;INTERNAL.Don't use.
	BITDEF	reco,DupString,7		;used with GetName flag: means the string is ALLOCATED by the recognize.it'll be the library job
						;to Freemem() this string	
;priority definitions
PRI_FREQUENT		=10
PRI_SINGLE		=5
PRI_SINGLEGROUPED	=3
PRI_GROUPED		=0
PRI_GROUPEDSLOW		=-5
PRI_RARE		=-10

;******************************************************************
;various data
;******************************************************************

MAXRECO=128			;should be enough for now.

		RSRESET		;RecoList struct [give this to QueryRecoList]

rl_NumRecos:	rs.w	1		;number of recognizers
rl_recolist:	rs.l	MAXRECO		;array of .L=addresses of names/recos
rl_Null:	rs.l	1		;'ll be cleared by Query() call
rl_SIZEOF:	rs.w	0



		RSRESET		;DMhandle structure.<<PRIVATE>> . WILL change in the future
dmh_String:	rs.l	1
dmh_Size:	rs.l	1
dmh_Ownsize:	rs.l	1	;put dmh_SIZEOF here (for future compatibilty)
dmh_SIZEOF:	rs.w	0


   		ENDC ; LIBRARIES_DATAMASTER_I
