home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d8xx / d886 / patchlibrary.lha / PatchLibrary / Includes / patch.i < prev   
Text File  |  1993-07-16  |  2KB  |  55 lines

  1.     IFND LIBRARIES_PATCH_I
  2. LIBRARIES_PATCH_I SET 1
  3. **
  4. **    $Filename: libraries/patch.i $
  5. **    $Release: 1.0 $
  6. **
  7. **    (C) Copyright 1993 Stefan Fuchs
  8. **    All rights reserved
  9. **
  10. **      definition of patch.library public structures, returncodes and macros
  11.  
  12.  
  13.     IFND EXEC_TYPES_I
  14.     include "exec/types.i"
  15.     ENDC
  16.  
  17.  
  18.  STRUCTURE NewPatch,0
  19.     APTR    NPAT_NewCode        ;pointer to the patch code to be installed
  20.     ULONG    NPAT_NewCodeSize    ;optional length of NPAT_NewCode in bytes
  21.     APTR    NPAT_LibraryName    ;pointer to the LibraryName
  22.     UWORD    NPAT_LibVersion        ;version of Library to open
  23.     WORD    NPAT_LVO        ;LVO of function to patch
  24.     WORD    NPAT_Priority        ;Priority (-127...+126) of the patch
  25.     UWORD    NPAT_Flags        ;currently none defined (keep zero)
  26.     APTR    NPAT_PatchName        ;optional pointer to an IDString
  27.     LONG    NPAT_Result2        ;optional pointer to longword for Result2
  28.  
  29.  LABEL NPAT_SIZEOF
  30.  
  31.  
  32. ;ErrorCodes:
  33. PATERR_Ok        equ    0    ;Everything Ok
  34. PATERR_PatchInUse    equ    1    ;Patch Usecount <> 0
  35. PATERR_InvalidHandle    equ    2    ;Pointer to patch is not (no longer) valid
  36. PATERR_OutOfMem        equ    3    ;Out of memory
  37. PATERR_OpenLib        equ    4    ;Failed to open requested library
  38. PATERR_FuncNotStd    equ    5    ;Function to patch is not in the standard format
  39. PATERR_PatchInstalled    equ    6    ;Can't remove patch because another program has installed a non-patch.library patch later
  40.  
  41.  
  42. ;---------------------------------------------------------------
  43. ;--- FALLBACK - Call this macro instead of a 'rts' instruction
  44. ;--- in your patchcode, if you want to return to the original
  45. ;--- library code
  46. ;---------------------------------------------------------------
  47. FALLBACK    MACRO
  48.     move.l (sp),-(sp)
  49.     clr.l 4(sp)
  50.     rts
  51.  
  52.     ENDM
  53.  
  54.     ENDC    ;LIBRARIES_PATCH_I
  55.