home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / vim / part24 < prev    next >
Encoding:
Text File  |  1993-12-22  |  52.3 KB  |  1,259 lines

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