home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / vim / part23 < prev    next >
Text File  |  1993-04-24  |  53KB  |  1,253 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v37i023:  vim - Vi IMitation editor v1.27, Part23/24
  4. Message-ID: <1993Apr25.013920.23511@sparky.imd.sterling.com>
  5. X-Md4-Signature: 043a0530b5790b097ccd898e6d7736f2
  6. Date: Sun, 25 Apr 1993 01:39:20 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: mool@oce.nl (Bram Moolenaar)
  10. Posting-number: Volume 37, Issue 23
  11. Archive-name: vim/part23
  12. Environment: UNIX, AMIGA, MS-DOS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 23 (of 23)."
  21. # Contents:  vim/src/arpbase.h
  22. # Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:14 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'vim/src/arpbase.h' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'vim/src/arpbase.h'\"
  26. else
  27. echo shar: Extracting \"'vim/src/arpbase.h'\" \(49786 characters\)
  28. sed "s/^X//" >'vim/src/arpbase.h' <<'END_OF_FILE'
  29. X#ifndef    LIBRARIES_ARPBASE_H
  30. X#define    LIBRARIES_ARPBASE_H 1
  31. X
  32. X/*
  33. X ************************************************************************
  34. X *                                    *
  35. X * 5/3/89    ARPbase.h    by MKSoft from ARPbase.i by SDB        *
  36. X *                                    *
  37. X ************************************************************************
  38. X *                                    *
  39. X *    AmigaDOS Resource Project -- Library Include File        *
  40. X *                     for Lattice C 5.x or Manx C 5.x    *
  41. X *                                    *
  42. X ************************************************************************
  43. X *                                    *
  44. X *    Copyright (c) 1987/1988/1989 by Scott Ballantyne        *
  45. X *                                    *
  46. X *    The arp.library, and related code and files may be freely used    *
  47. X *    by supporters of ARP.  Modules in the arp.library may not be    *
  48. X *    extracted for use in independent code, but you are welcome to    *
  49. X *    provide the arp.library with your work and call on it freely.    *
  50. X *                                    *
  51. X *    You are equally welcome to add new functions, improve the ones    *
  52. X *    within, or suggest additions.                    *
  53. X *                                    *
  54. X *    BCPL programs are not welcome to call on the arp.library.    *
  55. X *    The welcome mat is out to all others.                *
  56. X *                                    *
  57. X ************************************************************************
  58. X *                                    *
  59. X * N O T E !  You MUST! have IoErr() defined as LONG to use LastTracker *
  60. X *          If your compiler has other defines for this, you may wish *
  61. X *          to remove the prototype for IoErr() from this file.    *
  62. X *                                    *
  63. X ************************************************************************
  64. X */
  65. X
  66. X/*
  67. X ************************************************************************
  68. X *    First we need to include the Amiga Standard Include files...    *
  69. X ************************************************************************
  70. X */
  71. X#ifndef    EXEC_TYPES_H
  72. X#include <exec/types.h>
  73. X#endif    /* EXEC_TYPES_H */
  74. X
  75. X#ifndef    EXEC_LISTS_H
  76. X#include <exec/lists.h>
  77. X#endif    /* EXEC_LISTS_H */
  78. X
  79. X#ifndef    EXEC_ALERTS_H
  80. X#include <exec/alerts.h>
  81. X#endif    /* EXEC_ALERTS_H */
  82. X
  83. X#ifndef    EXEC_LIBRARIES_H
  84. X#include <exec/libraries.h>
  85. X#endif    /* EXEC_LIBRARIES_H */
  86. X
  87. X#ifndef    EXEC_SEMAPHORES_H
  88. X#include <exec/semaphores.h>
  89. X#endif    /* EXEC_SEMAPHORES_H */
  90. X
  91. X#ifndef    LIBRARIES_DOS_H
  92. X#include <libraries/dosextens.h>
  93. X#endif    /* LIBRARIES_DOS_H */
  94. X
  95. X/*
  96. X ************************************************************************
  97. X *    Check for MANX/Lattice and define the differences...        *
  98. X ************************************************************************
  99. X *    At the moment MANX 3.6 does not have prototypes or the        *
  100. X *    wonderful #pragma statements of Lattice 5.0...            *
  101. X *    And, no __stdargs in MANX either...                *
  102. X ************************************************************************
  103. X */
  104. X#ifdef    AZTEC_C
  105. X
  106. X    /* Do we have an old 3.6a compiler? -olsen */
  107. X
  108. X#ifndef __VERSION
  109. X#define __VERSION 360
  110. X#endif    /* __VERSION */
  111. X
  112. X    /* If this is an old compiler, don't confuse it with
  113. X     * ANSI prototypes and pragmas. -olsen
  114. X     */
  115. X
  116. X#if __VERSION < 500
  117. X#define    NO_PRAGMAS    1
  118. X#define NO_PROTOTYPES    1
  119. X#endif    /* __VERSION */
  120. X
  121. X#define    C_Args
  122. X
  123. X#endif    /* AZTEC_C */
  124. X
  125. X#ifdef    LATTICE
  126. X
  127. X#define    C_Args    __stdargs
  128. X
  129. X#endif    /* LATTICE */
  130. X
  131. X/*
  132. X ************************************************************************
  133. X *    Standard definitions for arp library information        *
  134. X ************************************************************************
  135. X */
  136. X#define    ArpName        "arp.library"    /* Name of library... */
  137. X#define    ArpVersion    39L        /* Current version... */
  138. X
  139. X/*
  140. X ************************************************************************
  141. X *    The current ARP library node...                    *
  142. X ************************************************************************
  143. X */
  144. Xstruct    ArpBase    {
  145. X    struct    Library            LibNode;     /* Standard library node        */
  146. X        APTR            DosRootNode;     /* Copy of dl_Root            */
  147. X        UBYTE            Flags;         /* See bitdefs below            */
  148. X        UBYTE            ESCChar;      /* Character to be used for escaping    */
  149. X        LONG            ArpReserved1;     /* ArpLib's use only!!            */
  150. X    struct    Library            *EnvBase;      /* Dummy library for MANX compatibility*/
  151. X    struct    Library            *DosBase;      /* Cached DosBase            */
  152. X    struct    Library            *GfxBase;      /* Cached GfxBase            */
  153. X    struct    Library            *IntuiBase;     /* Cached IntuitionBase        */
  154. X    struct    MinList            ResLists;     /* Resource trackers            */
  155. X    struct    ResidentProgramNode    *ResidentPrgList;/* Resident Programs.            */
  156. X    struct    SignalSemaphore        ResPrgProtection;/* protection for above        */
  157. X        BPTR            SegList;      /* Pointer to loaded libcode (a BPTR).    */
  158. X        };
  159. X
  160. X/*
  161. X ************************************************************************
  162. X *    The following is here *ONLY* for information and for        *
  163. X *    compatibility with MANX.  DO NOT use in new code!        *
  164. X ************************************************************************
  165. X */
  166. X#ifdef    ARP_PRIVATE
  167. Xstruct EnvBase {
  168. X    struct    Library    LibNode;    /* Standard library node for linkage    */
  169. X        BYTE    *EnvSpace;    /* Access only when Forbidden!        */
  170. X        ULONG    EnvSize;    /* Total allocated mem for EnvSpace    */
  171. X    struct    ArpBase    *ArpBase;    /* Added in V32 for Resource Tracking    */
  172. X        };
  173. X#endif    /* ARP_PRIVATE */
  174. X
  175. X/*
  176. X ************************************************************************
  177. X *    These are used in release 33.4 but not by the library code.    *
  178. X *    Instead, individual programs check for these flags.        *
  179. X ************************************************************************
  180. X */
  181. X#define    ARPB_WILD_WORLD 0L        ; Mixed BCPL/Normal wildcards.
  182. X#define    ARPB_WILD_BCPL  1L        ; Pure BCPL wildcards.
  183. X
  184. X#define    ARPF_WILD_WORLD (1L << ARPB_WILD_WORLD)
  185. X#define    ARPF_WILD_BCPL  (1L << ARPB_WILD_BCPL)
  186. X
  187. X/*
  188. X ************************************************************************
  189. X * The alert object is what you use if you really must return an alert    *
  190. X * to the user. You would normally OR this with another alert number    *
  191. X * from the alerts.h file. Generally, should be NON deadend alerts.    *
  192. X *                                    *
  193. X * For example, if you can't open ArpLibrary:                *
  194. X *    Alert( (AG_OpenLib|AO_ArpLib), 0L);                *
  195. X ************************************************************************
  196. X */
  197. X#define    AO_ArpLib    0x00008036L        /* Alert object */
  198. X
  199. X/*
  200. X ************************************************************************
  201. X *    Alerts that arp.library may return...                *
  202. X ************************************************************************
  203. X */
  204. X#define    AN_ArpLib    0x03600000L    /* Alert number                */
  205. X#define    AN_ArpNoMem    0x03610000L    /* No more memory            */
  206. X#define    AN_ArpInputMem    0x03610002L    /* No memory for input buffer        */
  207. X#define    AN_ArpNoMakeEnv    0x83610003L    /* No memory to make EnvLib        */
  208. X
  209. X#define    AN_ArpNoDOS    0x83630001L    /* Can't open dos.library        */
  210. X#define    AN_ArpNoGfx    0x83630002L    /* Can't open graphics.library        */
  211. X#define    AN_ArpNoIntuit    0x83630003L    /* Can't open intuition            */
  212. X#define    AN_BadPackBlues    0x83640000L    /* Bad packet returned to SendPacket()    */
  213. X#define    AN_Zombie    0x83600003L    /* Zombie roaming around system        */
  214. X
  215. X#define    AN_ArpScattered    0x83600002L    /* Scatter loading not allowed for arp    */
  216. X
  217. X
  218. X/*
  219. X ************************************************************************
  220. X *    Return codes you can get from calling ARP Assign()...        *
  221. X ************************************************************************
  222. X */
  223. X#define    ASSIGN_OK    0L    /* Everything is cool and groovey            */
  224. X#define    ASSIGN_NODEV    1L    /* "Physical" is not valid for assignment        */
  225. X#define    ASSIGN_FATAL    2L    /* Something really icky happened            */
  226. X#define    ASSIGN_CANCEL    3L    /* Tried to cancel something but it won't cancel    */
  227. X
  228. X/*
  229. X ************************************************************************
  230. X *    Size of buffer you need if you are going to call ReadLine()    *
  231. X ************************************************************************
  232. X */
  233. X#define    MaxInputBuf    256L
  234. X
  235. X/*
  236. X ************************************************************************
  237. X *    The ARP file requester data structure...            *
  238. X ************************************************************************
  239. X */
  240. X
  241. X    /* This whole part has to be skipped if libraries/asl.h is
  242. X     * pulled in before arpbase.h is included (which is the recommended
  243. X     * sequence). -olsen
  244. X     */
  245. X
  246. X#ifndef LIBRARIES_ASL_H
  247. X#define LIBRARIES_ASL_H 1    /* mool: don't use libraries/asl.h */
  248. X
  249. X    /* You know req.library? -olsen */
  250. X
  251. X#ifndef REQLIBRARY_H    
  252. X
  253. Xstruct FileRequester    {
  254. X            BYTE    *fr_Hail;        /* Hailing text            */
  255. X            BYTE    *fr_File;        /* Filename array (FCHARS + 1)    */
  256. X            BYTE    *fr_Dir;        /* Directory array (DSIZE + 1)    */
  257. X        struct    Window    *fr_Window;        /* Window requesting or NULL    */
  258. X            UBYTE    fr_FuncFlags;        /* Set bitdef's below        */
  259. X            UBYTE    fr_Flags2;        /* New flags...            */
  260. X            VOID    (*fr_Function)();    /* Your function, see bitdef's    */
  261. X            WORD    fr_LeftEdge;        /* To be used later...        */
  262. X            WORD    fr_TopEdge;
  263. X            };
  264. X
  265. X#endif    /* REQLIBRARY_H */
  266. X
  267. X/*
  268. X ************************************************************************
  269. X * The following are the defines for fr_FuncFlags.  These bits tell    *
  270. X * FileRequest() what your fr_UserFunc is expecting, and what        *
  271. X * FileRequest() should call it for.                    *
  272. X *                                    *
  273. X * You are called like so:                        *
  274. X * fr_Function(Mask, Object)                        *
  275. X * ULONG    Mask;                            *
  276. X * CPTR        *Object;                        *
  277. X *                                    *
  278. X * The Mask is a copy of the flag value that caused FileRequest() to    *
  279. X * call your function. You can use this to determine what action you    *
  280. X * need to perform, and exactly what Object is, so you know what to do    *
  281. X * and what to return.                            *
  282. X ************************************************************************
  283. X */
  284. X#define    FRB_DoWildFunc    7L /* Call me with a FIB and a name, ZERO return accepts.    */
  285. X#define    FRB_DoMsgFunc    6L /* You get all IDCMP messages not for FileRequest()        */
  286. X#define    FRB_DoColor    5L /* Set this bit for that new and different look        */
  287. X#define    FRB_NewIDCMP    4L /* Force a new IDCMP (only if fr_Window != NULL)        */
  288. X#define    FRB_NewWindFunc    3L /* You get to modify the newwindow structure.        */
  289. X#define    FRB_AddGadFunc    2L /* You get to add gadgets.                    */
  290. X#define    FRB_GEventFunc    1L /* Function to call if one of your gadgets is selected.    */
  291. X#define    FRB_ListFunc    0L /* Not implemented yet.                    */
  292. X
  293. X#define    FRF_DoWildFunc    (1L << FRB_DoWildFunc)
  294. X#define    FRF_DoMsgFunc    (1L << FRB_DoMsgFunc)
  295. X#define    FRF_DoColor    (1L << FRB_DoColor)
  296. X#define    FRF_NewIDCMP    (1L << FRB_NewIDCMP)
  297. X#define    FRF_NewWindFunc    (1L << FRB_NewWindFunc)
  298. X#define    FRF_AddGadFunc    (1L << FRB_AddGadFunc)
  299. X#define    FRF_GEventFunc    (1L << FRB_GEventFunc)
  300. X#define    FRF_ListFunc    (1L << FRB_ListFunc)
  301. X
  302. X/*
  303. X ************************************************************************
  304. X * The FR2B_ bits are for fr_Flags2 in the file requester structure    *
  305. X ************************************************************************
  306. X */
  307. X#define    FR2B_LongPath    0L /* Specify the fr_Dir buffer is 256 bytes long */
  308. X
  309. X#define    FR2F_LongPath    (1L << FR2B_LongPath)
  310. X
  311. X/*
  312. X ************************************************************************
  313. X *    The sizes of the different buffers...                *
  314. X ************************************************************************
  315. X */
  316. X#define    FCHARS        32L    /* Filename size                */
  317. X#define    DSIZE        33L    /* Directory name size if not FR2B_LongPath    */
  318. X
  319. X#define    LONG_DSIZE    254L    /* If FR2B_LongPath is set, use LONG_DSIZE    */
  320. X#define    LONG_FSIZE    126L    /* For compatibility with ARPbase.i        */
  321. X
  322. X#define    FR_FIRST_GADGET    0x7680L    /* User gadgetID's must be less than this value    */
  323. X
  324. X#endif    /* LIBRARIES_ASL_H */
  325. X
  326. X#ifndef DOS_DOSASL_H        /* mool: either this or dos/dosasl.h */
  327. X#define DOS_DOSASL_H
  328. X/*
  329. X ************************************************************************
  330. X * Structure expected by FindFirst()/FindNext()                *
  331. X *                                    *
  332. X * You need to allocate this structure and initialize it as follows:    *
  333. X *                                    *
  334. X * Set ap_BreakBits to the signal bits (CDEF) that you want to take a    *
  335. X * break on, or NULL, if you don't want to convenience the user.    *
  336. X *                                    *
  337. X * if you want to have the FULL PATH NAME of the files you found,    *
  338. X * allocate a buffer at the END of this structure, and put the size of    *
  339. X * it into ap_StrLen.  If you don't want the full path name, make sure    *
  340. X * you set ap_StrLen to zero.  In this case, the name of the file, and    *
  341. X * stats are available in the ap_Info, as per usual.            *
  342. X *                                    *
  343. X * Then call FindFirst() and then afterwards, FindNext() with this    *
  344. X * structure.  You should check the return value each time (see below)    *
  345. X * and take the appropriate action, ultimately calling            *
  346. X * FreeAnchorChain() when there are no more files and you are done.    *
  347. X * You can tell when you are done by checking for the normal AmigaDOS    *
  348. X * return code ERROR_NO_MORE_ENTRIES.                    *
  349. X *                                    *
  350. X * You will also have to check the DirEntryType variable in the ap_Info    *
  351. X * structure to determine what exactly you have received.        *
  352. X ************************************************************************
  353. X */
  354. Xstruct    AnchorPath    {
  355. X        struct    AChain        *ap_Base;    /* Pointer to first anchor            */
  356. X        struct    AChain        *ap_Last;    /* Pointer to last anchor            */
  357. X            LONG        ap_BreakBits;    /* Bits to break on                */
  358. X            LONG        ap_FoundBreak;    /* Bits we broke on. Also returns ERROR_BREAK    */
  359. X            BYTE        ap_Flags;    /* New use for the extra word...        */
  360. X            BYTE        ap_Reserved;    /* To fill it out...                */
  361. X            WORD        ap_StrLen;    /* This is what used to be ap_Length        */
  362. X        struct    FileInfoBlock    ap_Info;
  363. X            BYTE        ap_Buf[1];    /* Allocate a buffer here, if desired        */
  364. X            };
  365. X
  366. X#define ap_Length ap_StrLen
  367. X
  368. X/*
  369. X ************************************************************************
  370. X *    Bit definitions for the new ap_Flags...                *
  371. X ************************************************************************
  372. X */
  373. X#define    APB_DoWild    0L    /* User option ALL                */
  374. X#define    APB_ItsWild    1L    /* Set by FindFirst, used by FindNext        */
  375. X#define    APB_DoDir    2L    /* Bit is SET if a DIR node should be entered    */
  376. X                /* Application can RESET this bit to AVOID    */
  377. X                /* entering a dir.                */
  378. X#define    APB_DidDir    3L    /* Bit is set for an "expired" dir node        */
  379. X#define    APB_NoMemErr    4L    /* Set if there was not enough memory        */
  380. X#define    APB_DoDot    5L    /* If set, '.' (DOT) will convert to CurrentDir    */
  381. X
  382. X#define    APF_DoWild    (1L << APB_DoWild)
  383. X#define    APF_ItsWild    (1L << APB_ItsWild)
  384. X#define    APF_DoDir    (1L << APB_DoDir)
  385. X#define    APF_DidDir    (1L << APB_DidDir)
  386. X#define    APF_NoMemErr    (1L << APB_NoMemErr)
  387. X#define    APF_DoDot    (1L << APB_DoDot)
  388. X
  389. X/*
  390. X ************************************************************************
  391. X * Structure used by the pattern matching functions, no need to obtain,    *
  392. X * diddle or allocate this yourself.                    *
  393. X *                                    *
  394. X * Note:  If you did, you will now break as it has changed...        *
  395. X ************************************************************************
  396. X */
  397. X#ifdef    ARP_PRIVATE
  398. Xstruct    AChain    {
  399. X    struct    AChain        *an_Child;
  400. X    struct    AChain        *an_Parent;
  401. X    struct    FileLock    *an_Lock;
  402. X    struct    FileInfoBlock    *an_Info;
  403. X        BYTE        an_Flags;
  404. X        char        an_String[1];    /* Just as is .i file    */
  405. X        };                /* ???  Don't use this!    */
  406. X#endif    /* ARP_PRIVATE */
  407. X
  408. X#define    DDB_PatternBit    0L
  409. X#define    DDB_ExaminedBit    1L
  410. X#define    DDB_Completed    2L
  411. X#define    DDB_AllBit    3L
  412. X
  413. X#define    DDF_PatternBit    (1L << DDB_PatternBit)
  414. X#define    DDF_ExaminedBit    (1L << DDB_ExaminedBit)
  415. X#define    DDF_Completed    (1L << DDB_Completed)
  416. X#define    DDF_AllBit    (1L << DDB_AllBit)
  417. X
  418. X/*
  419. X ************************************************************************
  420. X * This structure takes a pointer, and returns FALSE if wildcard was    *
  421. X * not found by FindFirst()                        *
  422. X ************************************************************************
  423. X */
  424. X#define    IsWild( ptr )        ( *((LONG *)(ptr)) )
  425. X
  426. X/*
  427. X ************************************************************************
  428. X * Constants used by wildcard routines                    *
  429. X *                                    *
  430. X * These are the pre-parsed tokens referred to by pattern match.  It    *
  431. X * is not necessary for you to do anything about these, FindFirst()    *
  432. X * FindNext() handle all these for you.                    *
  433. X ************************************************************************
  434. X */
  435. X#define    P_ANY        0x80L    /* Token for '*' | '#?'    */
  436. X#define    P_SINGLE    0x81L    /* Token for '?'    */
  437. X
  438. X/*
  439. X ************************************************************************
  440. X * No need to muck with these as they may change...            *
  441. X ************************************************************************
  442. X */
  443. X#ifdef    ARP_PRIVATE
  444. X#define    P_ORSTART    0x82L    /* Token for '('    */
  445. X#define    P_ORNEXT    0x83L    /* Token for '|'    */
  446. X#define    P_OREND        0x84L    /* Token for ')'    */
  447. X#define    P_NOT        0x85L    /* Token for '~'    */
  448. X#define    P_NOTCLASS    0x87L    /* Token for '^'    */
  449. X#define    P_CLASS        0x88L    /* Token for '[]'    */
  450. X#define    P_REPBEG    0x89L    /* Token for '['    */
  451. X#define    P_REPEND    0x8AL    /* Token for ']'    */
  452. X#endif    /* ARP_PRIVATE */
  453. X
  454. X#define    ERROR_BUFFER_OVERFLOW    303L    /* User or internal buffer overflow    */
  455. X#define    ERROR_BREAK        304L    /* A break character was received    */
  456. X#define    ERROR_NOT_EXECUTABLE    305L    /* A file has E bit cleared        */
  457. X    /* dos/dosasl.h uses a good lot of the symbols and structures
  458. X     * defined here (AnchorPatch, AChain, ERROR_BREAK and the
  459. X     * like), so let's don't include it again.
  460. X     */
  461. X
  462. X/* #define DOS_DOSASL_H 1 */
  463. X#endif    /* added by mool */
  464. X
  465. X/*
  466. X ************************************************************************
  467. X * Structure used by AddDANode(), AddDADevs(), FreeDAList().        *
  468. X *                                    *
  469. X * This structure is used to create lists of names, which normally    *
  470. X * are devices, assigns, volumes, files, or directories.        *
  471. X ************************************************************************
  472. X */
  473. Xstruct    DirectoryEntry    {
  474. X        struct    DirectoryEntry    *de_Next;    /* Next in list                */
  475. X            BYTE        de_Type;    /* DLX_mumble                */
  476. X            BYTE        de_Flags;    /* For future expansion, DO NOT USE!    */
  477. X            BYTE        de_Name[1];    /* The name of the thing found        */
  478. X            };
  479. X
  480. X/*
  481. X ************************************************************************
  482. X * Defines you use to get a list of the devices you want to look at.    *
  483. X * For example, to get a list of all directories and volumes, do:    *
  484. X *                                    *
  485. X *    AddDADevs( mydalist, (DLF_DIRS | DLF_VOLUMES) )            *
  486. X *                                    *
  487. X * After this, you can examine the de_type field of the elements added    *
  488. X * to your list (if any) to discover specifics about the objects added.    *
  489. X *                                    *
  490. X * Note that if you want only devices which are also disks, you must    *
  491. X * (DLF_DEVICES | DLF_DISKONLY).                    *
  492. X ************************************************************************
  493. X */
  494. X#define    DLB_DEVICES    0L    /* Return devices                */
  495. X#define    DLB_DISKONLY    1L    /* Modifier for above: Return disk devices only    */
  496. X#define    DLB_VOLUMES    2L    /* Return volumes only                */
  497. X#define    DLB_DIRS    3L    /* Return assigned devices only            */
  498. X
  499. X#define    DLF_DEVICES    (1L << DLB_DEVICES)
  500. X#define    DLF_DISKONLY    (1L << DLB_DISKONLY)
  501. X#define    DLF_VOLUMES    (1L << DLB_VOLUMES)
  502. X#define    DLF_DIRS    (1L << DLB_DIRS)
  503. X
  504. X/*
  505. X ************************************************************************
  506. X * Legal de_Type values, check for these after a call to AddDADevs(),    *
  507. X * or use on your own as the ID values in AddDANode().            *
  508. X ************************************************************************
  509. X */
  510. X#define    DLX_FILE    0L    /* AddDADevs() can't determine this    */
  511. X#define    DLX_DIR        8L    /* AddDADevs() can't determine this    */
  512. X#define    DLX_DEVICE    16L    /* It's a resident device        */
  513. X
  514. X#define    DLX_VOLUME    24L    /* Device is a volume            */
  515. X#define    DLX_UNMOUNTED    32L    /* Device is not resident        */
  516. X
  517. X#define    DLX_ASSIGN    40L    /* Device is a logical assignment    */
  518. X
  519. X/*
  520. X ************************************************************************
  521. X *    This macro is to check for an error return from the Atol()    *
  522. X *    routine.  If Errno is ERRBADINT, then there was an error...    *
  523. X *    This was done to try to remain as close to source compatible    *
  524. X *    as possible with the older (rel 1.1) ARPbase.h            *
  525. X ************************************************************************
  526. X */
  527. X#define    ERRBADINT    1L
  528. X#define    Errno        (IoErr() ? ERRBADINT : 0)
  529. X
  530. X/*
  531. X ************************************************************************
  532. X *    Resource Tracking stuff...                    *
  533. X ************************************************************************
  534. X *                                    *
  535. X * There are a few things in arp.library that are only directly        *
  536. X * acessable from assembler.  The glue routines provided by us for    *
  537. X * all 'C' compilers use the following conventions to make these    *
  538. X * available to C programs.  The glue for other language's should use    *
  539. X * as similar a mechanism as possible, so that no matter what language    *
  540. X * or compiler we speak, when talk about arp, we will know what the    *
  541. X * other guy is saying.                            *
  542. X *                                    *
  543. X * Here are the cases:                            *
  544. X *                                    *
  545. X * Tracker calls...                            *
  546. X *        These calls return the Tracker pointer as a secondary    *
  547. X *        result in the register A1.  For C, there is no clean    *
  548. X *        way to return more than one result so the tracker    *
  549. X *        pointer is returned in IoErr().  For ease of use,    *
  550. X *        there is a define that typecasts IoErr() to the correct    *
  551. X *        pointer type.  This is called LastTracker and should    *
  552. X *        be source compatible with the earlier method of storing    *
  553. X *        the secondary result.                    *
  554. X *                                    *
  555. X * GetTracker() -                            *
  556. X *        Syntax is a bit different for C than the assembly call    *
  557. X *        The C syntax is GetTracker(ID).  The binding routines    *
  558. X *        will store the ID into the tracker on return.  Also,    *
  559. X *        in an effort to remain consistant, the tracker will    *
  560. X *        also be stored in LastTracker.                *
  561. X *                                    *
  562. X * In cases where you have allocated a tracker before you have obtained    *
  563. X * a resource (usually the most efficient method), and the resource has    *
  564. X * not been obtained, you will need to clear the tracker id.  The macro    *
  565. X * CLEAR_ID() has been provided for that purpose.  It expects a pointer    *
  566. X * to a DefaultTracker sort of struct.                    *
  567. X ************************************************************************
  568. X */
  569. X#define    CLEAR_ID(t)    ((SHORT *) t)[-1]=NULL
  570. X
  571. X/*
  572. X ************************************************************************
  573. X * You MUST prototype IoErr() to prevent the possible error in defining    *
  574. X * IoErr() and thus causing LastTracker to give you trash...        *
  575. X *                                    *
  576. X * N O T E !  You MUST! have IoErr() defined as LONG to use LastTracker *
  577. X *          If your compiler has other defines for this, you may wish *
  578. X *          to remove the prototype for IoErr().            *
  579. X ************************************************************************
  580. X */
  581. X#define    LastTracker    ((struct DefaultTracker *)IoErr())
  582. X
  583. X/*
  584. X ************************************************************************
  585. X * The rl_FirstItem list (ResList) is a list of TrackedResource (below)    *
  586. X * It is very important that nothing in this list depend on the task    *
  587. X * existing at resource freeing time (i.e., RemTask(0L) type stuff,    *
  588. X * DeletePort() and the rest).                        *
  589. X *                                    *
  590. X * The tracking functions return a struct Tracker *Tracker to you, this    *
  591. X * is a pointer to whatever follows the tr_ID variable.            *
  592. X * The default case is reflected below, and you get it if you call    *
  593. X * GetTracker() ( see DefaultTracker below).                *
  594. X *                                    *
  595. X * NOTE: The two user variables mentioned in an earlier version don't    *
  596. X * exist, and never did. Sorry about that (SDB).            *
  597. X *                                    *
  598. X * However, you can still use ArpAlloc() to allocate your own tracking    *
  599. X * nodes and they can be any size or shape you like, as long as the    *
  600. X * base structure is preserved. They will be freed automagically just    *
  601. X * like the default trackers.                        *
  602. X ************************************************************************
  603. X */
  604. Xstruct    TrackedResource    {
  605. X        struct    MinNode    tr_Node;    /* Double linked pointer        */
  606. X            BYTE    tr_Flags;    /* Don't touch                */
  607. X            BYTE    tr_Lock;    /* Don't touch, for Get/FreeAccess()    */
  608. X            SHORT    tr_ID;        /* Item's ID                */
  609. X
  610. X/*
  611. X ************************************************************************
  612. X * The struct DefaultTracker *Tracker portion of the structure.        *
  613. X * The stuff below this point can conceivably vary, depending        *
  614. X * on user needs, etc.  This reflects the default.            *
  615. X ************************************************************************
  616. X */
  617. X            union    {
  618. X                CPTR    tr_Resource;    /* Whatever                */
  619. X                    LONG    tg_Verify;    /* For use during TRAK_GENERIC        */
  620. X                }    tr_Object;    /* The thing being tracked        */
  621. X            union    {
  622. X                VOID    (*tg_Function)();/* Function to call for TRAK_GENERIC    */
  623. X            struct    Window    *tr_Window2;    /* For TRAK_WINDOW            */
  624. X                }    tr_Extra;    /* Only needed sometimes        */
  625. X            };
  626. X
  627. X#define    tg_Value tg_Verify    /* Ancient compatibility only!  Do NOT use in new CODE!!! */
  628. X
  629. X/*
  630. X ************************************************************************
  631. X * You get a pointer to a struct of the following type when you call    *
  632. X * GetTracker().  You can change this, and use ArpAlloc() instead of    *
  633. X * GetTracker() to do tracking. Of course, you have to take a wee bit    *
  634. X * more responsibility if you do, as well as if you use TRAK_GENERIC    *
  635. X * stuff.                                *
  636. X *                                    *
  637. X * TRAK_GENERIC folks need to set up a task function to be called when    *
  638. X * an item is freed.  Some care is required to set this up properly.    *
  639. X *                                    *
  640. X * Some special cases are indicated by the unions below, for        *
  641. X * TRAK_WINDOW, if you have more than one window opened, and don't    *
  642. X * want the IDCMP closed particularly, you need to set a ptr to the    *
  643. X * other window in dt_Window2.  See CloseWindowSafely() for more info.    *
  644. X * If only one window, set this to NULL.                *
  645. X ************************************************************************
  646. X */
  647. Xstruct    DefaultTracker    {
  648. X            union    {
  649. X                CPTR    dt_Resource;    /* Whatever                */
  650. X                LONG    tg_Verify;    /* For use during TRAK_GENERIC        */
  651. X                }    dt_Object;    /* The object being tracked        */
  652. X            union    {
  653. X                VOID    (*tg_Function)();/* Function to call for TRAK_GENERIC    */
  654. X            struct    Window    *dt_Window2;    /* For TRAK_WINDOW            */
  655. X                }    dt_Extra;
  656. X            };
  657. X
  658. X/*
  659. X ************************************************************************
  660. X *    Items the tracker knows what to do about            *
  661. X ************************************************************************
  662. X */
  663. X#define    TRAK_AAMEM    0L    /* Default (ArpAlloc) element        */
  664. X#define    TRAK_LOCK    1L    /* File lock                */
  665. X#define    TRAK_FILE    2L    /* Opened file                */
  666. X#define    TRAK_WINDOW    3L    /* Window -- see docs            */
  667. X#define    TRAK_SCREEN    4L    /* Screen                */
  668. X#define    TRAK_LIBRARY    5L    /* Opened library            */
  669. X#define    TRAK_DAMEM    6L    /* Pointer to DosAllocMem block        */
  670. X#define    TRAK_MEMNODE    7L    /* AllocEntry() node            */
  671. X#define    TRAK_SEGLIST    8L    /* Program segment            */
  672. X#define    TRAK_RESLIST    9L    /* ARP (nested) ResList            */
  673. X#define    TRAK_MEM    10L    /* Memory ptr/length            */
  674. X#define    TRAK_GENERIC    11L    /* Generic Element, your choice        */
  675. X#define    TRAK_DALIST    12L    /* DAlist ( aka file request )        */
  676. X#define    TRAK_ANCHOR    13L    /* Anchor chain (pattern matching)    */
  677. X#define    TRAK_FREQ    14L    /* FileRequest struct            */
  678. X#define    TRAK_FONT    15L    /* GfxBase CloseFont()            */
  679. X#define    TRAK_MAX    15L    /* Poof, anything higher is tossed    */
  680. X
  681. X#define    TRB_UNLINK    7L    /* Free node bit            */
  682. X#define    TRB_RELOC    6L    /* This may be relocated (not used yet)    */
  683. X#define    TRB_MOVED    5L    /* Item moved                */
  684. X
  685. X#define    TRF_UNLINK    (1L << TRB_UNLINK)
  686. X#define    TRF_RELOC    (1L << TRB_RELOC)
  687. X#define    TRF_MOVED    (1L << TRB_MOVED)
  688. X
  689. X/*
  690. X ************************************************************************
  691. X * Note: ResList MUST be a DosAllocMem'ed list!, this is done for    *
  692. X * you when you call CreateTaskResList(), typically, you won't need    *
  693. X * to access/allocate this structure.                    *
  694. X ************************************************************************
  695. X */
  696. Xstruct    ResList    {
  697. X    struct    MinNode        rl_Node;    /* Used by arplib to link reslists    */
  698. X    struct    Task        *rl_TaskID;    /* Owner of this list            */
  699. X    struct    MinList        rl_FirstItem;    /* List of Tracked Resources        */
  700. X    struct    ResList        *rl_Link;    /* SyncRun's use - hide list here    */
  701. X        };
  702. X
  703. X/*
  704. X ************************************************************************
  705. X *    Returns from CompareLock()                    *
  706. X ************************************************************************
  707. X */
  708. X#define    LCK_EQUAL    0L    /* The two locks refer to the same object    */
  709. X#define    LCK_VOLUME    1L    /* Locks are on the same volume            */
  710. X#define    LCK_DIFVOL1    2L    /* Locks are on different volumes        */
  711. X#define    LCK_DIFVOL2    3L    /* Locks are on different volumes        */
  712. X
  713. X/*
  714. X ************************************************************************
  715. X *    ASyncRun() stuff...                        *
  716. X ************************************************************************
  717. X * Message sent back on your request by an exiting process.        *
  718. X * You request this by putting the address of your message in        *
  719. X * pcb_LastGasp, and initializing the ReplyPort variable of your    *
  720. X * ZombieMsg to the port you wish the message posted to.        *
  721. X ************************************************************************
  722. X */
  723. Xstruct    ZombieMsg    {
  724. X        struct    Message        zm_ExecMessage;
  725. X            ULONG        zm_TaskNum;    /* Task ID            */
  726. X            LONG        zm_ReturnCode;    /* Process's return code    */
  727. X            ULONG        zm_Result2;    /* System return code        */
  728. X        struct    DateStamp    zm_ExitTime;    /* Date stamp at time of exit    */
  729. X            ULONG        zm_UserInfo;    /* For whatever you wish    */
  730. X            };
  731. X
  732. X/*
  733. X ************************************************************************
  734. X * Structure required by ASyncRun() -- see docs for more info.        *
  735. X ************************************************************************
  736. X */
  737. Xstruct    ProcessControlBlock    {
  738. X                ULONG        pcb_StackSize;    /* Stacksize for new process            */
  739. X                BYTE        pcb_Pri;    /* Priority of new task                */
  740. X                UBYTE        pcb_Control;    /* Control bits, see defines below        */
  741. X                APTR        pcb_TrapCode;    /* Optional Trap Code                */
  742. X                BPTR        pcb_Input;
  743. X                BPTR        pcb_Output;    /* Optional stdin, stdout            */
  744. X                union    {
  745. X                    BPTR    pcb_SplatFile;    /* File to use for Open("*")            */
  746. X                    BYTE    *pcb_ConName;    /* CON: filename                */
  747. X                    }    pcb_Console;
  748. X                CPTR        pcb_LoadedCode;    /* If not null, will not load/unload code    */
  749. X            struct    ZombieMsg    *pcb_LastGasp;    /* ReplyMsg() to be filled in by exit        */
  750. X            struct    MsgPort        *pcb_WBProcess;    /* Valid only when PRB_NOCLI            */
  751. X                };
  752. X
  753. X/*
  754. X ************************************************************************
  755. X * Formerly needed to pass NULLCMD to a child.  No longer needed.    *
  756. X * It is being kept here for compatibility only...            *
  757. X ************************************************************************
  758. X */
  759. X#define    NOCMD    "\n"
  760. X
  761. X/*
  762. X ************************************************************************
  763. X * The following control bits determine what ASyncRun() does on        *
  764. X * Abnormal Exits and on background process termination.        *
  765. X ************************************************************************
  766. X */
  767. X#define    PRB_SAVEIO    0L    /* Don't free/check file handles on exit    */
  768. X#define    PRB_CLOSESPLAT    1L    /* Close Splat file, must request explicitly    */
  769. X#define    PRB_NOCLI    2L    /* Don't create a CLI process            */
  770. X/*    PRB_INTERACTIVE    3L       This is now obsolete...            */
  771. X#define    PRB_CODE    4L    /* Dangerous yet enticing            */
  772. X#define    PRB_STDIO    5L    /* Do the stdio thing, splat = CON:Filename     */
  773. X
  774. X#define    PRF_SAVEIO    (1L << PRB_SAVEIO)
  775. X#define    PRF_CLOSESPLAT    (1L << PRB_CLOSESPLAT)
  776. X#define    PRF_NOCLI    (1L << PRB_NOCLI)
  777. X#define    PRF_CODE    (1L << PRB_CODE)
  778. X#define    PRF_STDIO    (1L << PRB_STDIO)
  779. X
  780. X/*
  781. X ************************************************************************
  782. X *    Error returns from SyncRun() and ASyncRun()            *
  783. X ************************************************************************
  784. X */
  785. X#define    PR_NOFILE    -1L    /* Could not LoadSeg() the file            */
  786. X#define    PR_NOMEM    -2L    /* No memory for something            */
  787. X/*    PR_NOCLI    -3L       This is now obsolete                */
  788. X#define    PR_NOSLOT    -4L    /* No room in TaskArray                */
  789. X#define    PR_NOINPUT    -5L    /* Could not open input file            */
  790. X#define    PR_NOOUTPUT    -6L    /* Could not get output file            */
  791. X/*    PR_NOLOCK    -7L       This is now obsolete                */
  792. X/*    PR_ARGERR    -8L       This is now obsolete                */
  793. X/*    PR_NOBCPL    -9L       This is now obsolete                */
  794. X/*    PR_BADLIB    -10L       This is now obsolete                */
  795. X#define    PR_NOSTDIO    -11L    /* Couldn't get stdio handles            */
  796. X
  797. X/*
  798. X ************************************************************************
  799. X *    Added V35 of arp.library                    *
  800. X ************************************************************************
  801. X */
  802. X#define    PR_WANTSMESSAGE    -12L    /* Child wants you to report IoErr() to user    */
  803. X                /* for SyncRun() only...            */
  804. X#define    PR_NOSHELLPROC    -13L    /* Can't create a shell/cli process        */
  805. X#define    PR_NOEXEC    -14L    /* 'E' bit is clear                */
  806. X#define    PR_SCRIPT    -15L    /* S and E are set, IoErr() contains directory    */
  807. X
  808. X/*
  809. X ************************************************************************
  810. X * Version 35 ASyncRun() allows you to create an independent        *
  811. X * interactive or background Shell/CLI. You need this variant of the    *
  812. X * pcb structure to do it, and you also have new values for nsh_Control,*
  813. X * see below.                                *
  814. X *                                    *
  815. X * Syntax for Interactive shell is:                    *
  816. X *                                    *
  817. X * rc=ASyncRun("Optional Window Name","Optional From File",&NewShell);    *
  818. X *                                    *
  819. X * Syntax for a background shell is:                    *
  820. X *                                    *
  821. X * rc=ASyncRun("Command line",0L,&NewShell);                *
  822. X *                                    *
  823. X * Same syntax for an Execute style call, but you have to be on drugs    *
  824. X * if you want to do that.                        *
  825. X ************************************************************************
  826. X */
  827. Xstruct    NewShell    {
  828. X            ULONG    nsh_StackSize;    /* stacksize shell will use for children    */
  829. X            BYTE    nsh_Pri;    /* ignored by interactive shells        */
  830. X            UBYTE    nsh_Control;    /* bits/values: see above            */
  831. X            CPTR    nsh_LogMsg;    /* Optional login message, if null, use default    */
  832. X            BPTR    nsh_Input;    /* ignored by interactive shells, but        */
  833. X            BPTR    nsh_Output;    /* used by background and execute options.    */
  834. X            LONG    nsh_RESERVED[5];
  835. X            };
  836. X
  837. X/*
  838. X ************************************************************************
  839. X * Bit Values for nsh_Control, you should use them as shown below, or    *
  840. X * just use the actual values indicated.                *
  841. X ************************************************************************
  842. X */
  843. X#define    PRB_CLI        0L    /* Do a CLI, not a shell    */
  844. X#define    PRB_BACKGROUND    1L    /* Background shell        */
  845. X#define    PRB_EXECUTE    2L    /* Do as EXECUTE...        */
  846. X#define    PRB_INTERACTIVE    3L    /* Run an interactive shell    */
  847. X#define    PRB_FB        7L    /* Alt function bit...        */
  848. X
  849. X#define    PRF_CLI        (1L << PRB_CLI)
  850. X#define    PRF_BACKGOUND    (1L << PRB_BACKGROUND)
  851. X#define    PRF_EXECUTE    (1L << PRB_EXECUTE)
  852. X#define    PRF_INTERACTIVE    (1L << PRB_INTERACTIVE)
  853. X#define    PRF_FB        (1L << PRB_FB)
  854. X
  855. X/*
  856. X ************************************************************************
  857. X *    Common values for sh_Control which allow you to do usefull    *
  858. X *    and somewhat "standard" things...                *
  859. X ************************************************************************
  860. X */
  861. X#define    INTERACTIVE_SHELL    (PRF_FB|PRF_INTERACTIVE)        /* Gimme a newshell!        */
  862. X#define    INTERACTIVE_CLI        (PRF_FB|PRF_INTERACTIVE|PRF_CLI)    /* Gimme that ol newcli!    */
  863. X#define    BACKGROUND_SHELL    (PRF_FB|PRF_BACKGROUND)            /* gimme a background shell    */
  864. X#define    EXECUTE_ME        (PRF_FB|PRF_BACKGROUND|PRF_EXECUTE)    /* aptly named, doncha think?    */
  865. X
  866. X/*
  867. X ************************************************************************
  868. X *    Additional IoErr() returns added by ARP...            *
  869. X ************************************************************************
  870. X */
  871. X#define    ERROR_NOT_CLI        400L    /* Program/function neeeds to be cli    */
  872. X
  873. X/*
  874. X ************************************************************************
  875. X *    Resident Program Support                    *
  876. X ************************************************************************
  877. X * This is the kind of node allocated for you when you AddResidentPrg()    *
  878. X * a code segment.  They are stored as a single linked list with the    *
  879. X * root in ArpBase.  If you absolutely *must* wander through this list    *
  880. X * instead of using the supplied functions, then you must first obtain    *
  881. X * the semaphore which protects this list, and then release it        *
  882. X * afterwards.  Do not use Forbid() and Permit() to gain exclusive    *
  883. X * access!  Note that the supplied functions handle this locking    *
  884. X * protocol for you.                            *
  885. X ************************************************************************
  886. X */
  887. Xstruct    ResidentProgramNode    {
  888. X            struct    ResidentProgramNode    *rpn_Next;    /* next or NULL            */
  889. X                LONG            rpn_Usage;    /* Number of current users    */
  890. X                UWORD            rpn_AccessCnt;    /* Total times used...        */
  891. X                ULONG            rpn_CheckSum;    /* Checksum of code        */
  892. X                BPTR            rpn_Segment;    /* Actual segment        */
  893. X                UWORD            rpn_Flags;    /* See definitions below...    */
  894. X                BYTE            rpn_Name[1];    /* Allocated as needed        */
  895. X                };
  896. X
  897. X/*
  898. X ************************************************************************
  899. X *    Bit definitions for rpn_Flags....                *
  900. X ************************************************************************
  901. X */
  902. X#define    RPNB_NOCHECK    0L    /* Set in rpn_Flags for no checksumming...    */
  903. X#define    RPNB_CACHE    1L    /* Private usage in v1.3...            */
  904. X
  905. X#define    RPNF_NOCHECK    (1L << RPNB_NOCHECK)
  906. X#define    RPNF_CACHE    (1L << RPNB_CACHE)
  907. X
  908. X/*
  909. X ************************************************************************
  910. X * If your program starts with this structure, ASyncRun() and SyncRun()    *
  911. X * will override a users stack request with the value in rpt_StackSize.    *
  912. X * Furthermore, if you are actually attached to the resident list, a    *
  913. X * memory block of size rpt_DataSize will be allocated for you, and    *
  914. X * a pointer to this data passed to you in register A4.  You may use    *
  915. X * this block to clone the data segment of programs, thus resulting in    *
  916. X * one copy of text, but multiple copies of data/bss for each process    *
  917. X * invocation.  If you are resident, your program will start at        *
  918. X * rpt_Instruction, otherwise, it will be launched from the initial    *
  919. X * branch.                                *
  920. X ************************************************************************
  921. X */
  922. Xstruct    ResidentProgramTag    {
  923. X                BPTR    rpt_NextSeg;    /* Provided by DOS at LoadSeg time    */
  924. X/*
  925. X ************************************************************************
  926. X * The initial branch destination and rpt_Instruction do not have to be    *
  927. X * the same.  This allows different actions to be taken if you are    *
  928. X * diskloaded or resident.  DataSize memory will be allocated only if    *
  929. X * you are resident, but StackSize will override all user stack        *
  930. X * requests.                                *
  931. X ************************************************************************
  932. X */
  933. X                UWORD    rpt_BRA;    /* Short branch to executable        */
  934. X                UWORD    rpt_Magic;    /* Resident majik value            */
  935. X                ULONG    rpt_StackSize;    /* min stack for this process        */
  936. X                ULONG    rpt_DataSize;    /* Data size to allocate if resident    */
  937. X                /*    rpt_Instruction;    Start here if resident        */
  938. X                };
  939. X
  940. X/*
  941. X ************************************************************************
  942. X * The form of the ARP allocated node in your tasks memlist when    *
  943. X * launched as a resident program. Note that the data portion of the    *
  944. X * node will only exist if you have specified a nonzero value for    *
  945. X * rpt_DataSize. Note also that this structure is READ ONLY, modify    *
  946. X * values in this at your own risk.  The stack stuff is for tracking,    *
  947. X * if you need actual addresses or stack size, check the normal places    *
  948. X * for it in your process/task struct.                    *
  949. X ************************************************************************
  950. X */
  951. Xstruct    ProcessMemory    {
  952. X        struct    Node    pm_Node;
  953. X            UWORD    pm_Num;        /* This is 1 if no data, two if data    */
  954. X            CPTR    pm_Stack;
  955. X            ULONG    pm_StackSize;
  956. X            CPTR    pm_Data;    /* Only here if pm_Num == 2        */
  957. X            ULONG    pm_DataSize;
  958. X            };
  959. X
  960. X/*
  961. X ************************************************************************
  962. X * To find the above on your memlist, search for the following name.    *
  963. X * We guarantee this will be the only arp.library allocated node on    *
  964. X * your memlist with this name.                        *
  965. X * i.e. FindName(task->tcb_MemEntry, PMEM_NAME);            *
  966. X ************************************************************************
  967. X */
  968. X#define    PMEM_NAME    "ARP_MEM"
  969. X
  970. X#define    RESIDENT_MAGIC    0x4AFC        /* same as RTC_MATCHWORD (trapf) */
  971. X
  972. X/*
  973. X ************************************************************************
  974. X *    Date String/Data structures                    *
  975. X ************************************************************************
  976. X */
  977. X#ifndef DOS_DATETIME_H        /* added by mool */
  978. X#define DOS_DATETIME_H
  979. X
  980. Xstruct    DateTime    {
  981. X        struct    DateStamp    dat_Stamp;    /* DOS Datestamp            */
  982. X            UBYTE        dat_Format;    /* controls appearance ot dat_StrDate    */
  983. X            UBYTE        dat_Flags;    /* See BITDEF's below            */
  984. X            BYTE        *dat_StrDay;    /* day of the week string        */
  985. X            BYTE        *dat_StrDate;    /* date string                */
  986. X            BYTE        *dat_StrTime;    /* time string                */
  987. X            };
  988. X
  989. X/*
  990. X ************************************************************************
  991. X *    Size of buffer you need for each DateTime strings:        *
  992. X ************************************************************************
  993. X */
  994. X#define    LEN_DATSTRING    10L
  995. X
  996. X/*
  997. X ************************************************************************
  998. X *    For dat_Flags                            *
  999. X ************************************************************************
  1000. X */
  1001. X#define    DTB_SUBST    0L    /* Substitute "Today" "Tomorrow" where appropriate    */
  1002. X#define    DTB_FUTURE    1L    /* Day of the week is in future                */
  1003. X
  1004. X#define    DTF_SUBST    (1L << DTB_SUBST)
  1005. X#define    DTF_FUTURE    (1L << DTB_FUTURE)
  1006. X
  1007. X/*
  1008. X ************************************************************************
  1009. X *    For dat_Format                            *
  1010. X ************************************************************************
  1011. X */
  1012. X#define    FORMAT_DOS    0L        /* dd-mmm-yy AmigaDOS's own, unique style        */
  1013. X#define    FORMAT_INT    1L        /* yy-mm-dd International format            */
  1014. X#define    FORMAT_USA    2L        /* mm-dd-yy The good'ol'USA.                */
  1015. X#define    FORMAT_CDN    3L        /* dd-mm-yy Our brothers and sisters to the north    */
  1016. X#define    FORMAT_MAX    FORMAT_CDN    /* Larger than this? Defaults to AmigaDOS        */
  1017. X
  1018. X    /* dos/datetime.h uses the same structures and defines, so
  1019. X     * keep the compiler from pulling it in. -olsen
  1020. X     */
  1021. X
  1022. X/* #define DOS_DATETIME_H 1 */
  1023. X#endif
  1024. X
  1025. X/*
  1026. X ************************************************************************
  1027. X * Define NO_PROTOTYPES if your compiler does not handle them...    *
  1028. X ************************************************************************
  1029. X */
  1030. X#if defined(NO_PROTOTYPES) || defined(__NO_PROTOS)
  1031. X#define    ARGs(x)    ()
  1032. X#else
  1033. X#define    ARGs(x)    x
  1034. X
  1035. X    /* Added ArpVPrintf, ArpVFPrintf and ArpVSPrintf, so will have to
  1036. X     * include the compiler specific stdarg header file. -olsen
  1037. X     */
  1038. X
  1039. X#include <stdarg.h>
  1040. X
  1041. X#endif    /* NO_PROTOTYPES */
  1042. X
  1043. X/*
  1044. X ************************************************************************
  1045. X * Note that C_Args is a #define that, in LATTICE does __stdargs    *
  1046. X ************************************************************************
  1047. X */
  1048. X
  1049. X/*
  1050. X ************************************************************************
  1051. X * This prototype is here to prevent the possible error in defining    *
  1052. X * IoErr() as LONG and thus causing LastTracker to give you trash...    *
  1053. X *                                    *
  1054. X * N O T E !  You MUST! have IoErr() defined as LONG to use LastTracker *
  1055. X *          If your compiler has other defines for this, you may wish *
  1056. X *          to move the prototype for IoErr() into the DO_ARP_COPIES    *
  1057. X ************************************************************************
  1058. X */
  1059. X    LONG            IoErr            ARGs(    (VOID)                            );
  1060. X
  1061. X/*
  1062. X ************************************************************************
  1063. X *    These duplicate the calls in dos.library            *
  1064. X *    Only include if you can use arp.library without dos.library    *
  1065. X ************************************************************************
  1066. X */
  1067. X#ifdef    DO_ARP_COPIES
  1068. X    BPTR            Open            ARGs(    (char *, LONG)                        );
  1069. X    VOID            Close            ARGs(    (BPTR)                            );
  1070. X    LONG            Read            ARGs(    (BPTR, char *, LONG)                    );
  1071. X    LONG            Write            ARGs(    (BPTR, char *, LONG)                    );
  1072. X    BPTR            Input            ARGs(    (VOID)                            );
  1073. X    BPTR            Output            ARGs(    (VOID)                            );
  1074. X    LONG            Seek            ARGs(    (BPTR, LONG, LONG)                    );
  1075. X    LONG            DeleteFile        ARGs(    (char *)                        );
  1076. X    LONG            Rename            ARGs(    (char *, char *)                    );
  1077. X    BPTR            Lock            ARGs(    (char *, LONG)                        );
  1078. X    VOID            UnLock            ARGs(    (BPTR)                            );
  1079. X    BPTR            DupLock            ARGs(    (BPTR)                            );
  1080. X    LONG            Examine            ARGs(    (BPTR, struct FileInfoBlock *)                );
  1081. X    LONG            ExNext            ARGs(    (BPTR, struct FileInfoBlock *)                );
  1082. X    LONG            Info            ARGs(    (BPTR, struct InfoData *)                );
  1083. X    BPTR            CreateDir        ARGs(    (char *)                        );
  1084. X    BPTR            CurrentDir        ARGs(    (BPTR)                            );
  1085. Xstruct    MsgPort            *CreateProc        ARGs(    (char *, LONG, BPTR, LONG)                );
  1086. X    VOID            Exit            ARGs(    (LONG)                            );
  1087. X    BPTR            LoadSeg            ARGs(    (char *)                        );
  1088. X    VOID            UnLoadSeg        ARGs(    (BPTR)                            );
  1089. Xstruct    MsgPort            *DeviceProc        ARGs(    (char *)                        );
  1090. X    LONG            SetComment        ARGs(    (char *, char *)                    );
  1091. X    LONG            SetProtection        ARGs(    (char *, LONG)                        );
  1092. X    LONG            *DateStamp        ARGs(    (LONG *)                        );
  1093. X    VOID            Delay            ARGs(    (LONG)                            );
  1094. X    LONG            WaitForChar        ARGs(    (BPTR, LONG)                        );
  1095. X    BPTR            ParentDir        ARGs(    (BPTR)                            );
  1096. X    LONG            IsInteractive        ARGs(    (BPTR)                            );
  1097. X    LONG            Execute            ARGs(    (char *, BPTR, BPTR)                    );
  1098. X#endif    /* DO_ARP_COPIES */
  1099. X
  1100. X/*
  1101. X ************************************************************************
  1102. X *    Now for the stuff that only exists in arp.library...        *
  1103. X ************************************************************************
  1104. X */
  1105. X    /* LONG        C_Args    Printf            ARGs(    (char *,...)                        ); */
  1106. X    /* LONG        C_Args    FPrintf            ARGs(    (BPTR, char *,...)                    ); */
  1107. X    LONG        C_Args    Printf            ARGs(    (UBYTE *, long, ...)                        );
  1108. X    LONG        C_Args    FPrintf            ARGs(    (BPTR, UBYTE *, long, ...)                    );
  1109. X    LONG            Puts             ARGs(    (char *)                        );
  1110. X    LONG            ReadLine        ARGs(    (char *)                        );
  1111. X    LONG            GADS             ARGs(    (char *, LONG, char *, char **, char *)            );
  1112. X    LONG            Atol            ARGs(    (char *)                        );
  1113. X    ULONG            EscapeString         ARGs(    (char *)                        );
  1114. X    LONG            CheckAbort        ARGs(    (VOID(*))                        );
  1115. X    LONG            CheckBreak        ARGs(    (LONG, VOID(*))                        );
  1116. X    BYTE            *Getenv            ARGs(    (char *, char *, LONG)                    );
  1117. X    BOOL            Setenv            ARGs(    (char *, char *)                    );
  1118. X    BYTE            *FileRequest         ARGs(    (struct FileRequester *)                );
  1119. X    VOID            CloseWindowSafely    ARGs(    (struct Window *, LONG)                    );
  1120. X/* struct    MsgPort            *CreatePort        ARGs(    (const char *, LONG)                        ); */
  1121. Xstruct    MsgPort            *CreatePort        ARGs(    (UBYTE *, LONG)                        );
  1122. X    VOID            DeletePort         ARGs(    (struct MsgPort *)                    );
  1123. X    LONG            SendPacket         ARGs(    (LONG, LONG *, struct MsgPort *)            );
  1124. X    VOID            InitStdPacket        ARGs(    (LONG, LONG *, struct DosPacket *, struct MsgPort *)    );
  1125. X    ULONG            PathName        ARGs(    (BPTR, char *,LONG)                    );
  1126. X    ULONG            Assign            ARGs(    (char *, char *)                    );
  1127. X    VOID            *DosAllocMem        ARGs(    (LONG)                            );
  1128. X    VOID            DosFreeMem        ARGs(    (VOID *)                        );
  1129. X    ULONG            BtoCStr            ARGs(    (char *, BSTR, LONG)                    );
  1130. X    ULONG            CtoBStr            ARGs(    (char *, BSTR, LONG)                    );
  1131. Xstruct    DeviceList        *GetDevInfo        ARGs(    (struct DeviceList *)                    );
  1132. X    BOOL            FreeTaskResList        ARGs(    (VOID)                            );
  1133. X    VOID            ArpExit         ARGs(    (LONG,LONG)                        );
  1134. X    VOID        C_Args    *ArpAlloc        ARGs(    (LONG)                            );
  1135. X    VOID        C_Args    *ArpAllocMem        ARGs(    (LONG, LONG)                        );
  1136. X    BPTR        C_Args    ArpOpen            ARGs(    (char *, LONG)                        );
  1137. X    BPTR        C_Args    ArpDupLock        ARGs(    (BPTR)                            );
  1138. X    BPTR        C_Args    ArpLock            ARGs(    (char *, LONG)                        );
  1139. X    VOID        C_Args    *RListAlloc        ARGs(    (struct ResList *, LONG)                );
  1140. Xstruct    Process            *FindCLI        ARGs(    (LONG)                            );
  1141. X    BOOL            QSort            ARGs(    (VOID *, LONG, LONG, int(*))                );
  1142. X    BOOL            PatternMatch        ARGs(    (char *,char *)                        );
  1143. X    LONG            FindFirst        ARGs(    (char *, struct AnchorPath *)                );
  1144. X    LONG            FindNext        ARGs(    (struct AnchorPath *)                    );
  1145. X    VOID            FreeAnchorChain        ARGs(    (struct AnchorPath *)                    );
  1146. X    ULONG            CompareLock        ARGs(    (BPTR, BPTR)                        );
  1147. Xstruct    ResList            *FindTaskResList    ARGs(    (VOID)                            );
  1148. Xstruct    ResList            *CreateTaskResList    ARGs(    (VOID)                            );
  1149. X    VOID            FreeResList        ARGs(    (struct ResList *)                    );
  1150. X    VOID            FreeTrackedItem        ARGs(    (struct DefaultTracker *)                );
  1151. Xstruct    DefaultTracker    C_Args    *GetTracker        ARGs(    (LONG)                            );
  1152. X    VOID            *GetAccess        ARGs(    (struct DefaultTracker *)                );
  1153. X    VOID            FreeAccess        ARGs(    (struct DefaultTracker *)                );
  1154. X    VOID            FreeDAList        ARGs(    (struct DirectoryEntry *)                );
  1155. Xstruct    DirectoryEntry        *AddDANode        ARGs(    (char *, struct DirectoryEntry **, LONG, LONG)        );
  1156. X    ULONG            AddDADevs        ARGs(    (struct DirectoryEntry **, LONG)            );
  1157. X    LONG            Strcmp            ARGs(    (char *, char *)                    );
  1158. X    LONG            Strncmp            ARGs(    (char *, char *, LONG)                    );
  1159. X    BYTE            Toupper            ARGs(    (BYTE)                            );
  1160. X    LONG            SyncRun            ARGs(    (char *, char *, BPTR, BPTR)                );
  1161. X
  1162. X/*
  1163. X ************************************************************************
  1164. X *    Added V32 of arp.library                    *
  1165. X ************************************************************************
  1166. X */
  1167. X    LONG            ASyncRun        ARGs(    (char *, char *, struct ProcessControlBlock *)        );
  1168. X    LONG            SpawnShell        ARGs(    (char *, char *, struct NewShell *)            );
  1169. X    BPTR            LoadPrg            ARGs(    (char *)                        );
  1170. X    BOOL            PreParse        ARGs(    (char *, char *)                    );
  1171. X
  1172. X/*
  1173. X ************************************************************************
  1174. X *    Added V33 of arp.library                    *
  1175. X ************************************************************************
  1176. X */
  1177. X    BOOL            StamptoStr        ARGs(    (struct DateTime *)                    );
  1178. X    BOOL            StrtoStamp        ARGs(    (struct DateTime *)                    );
  1179. Xstruct    ResidentProgramNode    *ObtainResidentPrg    ARGs(    (char *)                        );
  1180. Xstruct    ResidentProgramNode    *AddResidentPrg        ARGs(    (BPTR, char *)                        );
  1181. X    LONG            RemResidentPrg        ARGs(    (char *)                        );
  1182. X    VOID            UnLoadPrg        ARGs(    (BPTR)                            );
  1183. X    LONG            LMult            ARGs(    (LONG, LONG)                        );
  1184. X    LONG            LDiv            ARGs(    (LONG, LONG)                        );
  1185. X    LONG            LMod            ARGs(    (LONG, LONG)                        );
  1186. X    ULONG            CheckSumPrg        ARGs(    (struct ResidentProgramNode *)                );
  1187. X    VOID            TackOn            ARGs(    (char *, char *)                    );
  1188. X    BYTE            *BaseName        ARGs(    (char *)                        );
  1189. Xstruct    ResidentProgramNode    *ReleaseResidentPrg    ARGs(    (BPTR)                            );
  1190. X
  1191. X/*
  1192. X ************************************************************************
  1193. X *    Added V36 of arp.library                    *
  1194. X ************************************************************************
  1195. X */
  1196. X    LONG        C_Args    SPrintf            ARGs(    (char *, char *,...)                    );
  1197. X    LONG            GetKeywordIndex        ARGs(    (char *, char *)                    );
  1198. Xstruct    Library        C_Args    *ArpOpenLibrary        ARGs(    (char *, LONG)                        );
  1199. Xstruct    FileRequester    C_Args    *ArpAllocFreq        ARGs(    (VOID)                            );
  1200. X
  1201. X    /* This one's a cutie which is supported via bypassing the
  1202. X     * ??Printf glue routines. -olsen
  1203. X     */
  1204. X
  1205. X    LONG            ArpVPrintf        ARGs(    (char *, va_list)                    );
  1206. X    LONG            ArpVFPrintf        ARGs(    (BPTR, char *, va_list)                    );
  1207. X    LONG            ArpVSPrintf        ARGs(    (char *, char *, va_list)                );
  1208. X
  1209. X/*
  1210. X ************************************************************************
  1211. X *    Check if we should do the pragmas...                *
  1212. X ************************************************************************
  1213. X */
  1214. X
  1215. X#if !defined(NO_PRAGMAS) && !defined(__NO_PRAGMAS)
  1216. X#ifndef    PROTO_ARP_H
  1217. X#include <proto/arp.h>
  1218. X#endif    /* PROTO_ARP_H */
  1219. X#endif    /* NO_PRAGMAS */
  1220. X
  1221. X#endif    /* LIBRARIES_ARPBASE_H */
  1222. END_OF_FILE
  1223. if test 49786 -ne `wc -c <'vim/src/arpbase.h'`; then
  1224.     echo shar: \"'vim/src/arpbase.h'\" unpacked with wrong size!
  1225. fi
  1226. # end of 'vim/src/arpbase.h'
  1227. fi
  1228. echo shar: End of archive 23 \(of 23\).
  1229. cp /dev/null ark23isdone
  1230. MISSING=""
  1231. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do
  1232.     if test ! -f ark${I}isdone ; then
  1233.     MISSING="${MISSING} ${I}"
  1234.     fi
  1235. done
  1236. if test "${MISSING}" = "" ; then
  1237.     echo You have unpacked all 23 archives.
  1238.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1239. else
  1240.     echo You still need to unpack the following archives:
  1241.     echo "        " ${MISSING}
  1242. fi
  1243. ##  End of shell archive.
  1244. exit 0
  1245. -------------8<----------------8<----------------8<---------------8<--------
  1246. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  1247. Oce Nederland B.V., Research & Development | necessarily represent the position
  1248. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  1249. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  1250. UUCP: mool@oce.nl        fax +31 77 595450 | whatever will be accepted.
  1251.  
  1252. exit 0 # Just in case...
  1253.