home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / System / SnoopDos / SnoopDos_Src / SnoopDos_Source / patches.h < prev    next >
Text File  |  2001-02-04  |  5KB  |  132 lines

  1. /*
  2.  *              PATCHES.H                                                                                       vi:ts=4
  3.  *
  4.  *      Copyright (c) Eddy Carroll, September 1994.
  5.  *
  6.  *              Contains definitions used by the patches module
  7.  */
  8.  
  9. #define reg_d0  register __d0
  10. #define reg_d1  register __d1
  11. #define reg_d2  register __d2
  12. #define reg_d3  register __d3
  13. #define reg_d4  register __d4
  14. #define reg_d5  register __d5
  15. #define reg_d6  register __d6
  16. #define reg_d7  register __d7
  17. #define reg_a0  register __a0
  18. #define reg_a1  register __a1
  19. #define reg_a2  register __a2
  20. #define reg_a3  register __a3
  21. #define reg_a4  register __a4
  22. #define reg_a5  register __a5
  23. #define reg_a6  register __a6
  24.  
  25. typedef enum {
  26.         DOS_LIB,
  27.         EXEC_LIB,
  28.         INTUITION_LIB,
  29.         GRAPHICS_LIB,
  30.         ICON_LIB,
  31.         NUM_LIBS
  32. } LibNumbers;
  33.  
  34. /*
  35.  *              Now type definitions for all the functions to be replaced, so that we
  36.  *              can easily call the original function from our replacement function.
  37.  */
  38. #define DFT(f)  typedef __asm ULONG (*FP_##f)   /* Define Function Type  */
  39. #define LBASE   reg_a6 void *
  40. typedef struct TagItem *TAGPTR;
  41.  
  42. LONG AttemptSemaphoreHeavely(struct SignalSemaphore *ss);
  43.  
  44. /*
  45.  *              Dos prototypes
  46.  */
  47. DFT(AddDosEntry)        (reg_d1 struct DosList *, LBASE);
  48. DFT(CurrentDir)         (reg_d1 BPTR,   LBASE);
  49. DFT(DeleteFile)         (reg_d1 char *, LBASE);
  50. DFT(Execute)            (reg_d1 char *, reg_d2 BPTR,    reg_d3 BPTR, LBASE);
  51. DFT(GetVar)                     (reg_d1 char *, reg_d2 char *,  reg_d3 ULONG, reg_d4 ULONG,
  52.                                          LBASE);
  53. DFT(FindVar)            (reg_d1 char *, reg_d2 ULONG,   LBASE);
  54. DFT(LoadSeg)            (reg_d1 char *, reg_d2 BPTR hunk, reg_d3 BPTR file, LBASE);
  55. DFT(NewLoadSeg)         (reg_d1 char *, reg_d2 TAGPTR,  LBASE);
  56. DFT(Lock)                       (reg_d1 char *, reg_d2 LONG,    LBASE);
  57. DFT(Open)                       (reg_d1 char *, reg_d2 ULONG,   LBASE);
  58. DFT(CreateDir)          (reg_d1 char *, LBASE);
  59. DFT(MakeLink)           (reg_d1 char *, reg_d2 LONG,    reg_d3 LONG, LBASE);
  60. DFT(Rename)                     (reg_d1 char *, reg_d2 char *,  LBASE);
  61. DFT(RunCommand)         (reg_d1 BPTR,   reg_d2 ULONG,   reg_d3 char *,
  62.                                          reg_d4 ULONG,  LBASE);
  63. DFT(SetVar)                     (reg_d1 char *, reg_d2 char *,  reg_d3 ULONG, reg_d4 ULONG,
  64.                                          LBASE);
  65. DFT(DeleteVar)          (reg_d1 char *, reg_d2 ULONG,   LBASE);
  66. DFT(SystemTagList)      (reg_d1 char *, reg_d2 TAGPTR,  LBASE);
  67.                                 
  68. /*
  69.  *              Exec prototypes
  70.  */
  71. DFT(FindPort)           (reg_a1 char *, LBASE);
  72. DFT(FindResident)       (reg_a1 char *, LBASE);
  73. DFT(FindResource)       (reg_a1 char *, LBASE);
  74. DFT(FindSemaphore)      (reg_a1 char *, LBASE);
  75. DFT(FindTask)           (reg_a1 char *, LBASE);
  76. DFT(OpenDevice)         (reg_a0 char *, reg_d0 long,    reg_a1 struct IORequest *,
  77.                                          reg_d1 long,   LBASE);
  78. DFT(OpenLibrary)        (reg_a1 char *, reg_d0 long,    LBASE);
  79. DFT(OpenResource)       (reg_a1 char *, LBASE);
  80. DFT(GetMsg)                     (reg_a0 struct MsgPort *,               LBASE);
  81. DFT(PutMsg)                     (reg_a0 struct MsgPort *, reg_a1 struct Message *, LBASE);
  82.  
  83. /*
  84.  *              Graphics, Intuition and Icon library prototypes
  85.  */
  86. DFT(OpenFont)           (reg_a0 struct TextAttr *, LBASE);
  87. DFT(LockPubScreen)      (reg_a0 char *,  LBASE);
  88. DFT(FindToolType)       (reg_a0 char **, reg_a1 char *, LBASE);
  89. DFT(MatchToolValue)     (reg_a0 char *,  reg_a1 char *, LBASE);
  90.  
  91. /*
  92.  *              Dos library function offsets
  93.  */
  94. #define LVO_AddDosEntry         -678
  95. #define LVO_CurrentDir          -126
  96. #define LVO_DeleteFile          -72
  97. #define LVO_Execute                     -222
  98. #define LVO_GetVar                      -906
  99. #define LVO_FindVar                     -918
  100. #define LVO_LoadSeg                     -150
  101. #define LVO_NewLoadSeg          -768
  102. #define LVO_Lock                        -84
  103. #define LVO_Open                        -30
  104. #define LVO_CreateDir           -120
  105. #define LVO_MakeLink            -444
  106. #define LVO_Rename                      -78
  107. #define LVO_RunCommand          -504
  108. #define LVO_SetVar                      -900
  109. #define LVO_DeleteVar           -912
  110. #define LVO_SystemTagList       -606
  111.  
  112. /*
  113.  *              Exec library function offsets
  114.  */
  115. #define LVO_FindPort            -390
  116. #define LVO_FindResident        -96
  117. #define LVO_FindSemaphore       -594
  118. #define LVO_FindTask            -294
  119. #define LVO_OpenDevice          -444
  120. #define LVO_OpenLibrary         -552
  121. #define LVO_OpenResource        -498
  122. #define LVO_GetMsg                      -372
  123. #define LVO_PutMsg                      -366
  124.  
  125. /*
  126.  *              Graphics, Intuition and Icon library function offsets
  127.  */
  128. #define LVO_OpenFont            -72
  129. #define LVO_LockPubScreen       -510
  130. #define LVO_FindToolType        -96
  131. #define LVO_MatchToolValue      -102
  132.