5 ** $VER: xpk/xpkprefs.h 4.13 (28.01.1998) by SDI
7 ** (C) Copyright 1996-1998 by Dirk Stöcker
11 #include <exec/semaphores.h>
12 #include <libraries/iffparse.h>
14 #define ID_XPKT MAKE_ID('X','P','K','T')
15 #define ID_XPKM MAKE_ID('X','P','K','M')
17 /***************************************************************************
20 * XpkTypeData structure
24 #define XTD_NoPack (1<<0) /* filetype should not be crunched */
25 #define XTD_ReturnError (1<<1) /* return error XPKERR_NOMETHOD */
26 /* These two cannot be set same time! */
29 ULONG xtd_Flags
; /* see above XTD flags */
30 ULONG xtd_StdID
; /* holding the ID --> 'NUKE' */
31 ULONG xtd_ChunkSize
; /* maybe useless with external crunchers */
32 UWORD xtd_Mode
; /* PackMode */
33 UWORD xtd_Version
; /* structure version --> 0 at the moment */
34 STRPTR xtd_Password
; /* not used at the moment */
35 STRPTR xtd_Memory
; /* memory pointer - when should be freed by */
36 ULONG xtd_MemorySize
; /* memory size - receiver (xpkmaster) */
39 /***************************************************************************
42 * XpkTypePrefs structure
46 #define XPKT_NamePattern (1<<0) /* File Pattern is given */
47 #define XPKT_FilePattern (1<<1) /* Name Pattern is given */
48 /* These can both be set (in loading this means File AND Name Pattern have
49 to match), but one is needed */
52 ULONG xtp_Flags
; /* See above XPKT Flags */
53 STRPTR xtp_TypeName
; /* Name of this file type (for prefs program) */
54 STRPTR xtp_NamePattern
; /* Pointer to NamePattern */
55 STRPTR xtp_FilePattern
; /* Pointer to FilePattern */
56 struct XpkTypeData
* xtp_PackerData
;
59 /***************************************************************************
62 * XpkMainPrefs structure
66 #define XPKM_UseXFD (1<<0) /* Use xfdmaster.library for unpacking */
67 #define XPKM_UseExternals (1<<1) /* Use xex libraries */
68 #define XPKM_AutoPassword (1<<2) /* Use the automatic password requester */
71 ULONG xmp_Version
; /* version of structure ==> 0 */
72 ULONG xmp_Flags
; /* above defined XPKM flags */
73 struct XpkTypeData
* xmp_DefaultType
; /* sets the mode used as default */
74 UWORD xmp_Timeout
; /* Timeout for password requester
75 given in seconds, zero means no timeout */
78 /* The library internal defaults are:
80 XPKM_AutoPassword FALSE
81 XPKM_UseExternals TRUE
82 XTD_ReturnError defined as default
83 xmp_TimeOut set to 120 (two minutes)
85 These defaults are used, when no preferences file is given.
88 /***************************************************************************
91 * XpkMasterPrefs Semaphore structure
93 * find with FindSemaphore(XPKPREFSSEMNAME);
95 * obtain with ObtainSemaphoreShared(),
96 * programs WRITING into the structure fields must know:
97 * - only write to them, when you created the semaphore
98 * - use ObtainSemaphore() instead of ObtainSemaphoreShared()
101 #define XPKPREFSSEMNAME "« XpkMasterPrefs »"
103 /* Defines used for xps_PrefsType. These help to find out, which preferences
106 #define XPREFSTYPE_STANDARD 0x58504B4D /* 'XPKM' */
107 #define XPREFSTYPE_CYB 0x20435942 /* ' CYB' */
109 struct XpkPrefsSemaphore
{
110 struct SignalSemaphore xps_Semaphore
;
111 ULONG xps_Version
; /* at the moment 0 */
112 ULONG xps_PrefsType
; /* preferences type */
113 APTR xps_PrefsData
; /* preferences data */
114 struct XpkMainPrefs
* xps_MainPrefs
; /* defined defaults */
115 ULONG xps_RecogSize
; /* needed size of Recogbuffer */
116 struct XpkTypeData
* ( * xps_RecogFunc
) (); /* Recog function */
117 struct Hook
* xps_ProgressHook
; /* hook function */
118 struct Task
* xps_MasterTask
; /* Creater's task */
121 /* Use Signal(sem->xps_MasterTask, SIGBREAKF_CTRL_C); to get the installer
122 program to remove the semaphore. */
124 /* prototype/typedef of RecogFunc:
125 typedef struct XpkTypeData * __asm (*RecogFunc)
126 (register __a0 STRPTR buffer,
127 register __a1 STRPTR filename,
128 register __d0 ULONG buffersize,
129 register __d1 ULONG fullsize,
130 register __a2 struct TagItem *tags);
133 #endif /* XPK_XPKPREFS_H */