home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
402.lha
/
IconTools
/
arp
/
ArpBase.j.ab
< prev
Wrap
Text File
|
1990-07-27
|
20KB
|
346 lines
3 constant PRB_INTERACTIVE ( Run an interactive shell )
7 constant PRB_FB ( Alt function bit... )
1 PRB_CLI << constant PRF_CLI
1 PRB_BACKGROUND << constant PRF_BACKGROUND
1 PRB_EXECUTE << constant PRF_EXECUTE
1 PRB_INTERACTIVE << constant PRF_INTERACTIVE
1 PRB_FB << constant PRF_FB
( )
( ************************************************************************)
( * Common values for sh_Control which allow you to do usefull *)
( * and somewhat "standard" things... *)
( ************************************************************************)
( )
PRF_FB PRF_INTERACTIVE | constant INTERACTIVE_SHELL ( Gimme a newshell! )
PRF_FB PRF_INTERACTIVE | PRF_CLI | constant INTERACTIVE_CLI ( Gimme that ol newcli! )
PRF_FB PRF_BACKGROUND | constant BACKGROUND_SHELL ( gimme a background shell )
PRF_FB PRF_BACKGROUND | PRF_EXECUTE | constant EXECUTE_ME ( aptly named, doncha think? )
( )
( ************************************************************************)
( * Additional IoErr[] returns added by ARP... *)
( ************************************************************************)
( )
303 constant ERROR_BUFFER_OVERFLOW ( User or internal buffer overflow )
304 constant ERROR_BREAK ( A break character was received )
305 constant ERROR_NOT_EXECUTABLE ( A file has E bit cleared )
400 constant ERROR_NOT_CLI ( Program/function neeeds to be cli )
( )
( ************************************************************************)
( * Resident Program Support *)
( ************************************************************************)
( * This is the kind of node allocated for you when you AddResidentPrg[] *)
( * a code segment. They are stored as a single linked list with the *)
( * root in ArpBase. If you absolutely *must* wander through this list *)
( * instead of using the supplied functions, then you must first obtain *)
( * the semaphore which protects this list, and then release it *)
( * afterwards. Do not use Forbid[] and Permit[] to gain exclusive *)
( * access! Note that the supplied functions handle this locking *)
( * protocol for you. *)
( ************************************************************************)
( )
:STRUCT ResidentProgramNode
APTR rpn_Next ( next or NULL )
LONG rpn_Usage ( Number of current users )
USHORT rpn_AccessCnt ( Total times used... )
ULONG rpn_CheckSum ( Checksum of code )
LONG rpn_Segment ( Actual segment )
USHORT rpn_Flags ( See definitions below... )
( %?) 1 BYTES rpn_Name ( Allocated as needed )
;STRUCT
( )
( ************************************************************************)
( * Bit definitions for rpn_Flags.... *)
( ************************************************************************)
( )
0 constant RPNB_NOCHECK ( Set in rpn_Flags for no checksumming... )
1 constant RPNB_CACHE ( Private usage in v1.3... )
1 RPNB_NOCHECK << constant RPNF_NOCHECK
1 RPNB_CACHE << constant RPNF_CACHE
( )
( ************************************************************************)
( * If your program starts with this structure, ASyncRun[] and SyncRun[] *)
( * will override a users stack request with the value in rpt_StackSize. *)
( * Furthermore, if you are actually attached to the resident list, a *)
( * memory block of size rpt_DataSize will be allocated for you, and *)
( * a pointer to this data passed to you in register A4. You may use *)
( * this block to clone the data segment of programs, thus resulting in *)
( * one copy of text, but multiple copies of data/bss for each process *)
( * invocation. If you are resident, your program will start at *)
( * rpt_Instruction, otherwise, it will be launched from the initial *)
( * branch. *)
( ************************************************************************)
( )
:STRUCT ResidentProgramTag
LONG rpt_NextSeg ( Provided by DOS at LoadSeg time )
( )
( ************************************************************************)
( * The initial branch destination and rpt_Instruction do not have to be *)
( * the same. This allows different actions to be taken if you are *)
( * diskloaded or resident. DataSize memory will be allocated only if *)
( * you are resident, but StackSize will override all user stack *)
( * requests. *)
( ************************************************************************)
( )
USHORT rpt_BRA ( Short branch to executable )
USHORT rpt_Magic ( Resident majik value )
ULONG rpt_StackSize ( min stack for this process )
ULONG rpt_DataSize ( Data size to allocate if resident )
( rpt_Instruction; Start here if resident )
;STRUCT
( )
( ************************************************************************)
( * The form of the ARP allocated node in your tasks memlist when *)
( * launched as a resident program. Note that the data portion of the *)
( * node will only exist if you have specified a nonzero value for *)
( * rpt_DataSize. Note also that this structure is READ ONLY, modify *)
( * values in this at your own risk. The stack stuff is for tracking, *)
( * if you need actual addresses or stack size, check the normal places *)
( * for it in your process/task struct. *)
( ************************************************************************)
( )
:STRUCT ProcessMemory
STRUCT Node pm_Node
USHORT pm_Num ( This is 1 if no data, two if data )
\ %? correct below? -RM CPTR pm_Stack;
APTR pm_Stack
ULONG pm_StackSize
\ %? correct below? -RM CPTR pm_Data; /* Only here if pm_Num == 2 */
APTR pm_Data ( Only here if pm_Num == 2 )
ULONG pm_DataSize
;STRUCT
( )
( ************************************************************************)
( * To find the above on your memlist, search for the following name. *)
( * We guarantee this will be the only arp.library allocated node on *)
( * your memlist with this name. *)
( * i.e. FindName[task->tcb_MemEntry, PMEM_NAME]; *)
( ************************************************************************)
( )
0" ARP_MEM" 0string PMEM_NAME
$ 4AFC constant RESIDENT_MAGIC ( same as RTC_MATCHWORD [trapf] )
( )
( ************************************************************************)
( * Date String/Data structures *)
( ************************************************************************)
( )
:STRUCT DateTime
STRUCT DateStamp dat_Stamp ( DOS Datestamp )
UBYTE dat_Format ( controls appearance ot dat_StrDate )
UBYTE dat_Flags ( See BITDEF's below )
APTR dat_StrDay ( day of the week string )
APTR dat_StrDate ( date string )
APTR dat_StrTime ( time string )
;STRUCT
( )
( ************************************************************************)
( * Size of buffer you need for each DateTime strings: *)
( ************************************************************************)
( )
10 constant LEN_DATSTRING
( )
( ************************************************************************)
( * For dat_Flags *)
( ************************************************************************)
( )
0 constant DTB_SUBST ( Substitute "Today" "Tomorrow" where appropriate )
1 constant DTB_FUTURE ( Day of the week is in future )
1 DTB_SUBST << constant DTF_SUBST
1 DTB_FUTURE << constant DTF_FUTURE
( )
( ************************************************************************)
( * For dat_Format *)
( ************************************************************************)
( )
0 constant FORMAT_DOS ( dd-mmm-yy AmigaDOS's own, unique style )
1 constant FORMAT_INT ( yy-mm-dd International format )
2 constant FORMAT_USA ( mm-dd-yy The good'ol'USA. )
3 constant FORMAT_CDN ( dd-mm-yy Our brothers and sisters to the north )
FORMAT_CDN constant FORMAT_MAX ( Larger than this? Defaults to AmigaDOS )
( )
( ************************************************************************)
( * This prototype is here to prevent the possible error in defining *)
( * IoErr[] as LONG and thus causing LastTracker to give you trash... *)
( * *)
( * N O T E ! You MUST! have IoErr[] defined as LONG to use LastTracker *)
( * If your compiler has other defines for this, you may wish *)
( * to move the prototype for IoErr[] into the DO_ARP_COPIES *)
( ************************************************************************)
( )
\ %? LONG IoErr ARGs( (VOID) );
\ %? /*
\ %? * These duplicate the calls in dos.library *
\ %? * Only include if you can use arp.library without dos.library *
\ %? */
\ %? #ifdef DO_ARP_COPIES
\ %? BPTR Open ARGs( (char *, LONG) );
\ %? VOID Close ARGs( (BPTR) );
\ %? LONG Read ARGs( (BPTR, char *, LONG) );
\ %? LONG Write ARGs( (BPTR, char *, LONG) );
\ %? BPTR Input ARGs( (VOID) );
\ %? BPTR Output ARGs( (VOID) );
\ %? LONG Seek ARGs( (BPTR, LONG, LONG) );
\ %? LONG DeleteFile ARGs( (char *) );
\ %? LONG Rename ARGs( (char *, char *) );
\ %? BPTR Lock ARGs( (char *, LONG) );
\ %? VOID UnLock ARGs( (BPTR) );
\ %? BPTR DupLock ARGs( (BPTR) );
\ %? LONG Examine ARGs( (BPTR, struct FileInfoBlock *) );
\ %? LONG ExNext ARGs( (BPTR, struct FileInfoBlock *) );
\ %? LONG Info ARGs( (BPTR, struct InfoData *) );
\ %? BPTR CreateDir ARGs( (char *) );
\ %? BPTR CurrentDir ARGs( (BPTR) );
\ %? struct MsgPort *CreateProc ARGs( (char *, LONG, BPTR, LONG) );
\ %? VOID Exit ARGs( (LONG) );
\ %? BPTR LoadSeg ARGs( (char *) );
\ %? VOID UnLoadSeg ARGs( (BPTR) );
\ %? struct MsgPort *DeviceProc ARGs( (char *) );
\ %? LONG SetComment ARGs( (char *, char *) );
\ %? LONG SetProtection ARGs( (char *, LONG) );
\ %? LONG *DateStamp ARGs( (LONG *) );
\ %? VOID Delay ARGs( (LONG) );
\ %? LONG WaitForChar ARGs( (BPTR, LONG) );
\ %? BPTR ParentDir ARGs( (BPTR) );
\ %? LONG IsInteractive ARGs( (BPTR) );
\ %? LONG Execute ARGs( (char *, BPTR, BPTR) );
\ %? #endif DO_ARP_COPIES
\ %? /*
\ %? * Now for the stuff that only exists in arp.library... *
\ %? */
\ %? LONG C_Args Printf ARGs( (char *,) );
\ %? LONG C_Args FPrintf ARGs( (BPTR, char *,) );
\ %? LONG Puts ARGs( (char *) );
\ %? LONG Readline ARGs( (char *) );
\ %? LONG GADS ARGs( (char *, LONG, char *, char **, char *) );
\ %? LONG Atol ARGs( (char *) );
\ %? ULONG EscapeString ARGs( (char *) );
\ %? LONG CheckAbort ARGs( (VOID(*)) );
\ %? LONG CheckBreak ARGs( (LONG, VOID(*)) );
\ %? BYTE *Getenv ARGs( (char *, char *, LONG) );
\ %? BOOL Setenv ARGs( (char *, char *) );
\ %? BYTE *FileRequest ARGs( (struct FileRequester *) );
\ %? VOID CloseWindowSafely ARGs( (struct Window *, LONG) );
\ %? struct MsgPort *CreatePort ARGs( (char *, LONG) );
\ %? VOID DeletePort ARGs( (struct MsgPort *) );
\ %? LONG SendPacket ARGs( (LONG, LONG *, struct MsgPort *) );
\ %? VOID InitStdPacket ARGs( (LONG, LONG *, struct DosPacket *, struct MsgPort *) );
\ %? ULONG PathName ARGs( (BPTR, char *,LONG) );
\ %? ULONG Assign ARGs( (char *, char *) );
\ %? VOID *DosAllocMem ARGs( (LONG) );
\ %? VOID DosFreeMem ARGs( (VOID *) );
\ %? ULONG BtoCStr ARGs( (char *, BSTR, LONG) );
\ %? ULONG CtoBStr ARGs( (char *, BSTR, LONG) );
\ %? struct DeviceList *GetDevInfo ARGs( (struct DeviceList *) );
\ %? BOOL FreeTaskResList ARGs( (VOID) );
\ %? VOID ArpExit ARGs( (LONG,LONG) );
\ %? VOID C_Args *ArpAlloc ARGs( (LONG) );
\ %? VOID C_Args *ArpAllocMem ARGs( (LONG, LONG) );
\ %? BPTR C_Args ArpOpen ARGs( (char *, LONG) );
\ %? BPTR C_Args ArpDupLock ARGs( (BPTR) );
\ %? BPTR C_Args ArpLock ARGs( (char *, LONG) );
\ %? VOID C_Args *RListAlloc ARGs( (struct ResList *, LONG) );
\ %? struct Process *FindCLI ARGs( (LONG) );
\ %? BOOL QSort ARGs( (VOID *, LONG, LONG, int(*)) );
\ %? BOOL PatternMatch ARGs( (char *,char *) );
\ %? LONG FindFirst ARGs( (char *, struct AnchorPath *) );
\ %? LONG FindNext ARGs( (struct AnchorPath *) );
\ %? VOID FreeAnchorChain ARGs( (struct AnchorPath *) );
\ %? ULONG CompareLock ARGs( (BPTR, BPTR) );
\ %? struct ResList *FindTaskResList ARGs( (VOID) );
\ %? struct ResList *CreateTaskResList ARGs( (VOID) );
\ %? VOID FreeResList ARGs( (struct ResList *) );
\ %? VOID FreeTrackedItem ARGs( (struct DefaultTracker *) );
\ %? struct DefaultTracker C_Args *GetTracker ARGs( (LONG) );
\ %? VOID *GetAccess ARGs( (struct DefaultTracker *) );
\ %? VOID FreeAccess ARGs( (struct DefaultTracker *) );
\ %? VOID FreeDAList ARGs( (struct DirectoryEntry *) );
\ %? struct DirectoryEntry *AddDANode ARGs( (char *, struct DirectoryEntry **, LONG, LONG) );
\ %? ULONG AddDADevs ARGs( (struct DirectoryEntry **, LONG) );
\ %? LONG Strcmp ARGs( (char *, char *) );
\ %? LONG Strncmp ARGs( (char *, char *, LONG) );
\ %? BYTE Toupper ARGs( (BYTE) );
\ %? LONG SyncRun ARGs( (char *, char *, BPTR, BPTR) );
\ %? /*
\ %? * Added V32 of arp.library *
\ %? */
\ %? LONG ASyncRun ARGs( (char *, char *, struct ProcessControlBlock *) );
\ %? LONG SpawnShell ARGs( (char *, char *, struct NewShell *) );
\ %? BPTR LoadPrg ARGs( (char *) );
\ %? BOOL PreParse ARGs( (char *, char *) );
\ %? /*
\ %? * Added V33 of arp.library *
\ %? */
\ %? BOOL StamptoStr ARGs( (struct DateTime *) );
\ %? BOOL StrtoStamp ARGs( (struct DateTime *) );
\ %? struct ResidentProgramNode *ObtainResidentPrg ARGs( (char *) );
\ %? struct ResidentProgramNode *AddResidentPrg ARGs( (BPTR, char *) );
\ %? LONG RemResidentPrg ARGs( (char *) );
\ %? VOID UnLoadPrg ARGs( (BPTR) );
\ %? LONG LMult ARGs( (LONG, LONG) );
\ %? LONG LDiv ARGs( (LONG, LONG) );
\ %? LONG LMod ARGs( (LONG, LONG) );
\ %? ULONG CheckSumPrg ARGs( (struct ResidentProgramNode *) );
\ %? VOID TackOn ARGs( (char *, char *) );
\ %? BYTE *BaseName ARGs( (char *) );
\ %? struct ResidentProgramNode *ReleaseResidentPrg ARGs( (BPTR) );
\ %? /*
\ %? * Added V36 of arp.library *
\ %? */
\ %? LONG C_Args SPrintf ARGs( (char *, char *,) );
\ %? LONG GetKeywordIndex ARGs( (char *, char *) );
\ %? struct Library C_Args *ArpOpenLibrary ARGs( (char *, LONG) );
\ %? struct FileRequester C_Args *ArpAllocFreq ARGs( (VOID) );
\ %? /*
\ %? * Check if we should do the pragmas... *
\ %? */
\ %? #ifndef NO_PRAGMAS
\ %? #ifndef PROTO_ARP_H
\ %? #include <Proto/ARP.h>
\ %? #endif PROTO_ARP_H
\ %? #endif NO_PRAGMAS
\ %? #endif LIBRARIES_ARPBASE_H