home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- tool.h version 8.1 - © 1990-91 Jaba Development
-
- Author : Jan van den Baard
- *-----------------------------------------------------------------------*/
- #ifndef TOOL_H
- #define TOOL_H 1
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
- #ifndef EXEC_MEMORY_H
- #include <exec/memory.h>
- #endif
- #ifndef EXEC_PORTS_H
- #include <exec/ports.h>
- #endif
- #ifndef EXEC_IO_H
- #include <exec/io.h>
- #endif
- #ifndef DEVICES_TIMER_H
- #include <devices/timer.h>
- #endif
- #ifndef EXEC_LIBRARIES_H
- #include <exec/libraries.h>
- #endif
- #ifndef LIBRARIES_DOS_H
- #include <libraries/dos.h>
- #endif
- #ifndef LIBRARIES_DOSEXTENS_H
- #include <libraries/dosextens.h>
- #endif
- #ifndef INTUITION_INTUITION_H
- #include <intuition/intuition.h>
- #endif
- #ifndef INTUITION_INTUITIONBASE_H
- #include <intuition/intuitionbase.h>
- #endif
-
- struct ToolBase
- {
- struct Library LibNode;
- struct ExecBae *SysBase;
- struct DosLibrary *DOSBase;
- struct IntuitionBase *IntuitionBase;
- struct GfxBase *GfxBase;
-
- /* from here on it's private USE AT YOUR OWN RISK !!! */
-
- LONG SegList;
- };
-
- #define TOOL_VERSION 8
- #define TOOL_REVISION 1
-
- struct TimeDelay
- {
- struct MsgPort *td_UserPort;
- struct MsgPort *td_ReplyPort;
- struct timerequest *td_TimeRequest;
- };
-
- #define LONGALLIGN(s) (((s)+7)&-8)
-
- /*
- * The MemoryBlock, MemoryItem, BlockList and ItemList structures
- * are PRIVATE structures used by the memory routines of the library.
- * DO NOT SCREW ARROUND WITH THESE STRUCTURES BECAUSE THEY MIGHT CHANGE
- * IN FUTURE RELEASES OF THE LIBRARY !!!!!!!!!
- */
- struct MemoryBlock
- {
- struct MemoryBlock *mb_Next;
- struct MemoryBlock *mb_Previous;
- ULONG mb_Requirements;
- ULONG mb_BytesUsed;
- };
-
- struct MemoryItem
- {
- struct MemoryItem *mi_Next;
- struct MemoryItem *mi_Previous;
- struct MemoryBlock *mi_Block;
- ULONG mi_Size;
- };
-
- struct BlockList
- {
- struct MemoryBlock *bl_First;
- struct MemoryBlock *bl_End;
- struct MemoryBlock *bl_Last;
- };
-
- struct ItemList
- {
- struct MemoryItem *il_First;
- struct MemoryItem *il_End;
- struct MemoryItem *il_Last;
- };
-
- /*
- * YOU MAY ONLY USE THIS STRUCTURE TO PASS TO THE MEMORY ROUTINES OF
- * THE LIBRARY. DO NOT CHANGE THE CONTENTS OF A MEMORYCHAIN STRUCTURE
- * IN YOUR PROGRAMS BECAUSE THIS STRUCTURE MAY CHANGE IN FUTURE RELEASES
- * OF THE LIBRARY !!!!!!!!!
- */
- struct MemoryChain
- {
- struct BlockList mc_Blocks;
- struct ItemList mc_Items;
- ULONG mc_BlockSize;
- };
-
- #define MINDATE 32
- #define ALL 0
- #define ONLY_DAY 1
- #define ONLY_DATE 2
- #define ONLY_TIME 3
-
- #define NO_CASE 0
- #define CASE 1
-
- #define ENTRY_FILE 0
- #define ENTRY_DIR 1
- #define ENTRY_DEV 2
-
- #define DIRBLOCK (5 * 1024)
-
- struct EntryInfo
- {
- struct EntryInfo *ei_Next;
- struct EntryInfo *ei_Previous;
- USHORT ei_Type;
- UBYTE ei_Name[32];
- LONG ei_SizeBytes;
- LONG ei_SizeBlocks;
- LONG ei_ProtectionBits;
- struct DateStamp ei_Date;
- };
-
- struct Directory
- {
- struct EntryInfo *dr_First;
- struct EntryInfo *dr_End;
- struct EntryInfo *dr_Last;
- struct FileInfoBlock *dr_InfoBlock;
- BPTR dr_Lock;
- ULONG dr_NumEntries;
- struct MemoryChain dr_DirMem;
- };
-
- #define FREQ_OK 0
- #define FREQ_CANT_OPEN 1
- #define FREQ_FILE_ERROR 2
- #define FREQ_CANCELED 3
-
- struct FileRequester
- {
- char *fr_HeadLine;
- char *fr_FileName;
- char *fr_DirName;
- char *fr_DontShow;
- USHORT fr_LeftEdge;
- USHORT fr_TopEdge;
- struct Window *fr_Caller;
- struct Screen *fr_Screen;
- struct Directory *fr_Directory;
- USHORT fr_Flags;
- USHORT fr_Colors[4];
- BPTR fr_Handle;
- LONG fr_Reserved;
- };
-
- #define FREQ_WIDTH 260
- #define FREQ_HEIGHT 140
-
- #define FR_NoPreserve 1
- #define FR_NoDevs 2
- #define FR_NoSort 4
- #define FR_CustColor 8
- #define FR_ReturnOld 16
- #define FR_ReturnNew 32
- #define FR_ReturnReadWrite 64
- #define FR_NoInfo 128
- #define FR_ReturnVoid 0
-
- struct MsgPort *CreatePort(const char *, long);
- void DeletePort(struct MsgPort *);
- struct IORequest *CreateExtIO(struct MsgPort *, long);
- void DeleteExtIO(struct IORequest *);
- struct IOStdReq *CreateStdIO(struct MsgPort *);
- void DeleteStdIO(struct IOStdReq *);
- struct TimeDelay *CreateTimeDelay(struct MsgPort *, long, long);
- long DoTimeDelay(struct TimeDelay *);
- void DeleteTimeDelay(struct TimeDelay *);
- void QuickSort(char *, long, long, long *);
- void SwapMem(char *, char *, long);
- long TestBits(long , long);
- void SelectGadget(struct Window *, struct Gadget *, struct Requester *);
- void DeSelectGadget(struct Window *, struct Gadget *, struct Requester *);
- void MutualExclude(struct Window *, struct Gadget *, struct Gadget *, struct Requester *);
- void MutualInclude(struct Window *, struct Gadget *, struct Gadget *, struct Requester *);
- void EraseGadget(struct Window *, struct Gadget *, struct Requester *);
- void GadgetOn(struct Window *, struct Gadget *, struct Requester *);
- void GadgetOff(struct Window *, struct Gadget *, struct Requester *);
- long SelectTest(struct Gadget *);
- void ShadowGadget(struct Window *, struct Gadget *, struct Requester *, long);
- void OnGList(struct Window *, struct Gadget *, struct Requester *, long);
- void OffGList(struct Window *, struct Gadget *, struct Requester *, long);
- void SelectGList(struct Window *, struct Gadget *, struct Requester *, long);
- void DeSelectGList(struct Window *, struct Gadget *, struct Requester *, long);
- void ShadowGList(struct Window *, struct Gadget *, struct Requester *, long, long);
- void EraseGList(struct Window *, struct Gadget *, struct Requester *, long);
- void InitMemoryChain(struct MemoryChain *, long);
- void *AllocItem(struct MemoryChain *, long, long);
- void FreeItem(struct MemoryChain *, void *, long);
- void FreeMemoryChain(struct MemoryChain *);
- void Format(char *, char *f, ...);
- long WriteFormat(BPTR, char *, ...);
- long MatchPattern(char *, char *, long);
- long Isolate(char *, char *);
- void BstrToCstr(BPTR *, char *);
- long GetDate(struct DateStamp *, char *, long);
- long OpenDir(struct Directory *, char *);
- struct EntryInfo *GetEntry(struct Directory *);
- void CloseDir(struct Directory *);
- void FreeDir(struct Directory *);
- char *IoErrToStr();
- struct FileRequester *AllocFreq();
- void FreeFreq(struct FileRequester *);
- long FileRequest(struct FileRequester *);
- long FormatText(struct RastPort *, char *, ...);
- #ifndef NO_PRAGMAS
- #include <tool_pragmas.h>
- #endif
- #endif
-