	IFND	LIBRARIES_FILEID_I
LIBRARIES_FILEID_I	SET	1

**
**	$VER: FileID.i 5.1
**
**	Standard asm definitions for FileID.library
**
**	(C) Copyright 1993,1994 BLOODROCK of SYNDICATE
**	    All Rights Reserved
**

	IFND EXEC_LIBRARIES_I
	INCLUDE	"exec/libraries.i"
	ENDC


FILEIDNAME	Macro
		dc.b	"FileID.library",0
		EndM

FILEIDVERSION	EQU	5

* IMPORTANT NOTE: PLEASE DO NOT USE V1.0 ! IT HAS A VERY HARD BUG ! *
* ALWAYS OPEN FILEID.LIBRARY WITH VERSION == 2 OR HIGHER ! *

*
* FI_FileInfo Structure *
*
* Note: The fields FI_DLPackNum, FI_DLPackType and FI_PackFlags are only
* filled if the file type is one of the crunchers as identified by the
* Decrunch.library.
*


 STRUCTURE	FI_FileInfo,0
   APTR		FI_Description		; Pointer to a file description string
   UWORD	FI_ID			; file type ID number
   UWORD        FI_GlobalFileClass      ; global file class definition

   * V2 fields *

   UWORD	FI_DLPackNum		; Decrunch.library internal PackNum
   UBYTE	FI_DLPackType		; Decrunch.library packer type
   UBYTE	FI_PackFlags		; special flags for crunched files

   LABEL	FI_SIZEOF * FI_FileInfo


ID_MAXLENGTH	EQU	35		; Maximum file description length
					; (also error messages max_length)

*
* Global file class definitions *
*
* The global class definition gives you some primary information about the
* global file type. This is useful if you want to know about e.g. a file
* is packed.
* For example, a PowerPacker password crunched executable gets a global
* class value of $0007 ( EXECUTABLE|PACKED|ENCRYPTED )
*
* Note that on some special data formats, like e.g. IFF-ILBM files with
* crunched bitmap chunks, bit 1 isn't set. If an IFF picture was packed
* (e.g. using Xpk), FileID.library would report an Xpk compressed file,
* not an IFF picture. Do not mischange this.
* For example, NoisePacker modules or JPEG pictures DON'T have bit 1 set,
* even when everybody knows that these files contain packed data. Got me ?
*
* FIGFC_GRAFIC_IMAGE does NOT include any 2-D or 3-D rendering data formats,
* like imagine objects, vector fonts etc. Somtimes, it was really hard to
* decide if this bit should be set or not. So please treat bit #5 as a kind
* of help, not as warranty.
*

	BITDEF	FIGFC,EXECUTABLE,0	; executable file
	BITDEF	FIGFC,PACKED,1		; file is packed/crunched
	BITDEF	FIGFC,ENCRYPTED,2	; encrypted file, may need a password
	BITDEF	FIGFC,IFF_HEADER,3	; file has "FORM" IFF header
	BITDEF	FIGFC,MUSIC_SCORE,4	; sound module / music score (song)
	BITDEF	FIGFC,GRAPHIC_IMAGE,5	; picture/brush, anim or color palette
	BITDEF	FIGFC,FORMATTED_TEXT,6	; special formatted text file
	BITDEF	FIGFC,SCRIPT,7		; script file


* FI_DLPackType

        PTYP_RELOC  EQU 0               ; normal relocatible loadfile
        PTYP_ABS    EQU 1               ; absolute adress decruncher
        PTYP_DATA   EQU 2               ; data file


* FI_PackFlags *

	BITDEF	FIPF,KILLSYS,0		; file has KillSys decrunch header

	* V 3 *

	BITDEF	FIPF,PPMM,1		; crunched with PPx.x in "master mode"


* FileID error codes returned by FIIdentifyFromName() *

ERR_FILOCKFAILED	EQU	-1	; couldn't get entry lock.
ERR_FIEXAMINEFAILED	EQU	-2	; couldn't examine entry.
ERR_FIOPENFAILED	EQU	-3	; couldn't open file.
ERR_FIOUTOFMEM		EQU	-4	; out of memory.
ERR_FIREADERROR		EQU	-5	; file read error.
ERR_EMPTYFILE		EQU	-6	; filesize is ZERO.
ERR_NONAME		EQU	-7	; the passed filename is empty.

* Library base *

 STRUCTURE FileIDBase,LIB_SIZE

   * LIBRARY PRIVATE *

   UBYTE   FI_Flags		; see also:
   UBYTE   FI_pad		; "sample.library.asm", documented in the
   ULONG   FI_SegList		; Amiga ROM Kernel Reference Manual: Libraries

   * PUBLIC FIELDS *		; may be READ from your program

   ULONG   FI_DosBase		; dos.library base address

   * V5 *
*
* If locale.library V38+ or FileID_lib.catalog couldn't be opened, the
* two following fields will both contain NULL.
*

   APTR    FI_LocaleBase	; locale.library V38+ base address
   APTR    FI_FIDCat		; address of the library locale catalog

   LABEL   FileIDBase_SIZEOF


 ENDC	; LIBRARIES_FILEID_I
