home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 581a.lha / MemMan_v2.0 / MemMan.h < prev    next >
C/C++ Source or Header  |  1991-12-04  |  2KB  |  71 lines

  1. /********************************************************************
  2.  
  3.                  MemMan.h
  4.                 Low-memory manager
  5.                Copyright (C) 1991 Bryan    Ford
  6.  
  7. ********************************************************************/
  8.  
  9. /* To use memman.library, #define MM_RUNLIB before including this file.    */
  10.  
  11. #ifndef    BRY_MEMMAN_H
  12. #define    BRY_MEMMAN_H
  13.  
  14. #ifndef    EXEC_NODES_H
  15. #include <exec/nodes.h>
  16. #endif
  17.  
  18. /* Some    special    provisions to support both link    and runtime libraries */
  19. #ifdef __SASC
  20. #  define MM_REGARGS __regargs
  21. #  ifndef MM_RUNLIB
  22. #    define MM_ASM __asm
  23. #    define MM_REG(r) register __ ## r
  24. #  endif
  25. #else
  26. #  define MM_REGARGS
  27. #endif
  28. #ifndef    MM_ASM
  29. #  define MM_ASM
  30. #  define MM_REG(r)
  31. #endif
  32.  
  33. struct MMNode
  34.   {
  35.     struct Node    Node;            /* Link    into systemwide    MMList */
  36.     long MM_REGARGS (*GetRidFunc)(long size,long memtype,void *data);
  37.     void *GetRidData;            /* Data    to send    to GetRidFunc */
  38.   };
  39. #define    MMNT_LINKED NT_USER        /* Special ln_Type means this node is active */
  40.  
  41. /* Prototypes */
  42. #ifndef    MM_RUNLIB /* Init and Finish are automatic in the library version */
  43. int MM_ASM MMInit(void);
  44. void MM_ASM MMFinish(void);
  45. #endif
  46. void MM_ASM MMAddNode(MM_REG(a1) struct    MMNode *mmnode);
  47. void MM_ASM MMRemNode(MM_REG(a1) struct    MMNode *mmnode);
  48.  
  49. /* Manx    register assignments for the linked version */
  50. #ifdef AZTEC_C
  51. #  ifndef MM_RUNLIB
  52. #    pragma regcall(MMAddNode(a1))
  53. #    pragma regcall(MMRemNode(a1))
  54. #  endif
  55. #endif
  56.  
  57. /* This    part defines the the function calls for    use with the runtime library. */
  58. /* These pragmas (SAS style) will work for both    AZTEC C    and SAS/C */
  59. #ifdef AMIGA
  60. #  ifdef MM_RUNLIB
  61. #    pragma libcall MMBase MMAddNode 1E    901
  62. #    pragma libcall MMBase MMRemNode 24    901
  63. #  endif
  64. #endif
  65.  
  66. #undef MM_REGARGS
  67. #undef MM_ASM
  68. #undef MM_REG
  69.  
  70. #endif
  71.