home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / util / edit / vim / src / arpbase.h < prev    next >
C/C++ Source or Header  |  1994-08-14  |  50KB  |  1,199 lines

  1. #ifndef    LIBRARIES_ARPBASE_H
  2. #define    LIBRARIES_ARPBASE_H 1
  3.  
  4. /*
  5.  ************************************************************************
  6.  *                                    *
  7.  * 5/3/89    ARPbase.h    by MKSoft from ARPbase.i by SDB        *
  8.  *                                    *
  9.  ************************************************************************
  10.  *                                    *
  11.  *    AmigaDOS Resource Project -- Library Include File        *
  12.  *                     for Lattice C 5.x or Manx C 5.x    *
  13.  *                                    *
  14.  ************************************************************************
  15.  *                                    *
  16.  *    Copyright (c) 1987/1988/1989 by Scott Ballantyne        *
  17.  *                                    *
  18.  *    The arp.library, and related code and files may be freely used    *
  19.  *    by supporters of ARP.  Modules in the arp.library may not be    *
  20.  *    extracted for use in independent code, but you are welcome to    *
  21.  *    provide the arp.library with your work and call on it freely.    *
  22.  *                                    *
  23.  *    You are equally welcome to add new functions, improve the ones    *
  24.  *    within, or suggest additions.                    *
  25.  *                                    *
  26.  *    BCPL programs are not welcome to call on the arp.library.    *
  27.  *    The welcome mat is out to all others.                *
  28.  *                                    *
  29.  ************************************************************************
  30.  *                                    *
  31.  * N O T E !  You MUST! have IoErr() defined as LONG to use LastTracker *
  32.  *          If your compiler has other defines for this, you may wish *
  33.  *          to remove the prototype for IoErr() from this file.    *
  34.  *                                    *
  35.  ************************************************************************
  36.  */
  37.  
  38. /*
  39.  ************************************************************************
  40.  *    First we need to include the Amiga Standard Include files...    *
  41.  ************************************************************************
  42.  */
  43. #ifndef    EXEC_TYPES_H
  44. #include <exec/types.h>
  45. #endif    /* EXEC_TYPES_H */
  46.  
  47. #ifndef    EXEC_LISTS_H
  48. #include <exec/lists.h>
  49. #endif    /* EXEC_LISTS_H */
  50.  
  51. #ifndef    EXEC_ALERTS_H
  52. #include <exec/alerts.h>
  53. #endif    /* EXEC_ALERTS_H */
  54.  
  55. #ifndef    EXEC_LIBRARIES_H
  56. #include <exec/libraries.h>
  57. #endif    /* EXEC_LIBRARIES_H */
  58.  
  59. #ifndef    EXEC_SEMAPHORES_H
  60. #include <exec/semaphores.h>
  61. #endif    /* EXEC_SEMAPHORES_H */
  62.  
  63. #ifndef    LIBRARIES_DOS_H
  64. #include <libraries/dosextens.h>
  65. #endif    /* LIBRARIES_DOS_H */
  66.  
  67. /*
  68.  ************************************************************************
  69.  *    Check for MANX/Lattice and define the differences...        *
  70.  ************************************************************************
  71.  *    At the moment MANX 3.6 does not have prototypes or the        *
  72.  *    wonderful #pragma statements of Lattice 5.0...            *
  73.  *    And, no __stdargs in MANX either...                *
  74.  ************************************************************************
  75.  */
  76. #ifdef    AZTEC_C
  77.  
  78.     /* Do we have an old 3.6a compiler? -olsen */
  79.  
  80. #ifndef __VERSION
  81. #define __VERSION 360
  82. #endif    /* __VERSION */
  83.  
  84.     /* If this is an old compiler, don't confuse it with
  85.      * ANSI prototypes and pragmas. -olsen
  86.      */
  87.  
  88. #if __VERSION < 500
  89. #define    NO_PRAGMAS    1
  90. #define NO_PROTOTYPES    1
  91. #endif    /* __VERSION */
  92.  
  93. #define    C_Args
  94.  
  95. #endif    /* AZTEC_C */
  96.  
  97. #ifdef    LATTICE
  98.  
  99. #define    C_Args    __stdargs
  100.  
  101. #endif    /* LATTICE */
  102.  
  103. /*
  104.  ************************************************************************
  105.  *    Standard definitions for arp library information        *
  106.  ************************************************************************
  107.  */
  108. #define    ArpName        "arp.library"    /* Name of library... */
  109. #define    ArpVersion    39L        /* Current version... */
  110.  
  111. /*
  112.  ************************************************************************
  113.  *    The current ARP library node...                    *
  114.  ************************************************************************
  115.  */
  116. struct    ArpBase    {
  117.     struct    Library            LibNode;     /* Standard library node        */
  118.         APTR            DosRootNode;     /* Copy of dl_Root            */
  119.         UBYTE            Flags;         /* See bitdefs below            */
  120.         UBYTE            ESCChar;      /* Character to be used for escaping    */
  121.         LONG            ArpReserved1;     /* ArpLib's use only!!            */
  122.     struct    Library            *EnvBase;      /* Dummy library for MANX compatibility*/
  123.     struct    Library            *DosBase;      /* Cached DosBase            */
  124.     struct    Library            *GfxBase;      /* Cached GfxBase            */
  125.     struct    Library            *IntuiBase;     /* Cached IntuitionBase        */
  126.     struct    MinList            ResLists;     /* Resource trackers            */
  127.     struct    ResidentProgramNode    *ResidentPrgList;/* Resident Programs.            */
  128.     struct    SignalSemaphore        ResPrgProtection;/* protection for above        */
  129.         BPTR            SegList;      /* Pointer to loaded libcode (a BPTR).    */
  130.         };
  131.  
  132. /*
  133.  ************************************************************************
  134.  *    The following is here *ONLY* for information and for        *
  135.  *    compatibility with MANX.  DO NOT use in new code!        *
  136.  ************************************************************************
  137.  */
  138. #ifdef    ARP_PRIVATE
  139. struct EnvBase {
  140.     struct    Library    LibNode;    /* Standard library node for linkage    */
  141.         BYTE    *EnvSpace;    /* Access only when Forbidden!        */
  142.         ULONG    EnvSize;    /* Total allocated mem for EnvSpace    */
  143.     struct    ArpBase    *ArpBase;    /* Added in V32 for Resource Tracking    */
  144.         };
  145. #endif    /* ARP_PRIVATE */
  146.  
  147. /*
  148.  ************************************************************************
  149.  *    These are used in release 33.4 but not by the library code.    *
  150.  *    Instead, individual programs check for these flags.        *
  151.  ************************************************************************
  152.  */
  153. #define    ARPB_WILD_WORLD 0L        ; Mixed BCPL/Normal wildcards.
  154. #define    ARPB_WILD_BCPL  1L        ; Pure BCPL wildcards.
  155.  
  156. #define    ARPF_WILD_WORLD (1L << ARPB_WILD_WORLD)
  157. #define    ARPF_WILD_BCPL  (1L << ARPB_WILD_BCPL)
  158.  
  159. /*
  160.  ************************************************************************
  161.  * The alert object is what you use if you really must return an alert    *
  162.  * to the user. You would normally OR this with another alert number    *
  163.  * from the alerts.h file. Generally, should be NON deadend alerts.    *
  164.  *                                    *
  165.  * For example, if you can't open ArpLibrary:                *
  166.  *    Alert( (AG_OpenLib|AO_ArpLib), 0L);                *
  167.  ************************************************************************
  168.  */
  169. #define    AO_ArpLib    0x00008036L        /* Alert object */
  170.  
  171. /*
  172.  ************************************************************************
  173.  *    Alerts that arp.library may return...                *
  174.  ************************************************************************
  175.  */
  176. #define    AN_ArpLib    0x03600000L    /* Alert number                */
  177. #define    AN_ArpNoMem    0x03610000L    /* No more memory            */
  178. #define    AN_ArpInputMem    0x03610002L    /* No memory for input buffer        */
  179. #define    AN_ArpNoMakeEnv    0x83610003L    /* No memory to make EnvLib        */
  180.  
  181. #define    AN_ArpNoDOS    0x83630001L    /* Can't open dos.library        */
  182. #define    AN_ArpNoGfx    0x83630002L    /* Can't open graphics.library        */
  183. #define    AN_ArpNoIntuit    0x83630003L    /* Can't open intuition            */
  184. #define    AN_BadPackBlues    0x83640000L    /* Bad packet returned to SendPacket()    */
  185. #define    AN_Zombie    0x83600003L    /* Zombie roaming around system        */
  186.  
  187. #define    AN_ArpScattered    0x83600002L    /* Scatter loading not allowed for arp    */
  188.  
  189.  
  190. /*
  191.  ************************************************************************
  192.  *    Return codes you can get from calling ARP Assign()...        *
  193.  ************************************************************************
  194.  */
  195. #define    ASSIGN_OK    0L    /* Everything is cool and groovey            */
  196. #define    ASSIGN_NODEV    1L    /* "Physical" is not valid for assignment        */
  197. #define    ASSIGN_FATAL    2L    /* Something really icky happened            */
  198. #define    ASSIGN_CANCEL    3L    /* Tried to cancel something but it won't cancel    */
  199.  
  200. /*
  201.  ************************************************************************
  202.  *    Size of buffer you need if you are going to call ReadLine()    *
  203.  ************************************************************************
  204.  */
  205. #define    MaxInputBuf    256L
  206.  
  207. /*
  208.  ************************************************************************
  209.  *    The ARP file requester data structure...            *
  210.  ************************************************************************
  211.  */
  212.  
  213.     /* This whole part has to be skipped if libraries/asl.h is
  214.      * pulled in before arpbase.h is included (which is the recommended
  215.      * sequence). -olsen
  216.      */
  217.  
  218. #ifndef LIBRARIES_ASL_H
  219. #define LIBRARIES_ASL_H 1    /* mool: don't use libraries/asl.h */
  220.  
  221.     /* You know req.library? -olsen */
  222.  
  223. #ifndef REQLIBRARY_H    
  224.  
  225. struct FileRequester    {
  226.             BYTE    *fr_Hail;        /* Hailing text            */
  227.             BYTE    *fr_File;        /* Filename array (FCHARS + 1)    */
  228.             BYTE    *fr_Dir;        /* Directory array (DSI