home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 6 / Sonderheft_6-96.iso / pd / libraries / patchlib / autodocs / patch.doc < prev   
Encoding:
Text File  |  1996-11-04  |  31.8 KB  |  948 lines

  1. TABLE OF CONTENTS
  2.  
  3. patch.library/AddPatchNotifyA
  4. patch.library/CreatePatchProjectA
  5. patch.library/FindPatch
  6. patch.library/FindPatchTagsA
  7. patch.library/GetPatchA
  8. patch.library/InstallPatch
  9. patch.library/InstallPatchTagsA
  10. patch.library/PatchFreeVec
  11. patch.library/RemovePatch
  12. patch.library/RemovePatchProjectA
  13. patch.library/RemovePatchTagsA
  14. patch.library/RemPatchNotifyA
  15. patch.library/SetPatchA
  16. patch.library/SetPatchProjectA
  17. patch.library/WaitRemovePatch
  18.  
  19. patch.library/AddPatchNotifyA           patch.library/AddPatchNotifyA
  20.  
  21.    NAME
  22.     AddPatchNotifyA -- Get messages, if a patch is changed. (V5)
  23.     AddPatchNotify -- varargs stub for AddPatchNotifyA(). (V5)
  24.  
  25.    SYNOPSIS
  26.     Error = AddPatchNotifyA( msgport, taglist )
  27.     D0                     A0       A1
  28.  
  29.     ULONG Error AddPatchNotifyA( struct MsgPort *, struct TagItem *);
  30.  
  31.     Error = AddPatchNotify( msgport, firsttag, ...)
  32.  
  33.     ULONG Error AddPatchNotify( struct MsgPort *, Tag, ...);
  34.  
  35.    FUNCTION
  36.     Start sending out notification requests to the given messageport, if
  37.     a patch is added, removed or changed.
  38.  
  39.    INPUTS
  40.     msgport = pointer to msgport ready to receive messages or
  41.           null for no action
  42.     taglist = pointer to array of tags
  43.  
  44.    TAGS
  45.     PATT_Priority (BYTE) - Optional priority for the notification request
  46.         Normally only the priorities +5, 0, -5 should be used.
  47.  
  48.    RESULT
  49.     Error = errorcode as defined in patch.h.
  50.         PATERR_Ok
  51.             Indicates success of the operation.
  52.         PATERR_OutOfMem
  53.             Indicates that there was not enough memory to
  54.             complete the operation.
  55.  
  56.    NOTES
  57.  
  58.    BUGS
  59.  
  60.    SEE ALSO
  61.     RemPatchNotify(), patch.h
  62. patch.library/CreatePatchProjectA           patch.library/CreatePatchProjectA
  63.  
  64.    NAME
  65.     CreatePatchProjectA -- Create an instance of a patch project. (V4)
  66.     CreatePatchProject -- varargs stub for CreatePatchProjectA(). (V4)
  67.  
  68.    SYNOPSIS
  69.     project = CreatePatchProjectA( projectname, taglist )
  70.     D0                           A0           A1
  71.  
  72.     APTR CreatePatchProjectA( STRPTR, struct TagItem *);
  73.  
  74.     project = CreatePatchProject( projectname, firsttag, ...)
  75.  
  76.     APTR CreatePatchProject( STRPTR, Tag, ...);
  77.  
  78.    FUNCTION
  79.     Create an instance of a patch project.
  80.  
  81.     This instance may be used to manipulate or remove patches belonging
  82.     to one project (or program) with one function call.
  83.  
  84.     The projectname will be copied into an internal buffer.
  85.  
  86.    INPUTS
  87.     projectname = pointer to name of the patch project
  88.     taglist     = pointer to array of tags
  89.  
  90.    TAGS
  91.     none defined yet
  92.  
  93.    RESULT
  94.     project = pointer to patch projects private structure or 
  95.           null on failure
  96.  
  97.    NOTES
  98.  
  99.    BUGS
  100.  
  101.    SEE ALSO
  102.     RemovePatchProject(), InstallPatchTags(), patch.h
  103.   patch.library/FindPatch                               patch.library/FindPatch
  104.  
  105.    NAME
  106.     FindPatch -- find a patch structure with a given name.
  107.  
  108.    SYNOPSIS
  109.     patch = FindPatch( Name )
  110.     D0               A0
  111.  
  112.     struct Patch *FindPatch( STRPTR );
  113.  
  114.    FUNCTION
  115.     This function will search the patch.library lists for a
  116.     patch structure with the given name. The first patch matching
  117.     this name will be returned.
  118.  
  119.     This function exists only for historic reasons.
  120.     It will internally be routed to FindPatchTags().
  121.  
  122.    INPUTS
  123.     Name = Name of the patch structure to find
  124.  
  125.    RESULT
  126.     patch = a pointer to the patch structure with the same name else
  127.         zero to indicate that the string was not found.
  128.  
  129.    NOTES
  130.     If your task is not the owner of the patch, the
  131.     pointer is only valid as long as the system is in forbid().
  132.     From V2 on you may also lock the patch.library semaphore
  133.     before calling this function. In this case a pointer to
  134.     a patch structure is guaranteed to be valid, until you
  135.     release the semaphore. The semaphore, however, should be kept
  136.     locked only for short periods of time in order not to block
  137.     other tasks.
  138.  
  139.    BUGS
  140.  
  141.    SEE ALSO
  142.     InstallPatch(), RemovePatch(), Patch.h
  143.  patch.library/FindPatchTagsA                     patch.library/FindPatchTagsA
  144.  
  145.    NAME
  146.     FindPatchTagsA -- find a patch structure with certain criteria. (V3)
  147.     FindPatchTags -- varargs stub for FindPatchTagsA(). (V3)
  148.  
  149.    SYNOPSIS
  150.     object = FindPatchTagsA( taglist )
  151.     D0               A0
  152.  
  153.     APTR FindPatchTagsA( struct TagItem *);
  154.  
  155.     object = FindPatchTags( firsttag, ...)
  156.  
  157.     APTR FindPatchTags( Tag, ...);
  158.  
  159.    FUNCTION
  160.     This function will search the patch.library lists for a
  161.     patch structure, that matches the criteria specified in the taglist.
  162.     The first matching patch will be returned.
  163.  
  164.    INPUTS
  165.     taglist = pointer to array of tags
  166.  
  167.    TAGS
  168.     Specify only one of these at a time:
  169.     PATT_PatchName (STRPTR) - Specifies that patch.library should
  170.         search for the occurrence of a patch of the given name.
  171.     PATT_ProjectName (V4) (STRPTR) - Specifies that patch.library should
  172.         search for the occurrence of a project of the given name.
  173.  
  174.  
  175.     PATT_NoCase (V4) (BOOL) - If specified with PATT_PatchName or
  176.         PATT_ProjectID string-comparison will be case-independent.
  177.         International characters are not respected with this version
  178.         of patch.library.
  179.         This may or may not change in the future.
  180.     PATT_LastObject (V4) (APTR) - This tag allows to search for multiple
  181.         matching objects. Simply specify the result of an previous
  182.         call to FindPatchTags() to continue searching with this tag.
  183.         You may also specify NULL to start searching the lists from
  184.         the beginning. Keep in mind, that you must make sure, that
  185.         the pointer is valid (see notes).
  186.  
  187.    RESULT
  188.     object = a pointer to the object as requested within the taglist or
  189.         zero to indicate that no match was found.
  190.  
  191.    NOTES
  192.     If your task is not the owner of the patch, the
  193.     pointer is only valid as long as the system is in forbid().
  194.     You may also lock the patch.library semaphore
  195.     before calling this function. In this case a pointer to
  196.     a patch structure is guaranteed to be valid, until you
  197.     release the semaphore. The semaphore, however, should be kept
  198.     locked only for short periods of time in order not to block
  199.     other tasks.
  200.  
  201.    BUGS
  202.  
  203.    SEE ALSO
  204.     InstallPatchTags(), RemovePatchTags(), PatchTags.h
  205.  patch.library/GetPatchA                               patch.library/GetPatchA
  206.  
  207.    NAME
  208.     GetPatchA -- Returns certain attributes of a patch. (V3)
  209.     GetPatch -- varargs stub for GetPatchA(). (V3)
  210.  
  211.    SYNOPSIS
  212.     Result = GetPatchA( patch, taglist )
  213.     D0                A0     A1
  214.  
  215.     ULONG Result GetPatchA( struct Patch *, struct TagItem *);
  216.  
  217.     Result = GetPatch( patch, firsttag, ...)
  218.  
  219.     ULONG Result GetPatch( struct Patch *, Tag, ...);
  220.  
  221.    FUNCTION
  222.     Returns certain attributes and lists connected to a patch (see TAGS).
  223.  
  224.    INPUTS
  225.     patch = pointer to a patch structure or NULL for no action
  226.     taglist = pointer to array of tags
  227.  
  228.    TAGS
  229.     PATT_Result2 (APTR) - An optional pointer to a longword, which will
  230.         contain an errorcode as defined patch.h, when
  231.         the function returns.
  232.         Assembler programmers can get the same value from d1.
  233.  
  234.     Only one of the following tags may be specified at a time:
  235.  
  236.     PATT_PatchName (BOOL) - Return a pointer to a copy of the name of
  237.         the patch in a null-terminated string.
  238.         This pointer must be passed to PatchFreeVec(), if
  239.         the string is no longer needed.
  240.         Type of Result is STRPTR.
  241.     PATT_TaskListType (BOOL) - Return the type of the internal TaskList
  242.         Possible results:
  243.         TL_TYPE_INCLUDE: all specified tasks will use the patchroutine,
  244.                  all others will ignore it.
  245.         TL_TYPE_EXCLUDE: all specified tasks will ignore the patchroutine,
  246.                  all others will use it.
  247.         NULL:         An error occurred (this includes the absence of
  248.                  a TaskList). Check the secondary errorcode for
  249.                  more information.
  250.         Type of Result is ULONG.
  251.     PATT_TaskList (BOOL) - Return a pointer to a taglist containing all
  252.         tasknames, taskids or patterns attached to a patch.
  253.         The tagitems are PATT_AddTaskName, PATT_AddTaskID or
  254.         PATT_AddTaskPattern(new for V5). Unknown tags must be ignored.
  255.         This pointer must be passed to PatchFreeVec(), if
  256.         the tasklist is no longer needed.
  257.         Type of Result is taglist.
  258.     PATT_Disabled (V4) (BOOL) - Return a number representing the current
  259.         disable nesting counter of a patch. Null means the patch is
  260.         enabled and will be used, by any tasks using the
  261.         library function.
  262.         Type of Result is ULONG.
  263.     PATT_UserData (V5) (BOOL) - Return userdata attached to a patch.
  264.         Type of Result is ULONG.
  265.     PATT_Priority (V5) (BOOL) - Return the priority of a patch.
  266.         Type of Result is BYTE.
  267.  
  268.  
  269.    RESULT
  270.     Result = Pointer or longword depending on specified tags.
  271.          A result of zero indicates an error.
  272.  
  273.     Possible errorcodes returned with PATT_Result2 or in register d1:
  274.         PATERR_Ok
  275.             Indicates success of the operation.
  276.         PATERR_OutOfMem
  277.             Indicates that there was not enough memory to
  278.             complete the operation.
  279.         PATERR_InvalidHandle
  280.             Indicates that the pointer to the patch passed
  281.             to the function was not or is no longer valid.
  282.             This might happen, if you pass a wrong pointer or
  283.             you got the pointer via FindPatch() and another
  284.             task has removed the patch before this task called
  285.             RemovePatchTags().
  286.         PATERR_NoTaskList
  287.             No valid TaskList is attached to the patch.
  288.             The SetPatchA() function with the PATT_CreateTaskList tag
  289.             specified, must be called to allocate a TaskList.
  290.         PATERR_PatchUnnamed
  291.             The patch has no identification string attached to it.
  292.  
  293.    NOTES
  294.  
  295.    BUGS
  296.  
  297.    SEE ALSO
  298.     InstallPatchTags(), PatchFreeVec(), Patch.h, PatchTags.h
  299.  patch.library/InstallPatch                         patch.library/InstallPatch
  300.  
  301.    NAME
  302.     InstallPatch -- Installs a patchroutine for library functions.
  303.  
  304.    SYNOPSIS
  305.     patch = InstallPatch( newPatch )
  306.     D0              A0
  307.  
  308.     struct Patch *InstallPatch( struct NewPatch * );
  309.  
  310.    FUNCTION
  311.     This function exists only for historic reasons. It will internally
  312.     routed back to InstallPatchTags(). Because InstallPatchTags()
  313.     has advanced features there is definitely no need to call this
  314.     function at all.
  315.  
  316.    INPUTS
  317.     NewPatch = pointer to an instance of a NewPatch structure
  318.  
  319.    RESULT
  320.     patch = pointer to a Patch structure or NULL on failure
  321.  
  322.    NOTES
  323.  
  324.    BUGS
  325.  
  326.    SEE ALSO
  327.     InstallPatchTags(), patchobsolete.h
  328.  patch.library/InstallPatchTagsA               patch.library/InstallPatchTagsA
  329.  
  330.    NAME
  331.     InstallPatchTagsA -- Installs a patchcode for library functions. (V2)
  332.     InstallPatchTags -- varargs stub for InstallPatchTagsA(). (V2)
  333.  
  334.    SYNOPSIS
  335.     patch = InstallPatchTagsA( funcEntry, funcOffset, tagList )
  336.     D0                    A0         D0          A1
  337.  
  338.     struct Patch *InstallPatchTagsA( APTR, UWORD, struct TagItem * );
  339.  
  340.     patch = InstallPatchTags( funcEntry, funcOffset, firsttag, ...)
  341.  
  342.     struct Patch *InstallPatchTags( APTR, UWORD, Tag, ...);
  343.  
  344.    FUNCTION
  345.     Adds a user provided routine to a library function.
  346.  
  347.     NEW for V3: An internal call to SetPatch() will be made.
  348.     So all tags which are valid with SetPatch() may be specified in the
  349.     taglist.
  350.  
  351.    INPUTS
  352.     funcEntry = pointer to the entry of the function to add
  353.     funcOffset = Library Offset Vector (LVO) of the function to patch
  354.     taglist = pointer to array of tags
  355.  
  356.    TAGS
  357.     PATT_LibraryName (STRPTR) - Specifies that you want to patch a library
  358.         of the given name ( as in exec.library/OpenLibrary() ).
  359.         Either PATT_LibraryName, PATT_DeviceName or PATT_LibraryBase
  360.         MUST be specified.
  361.     PATT_DeviceName (STRPTR) - Specifies that you want to patch a device
  362.         of the given name ( as in exec.library/OpenDevice() ).
  363.         Either PATT_LibraryName, PATT_DeviceName or PATT_LibraryBase
  364.         MUST be specified.
  365.     PATT_LibraryBase (struct Library *) Specifies that you want to patch
  366.         a library, device or resource with the given base.
  367.         You may get such a pointer by calling one of the following
  368.         exec functions: OpenLibrary(), OpenDevice(), OpenResource()
  369.         You may safely close this library, if InstallPatchTags()
  370.         returns, because patch.library will increase the OpenCount
  371.         to make sure, that the library won't be removed from the
  372.         system as long as there are patches installed.
  373.         V4: The OpenCount will not be increased, if the PatchSupervisor
  374.         support program is active.
  375.         Either PATT_LibraryName, PATT_DeviceName or PATT_LibraryBase
  376.         MUST be specified.
  377.     PATT_LibVersion (ULONG) - Versionnumber for exec.library/OpenLibrary.
  378.         Optional in conjunction with PATT_LibraryName.
  379.         Should be specified, if a function is available only
  380.         from a certain library version on.
  381.         Default is NULL (any version).
  382.     PATT_DevFlags (ULONG) - Flags for exec.library/OpenDevice().
  383.         Optional in conjunction with PATT_DeviceName. Default is NULL.
  384.     PATT_DevUnit (ULONG) - Unit for exec.library/OpenDevice().
  385.         Optional in conjunction with PATT_DeviceName. Default is NULL.
  386.     PATT_PatchName (STRPTR) - An optional pointer to a string, which can
  387.         be used to search for a patch with FindPatch() or FindPatchTags().
  388.         The null-terminated string will be copied, so you may free
  389.         its memory when InstallPatchTags() returns. The string should
  390.         identify the program that installed the patch.
  391.         Even though this tag is optional, the use of it is strongly
  392.         encouraged, because without it certain future enhancements
  393.         of the patch.library may not work (e.g.: saving of user-settings).
  394.     PATT_Priority (BYTE) - Priority of the patch
  395.         valid range: -127...+126
  396.         It indicates the sequence of patches, if more than one patch
  397.         for a function is to be installed.
  398.         The original code has a priority of 0.
  399.         Priority:    Meaning:
  400.         >0: patch will be executed before the original
  401.         <0: patch will be executed after the original
  402.         =0: patch will be executed instead of the original (default)
  403.         Normally only the priorities +5, 0, -5 should be used.
  404.     PATT_NewCodeSize (ULONG) - Optional length of the patch code to be
  405.         installed.
  406.         If this field is set to the correct value the PC-RELATIVE
  407.         patch code starting at funcEntry will be copied into an
  408.         internal buffer. So it is possible to deallocate the
  409.         patch code after InstallPatchTags() returned.
  410.     PATT_Result2 (APTR) - An optional pointer to a longword, which will
  411.         contain an errorcode as defined patch.h, when
  412.         the function returns.
  413.         Assembler programmers can get the same value from d1.
  414.     PATT_ProjectID (APTR) (V4) - Optional pointer to a PatchProject as
  415.         created by a CreatePatchProject() function call, indicating
  416.         that the newly installed patch belongs to one project or program.
  417.         If used together with the RemovePatchProject function
  418.         many patches can be removed with one function call.
  419.  
  420.  
  421.     For more tags see the description of SetPatch().
  422.  
  423.    RESULT
  424.     patch = pointer to a patch structure or NULL on failure
  425.  
  426.     Errorcodes returned with PATT_Result2, NPAT_Result2 or in register d1:
  427.     Note that from V3 on errorcodes may be returned, even if patch is a
  428.     valid pointer, indicating a failure in the internal SetPatch() call.
  429.     Previous versions always set PATERR_Ok, if patch was a valid pointer.
  430.         PATERR_Ok
  431.             Indicates success of the operation.
  432.         PATERR_OutOfMem
  433.             Indicates that there was not enough memory to
  434.             complete the operation.
  435.         PATERR_OpenLib
  436.             The operation failed, because the exec.library
  437.             function OpenLibrary() failed. Check the Autodocs
  438.             for more informations about OpenLibrary().
  439.         PATERR_OpenDev
  440.             The operation failed, because the exec.library
  441.             function OpenDevice() failed. Check the Autodocs
  442.             for more informations about OpenDevice().
  443.         PATERR_FuncNotStd
  444.             The library offset vector of the function to patch
  445.             was not in format that patch-library can accept.
  446.             Patch.library can handle the following formats:
  447.             jmp xxxxxx
  448.             moveq.l #xx,Dx    bra.l xxxx
  449.             moveq.l #xx,Dx    bra.s xx
  450.             Note that this is the type of error returned,
  451.             if you are trying to patch a function that uses
  452.             in-line code such as the exec.library/GetCC() function.
  453.         PATERR_InvalidTags
  454.             An error occurred while parsing the specified Tags
  455.             (e.g.: EITHER PATT_LibraryName, PATT_DeviceName or
  456.             PATT_LibraryBase MUST be used with InstallPatchTags() )
  457.     For more errorcodes see the description of SetPatch().
  458.  
  459.    NOTES
  460.     This function may implicitly call dos.library functions, so do not
  461.     call it from tasks.
  462.  
  463.    BUGS
  464.     Up to V4 it was not possible to pass pathnames with PATT_LibraryName or
  465.     PATT_DeviceName (e.g.: "Work:libs/foo.library"). This has been fixed
  466.     in V5.
  467.  
  468.    SEE ALSO
  469.     RemovePatchTags(), RemovePatchProject(), SetPatch(), Patch.h,
  470.     PatchTags.h, exec.library/OpenLibrary(), exec.library/OpenDevice()
  471.  patch.library/PatchFreeVec                         patch.library/PatchFreeVec
  472.  
  473.    NAME
  474.     PatchFreeVec -- free memory allocated by GetPatch() (V3)
  475.  
  476.    SYNOPSIS
  477.     PatchFreeVec(memoryBlock)
  478.              A1
  479.  
  480.     void PatchFreeVec(void *);
  481.  
  482.    FUNCTION
  483.     Free a memory allocation made by the GetPatch() call. The memory will
  484.     be returned to the system pool from which it came.
  485.  
  486.    NOTE
  487.  
  488.    INPUTS
  489.     memoryBlock - pointer to the memory block to free, or NULL.
  490.  
  491.    SEE ALSO
  492.     GetPatch(), exec.library/FreeVec
  493.  patch.library/RemovePatch                           patch.library/RemovePatch
  494.  
  495.    NAME
  496.     RemovePatch -- Removes a patch installed by InstallPatch().
  497.  
  498.    SYNOPSIS
  499.     Error = RemovePatch( patch )
  500.     D0                 A0
  501.  
  502.     ULONG Error RemovePatch( struct Patch * );
  503.  
  504.    FUNCTION
  505.     This function is obsolete from V2 on, use RemovePatchTags() instead.
  506.     It effectively calls the new function
  507.     RemovePatchTags(patch, PATT_DelayedExpunge, FALSE, TAG_DONE)
  508.  
  509.    INPUTS
  510.     patch = pointer to the patch structure or NULL for no action
  511.  
  512.    RESULT
  513.     Error = errorcode as defined in patch.h.
  514.         (for more information see RemovePatchTags() )
  515.  
  516.    NOTES
  517.  
  518.    BUGS
  519.  
  520.    SEE ALSO
  521.     RemovePatchTags(), Patch.h
  522.  patch.library/RemovePatchProjectA           patch.library/RemovePatchProjectA
  523.  
  524.    NAME
  525.     RemovePatchProjectA -- Remove all patches from the same project. (V4)
  526.     RemovePatchProject -- varargs stub for RemovePatchProjectA(). (V4)
  527.  
  528.    SYNOPSIS
  529.     Error = RemovePatchProjectA( project, taglist )
  530.     D0                         A0       A1
  531.  
  532.     ULONG Error RemovePatchProjectA( ULONG, struct TagItem *);
  533.  
  534.     Error = RemovePatchProject( project, firsttag, ...)
  535.  
  536.     ULONG Error RemovePatchProject( ULONG, Tag, ...);
  537.  
  538.    FUNCTION
  539.     Remove all patches from the given project.
  540.  
  541.     This function simplifies the way, patches can be removed:
  542.     - All patches belonging to one project will be disabled
  543.     - The function then waits (depending on PATT_Timeout) until
  544.       the usagecounter of all patches becomes zero
  545.     - Now all patches will be removed via RemovePatchTags()
  546.     - If all patches are removed resources connected to the
  547.       project will be deallocted
  548.  
  549.     You may call this function to cleanup a project, even if no
  550.     patch was successfully installed for this project.
  551.  
  552.    INPUTS
  553.     project = pointer to a patch project obtained via CreatePatchProject()
  554.     taglist = pointer to array of tags
  555.  
  556.    TAGS
  557.     same as RemovePatchTags()
  558.  
  559.    RESULT
  560.     Error = errorcode as defined in patch.h.
  561.         same as RemovePatchTags()
  562.  
  563.    NOTES
  564.     Removing a patch routine can never be made absolutely safe.
  565.     Although patch.library does anything possible to provide methods
  566.     to minimize the chance of a crash, there will always be a
  567.     slight chance.
  568.     So minimize the number of install and remove operations.
  569.  
  570.    BUGS
  571.  
  572.    SEE ALSO
  573.     CreatePatchProject(), InstallPatchTags(), RemovePatchTags(),
  574.     Patch.h, PatchTags.h
  575.  patch.library/RemovePatchTagsA                 patch.library/RemovePatchTagsA
  576.  
  577.    NAME
  578.     RemovePatchTagsA -- Removes an installed patch. (V2)
  579.     RemovePatchTags -- varargs stub for RemovePatchTagsA(). (V2)
  580.  
  581.    SYNOPSIS
  582.     Error = RemovePatchTagsA( patch, taglist )
  583.     D0                      A0     A1
  584.  
  585.     ULONG Error RemovePatchTagsA( struct Patch *, struct TagItem *);
  586.  
  587.     Error = RemovePatchTags( patch, firsttag, ...)
  588.  
  589.     ULONG Error RemovePatchTags( struct Patch *, Tag, ...);
  590.  
  591.    FUNCTION
  592.     Removes a patch from a library function.
  593.  
  594.     All allocated resources for that specific patch will
  595.     be deallocated.
  596.  
  597.    INPUTS
  598.     patch = pointer to a patch structure or NULL for no action
  599.     taglist = pointer to array of tags
  600.  
  601.    TAGS
  602.     PATT_TimeOut (ULONG) - The number of ticks (1/50 seconds) the
  603.         function keeps trying to remove the patch, if another task
  604.         is running in the patchcode.
  605.         If the patch.library does not succeed in the given time the
  606.         function will return PATERR_PatchInUse.
  607.         Defaults to NULL, which means no retry.
  608.     PATT_DelayedExpunge (BOOL) - If this tag is not set to FALSE and a
  609.         non-patch.library patch was installed after the patch.library
  610.         patch for a specific library function the specified patch
  611.         will nevertheless be removed.
  612.         BUT some resources will be kept allocated by patch.library
  613.         (e.g.: the Library Offset Vector will not be restored to its
  614.         old state). Patch.library will try to deallocate these
  615.         resources automatically, if the system is getting low on
  616.         memory or if a call to a patch.library function that
  617.         removes or installs patches is made.
  618.         The default is TRUE !!!
  619.  
  620.    RESULT
  621.     Error = errorcode as defined in patch.h.
  622.         PATERR_Ok
  623.             Indicates success of the operation.
  624.         PATERR_PatchInUse
  625.             Indicates that some other task is using the
  626.             installed function and the patch can't be removed now.
  627.             Your task may wait and try again later.
  628.         PATERR_PatchInstalled
  629.             Indicates that a patchcode has been installed for
  630.             that function after your patch.library patch has
  631.             been installed and your patch is the only
  632.             patch.library patch for that function.
  633.             If patch.library would remove your patch
  634.             tasks would jump into deallocated memory
  635.             Result:  blinking borders.
  636.             Never occurs, if you pass in the tag
  637.             PATT_DelayedExpunge with TRUE.
  638.         PATERR_InvalidHandle
  639.             Indicates that the pointer to the patch passed
  640.             to the function was not or is no longer valid.
  641.             This might happen, if you pass a wrong pointer or
  642.             you got the pointer via FindPatch() and another
  643.             task has removed the patch before this task called
  644.             RemovePatchTags().
  645.             Also keep in mind that ln_Type must be PS_TYPE_USER.
  646.  
  647.    NOTES
  648.     Removing a patch routine can never be made absolutely safe.
  649.     Although patch.library does anything possible to provide methods
  650.     to minimize the chance of a crash, there will always be a
  651.     slight chance.
  652.     So minimize the number of install and remove operations.
  653.  
  654.     This function may implicitly call dos.library functions, so do not
  655.     call it from tasks.
  656.  
  657.    BUGS
  658.  
  659.    SEE ALSO
  660.     InstallPatchTags(), RemovePatchProject(), Patch.h, PatchTags.h
  661. patch.library/RemPatchNotifyA           patch.library/RemPatchNotifyA
  662.  
  663.    NAME
  664.     RemPatchNotifyA -- Stop receiving messages, if a patch is changed. (V5)
  665.     RemPatchNotify -- varargs stub for RemPatchNotifyA(). (V5)
  666.  
  667.    SYNOPSIS
  668.     Error = RemPatchNotifyA( msgport, taglist )
  669.     D0                     A0       A1
  670.  
  671.     ULONG Error RemPatchNotifyA( struct MsgPort *, struct TagItem *);
  672.  
  673.     Error = RemPatchNotify( msgport, firsttag, ...)
  674.  
  675.     ULONG Error RemPatchNotify( struct MsgPort *, Tag, ...);
  676.  
  677.    FUNCTION
  678.     Stop recieving notification requests for the given messageport.
  679.     The messageport should have been used in a previous call to
  680.     AddPatchNotify(). Before deallocating your MsgPort you must
  681.     still reply outstanding messages.
  682.  
  683.    INPUTS
  684.     msgport = pointer to msgport or null for no action
  685.     taglist = pointer to array of tags
  686.  
  687.    TAGS
  688.     none defined yet
  689.  
  690.    RESULT
  691.     Error = errorcode as defined in patch.h.
  692.         PATERR_Ok
  693.             Indicates success of the operation.
  694.  
  695.    NOTES
  696.  
  697.    BUGS
  698.  
  699.    SEE ALSO
  700.     AddPatchNotify(), patch.h
  701.  patch.library/SetPatchA                               patch.library/SetPatchA
  702.  
  703.    NAME
  704.     SetPatchA -- Changes certain attributes of a patch. (V3)
  705.     SetPatch -- varargs stub for SetPatchA(). (V3)
  706.  
  707.    SYNOPSIS
  708.     Error = SetPatchA( patch, taglist )
  709.     D0               A0     A1
  710.  
  711.     ULONG Error SetPatchA( struct Patch *, struct TagItem *);
  712.  
  713.     Error = SetPatch( patch, firsttag, ...)
  714.  
  715.     ULONG Error SetPatch( struct Patch *, Tag, ...);
  716.  
  717.    FUNCTION
  718.     Changes certain attributes of a patch (see TAGS).
  719.  
  720.    INPUTS
  721.     patch = pointer to a patch structure or NULL for no action
  722.     taglist = pointer to array of tags
  723.  
  724.    TAGS
  725.     PATT_CreateTaskList (ULONG) - Create a TaskList of the given type:
  726.         TL_TYPE_INCLUDE: all specified tasks will use the patchroutine,
  727.                  all others will ignore it.
  728.                  So if no Task is specified via PATT_AddTask... tags,
  729.                  the patchroutine will be used for NO tasks!
  730.         TL_TYPE_EXCLUDE: all specified tasks will ignore the patchroutine,
  731.                  all others will use it.
  732.                  So if no Task is specified via PATT_AddTask... tags,
  733.                  the patchroutine will be used for ALL tasks!
  734.     PATT_DeleteTaskList (BOOL) - Delete any existing TaskList
  735.         This will return the patch to its default behaviour, which is to call
  736.         the patchroutine for any task.
  737.         It is not required to remove the TaskList, before you remove a patch,
  738.         (via RemovePatchTags()) because this will automatically be done
  739.         by patch.library.
  740.     PATT_AddTaskID (struct Task *) - Add a task address to the patch TaskList.
  741.         Patch.library takes care that one TaskID appears only once in the
  742.         TaskList.
  743.         Unlike many tags, you may specify this tag more than once in one
  744.         taglist to add multiple tasks to the list.
  745.     PATT_AddTaskName (STRPTR) - Add a task of the given name to address to 
  746.         the patch TaskList. The string will be copied into an
  747.         internal buffer.
  748.         Patch.library takes care that one TaskName appears only once in the
  749.         TaskList.
  750.         Unlike many tags, you may specify this tag more than once in one
  751.         taglist to add multiple tasks to the list.
  752.     PATT_RemTaskID (struct Task *) - Remove a task address from the TaskList
  753.         Unlike many tags, you may specify this tag more than once in one
  754.         taglist to remove multiple tasks from the list.
  755.     PATT_RemTaskName (APTR) - Remove a task of the given name from the
  756.         TaskList.
  757.         Unlike many tags, you may specify this tag more than once in one
  758.         taglist to remove multiple tasks from the list.
  759.     PATT_Disabled (V4) (BOOL) - Enable (False) or disable (True) a patch.
  760.         For disabling a patch a nesting counter is provided.
  761.         In order to restore normal patch execution, the programmer must
  762.         provide exactly one call to 'enable' for every 'disable'.
  763.         If a patch is disabled this does not mean, that no task continues to
  764.         use the patched code. It only makes sure, that no further tasks enter
  765.         the patch code.
  766.         If PATT_Disabled,TRUE is set with InstallPatchTags() the patch will
  767.         can not be called until explicitly enabled by a call to SetPatchTags().
  768.     PATT_AddRemoveHook (V4) (struct Hook *) - Add a Hook, which is called by
  769.         patch.library whenever a patch is removed from memory. Neither
  770.         the Hook structure nor the hookfunction are copied into internal
  771.         memory. So freeing these structures must be accomplished by the
  772.         hookfunction itself. It must also preserve all registers.
  773.         The hookobject (Register A2) for this hook is the patch structure.
  774.         For more information about hooks see utility/hooks.h,
  775.         utility.library/CallHook() or the RKMs.
  776.         Unlike many tags, you may specify this tag more than once in one
  777.         taglist to add multiple hooks.
  778.     PATT_RemRemoveHook (V4)    (struct Hook *) - Remove a Hook installed 
  779.         with PATT_AddRemoveHook.
  780.         Unlike many tags, you may specify this tag more than once in one
  781.         taglist to remove multiple hooks.
  782.     PATT_UserData (V5) (ULONG) - Attach userdata to a patch.
  783.         Use this tag only, if you are the owner (creator) of the patch.
  784.     PATT_AddTaskPattern (V5) (STRPTR) - Add a pattern of tasknames to the patch
  785.         TaskList. The pattern may contain dos wildcards.
  786.         Patch.library takes care that one pattern appears only once in the
  787.         TaskList.
  788.         Unlike many tags, you may specify this tag more than once in one
  789.         taglist to add multiple patterns to the list.
  790.         This tag only works with kickstart V37+.
  791.         DO NOT USE this tag, if you patch one of the following dos-functions:
  792.         MatchPattern() or MatchPatternNocase()
  793.     PATT_RemTaskPattern (V5) (STRPTR) - Remove a taskpattern from the
  794.         TaskList.
  795.         Unlike many tags, you may specify this tag more than once in one
  796.         taglist to remove multiple patterns from the list.
  797.     PATT_StackSize (V5) (ULONG) - Minimum stacksize (in bytes) your function
  798.         requires. This value should be a multiple of 4 and more than 256.
  799.         If a taskpattern (see PATT_AddtaskPattern) is active,
  800.         at least 1500 Bytes should be specified.
  801.         DO NOT USE this tag, if you patch one of the following exec-functions:
  802.         FindTask(), AllocMem(), FreeMem() or StackSwap()
  803.         You may specify zero to turn stack extension off.
  804.     PATT_Priority (V5) (BYTE) - Priority of the patch
  805.         valid range: -127...+126
  806.         It indicates the sequence of patches, if more than one patch
  807.         for a function is to be installed.
  808.         The original code has a priority of 0.
  809.         Priority:    Meaning:
  810.         >0: patch will be executed before the original
  811.         <0: patch will be executed after the original
  812.         =0: patch will be executed instead of the original (default)
  813.         Normally only the priorities +5, 0, -5 should be used.
  814.         Changing the priority of an active patch is a difficult
  815.         operation. It may fail with PATERR_PatchInUse.
  816.         You MUST NOT change the priority of a patch in respect
  817.         to the original function (see above).
  818.  
  819.  
  820.  
  821.    RESULT
  822.     Error = errorcode as defined in patch.h.
  823.         PATERR_Ok
  824.             Indicates success of the operation.
  825.         PATERR_OutOfMem
  826.             Indicates that there was not enough memory to
  827.             complete the operation.
  828.         PATERR_PatchInUse
  829.             Indicates that some other task is using the
  830.             installed function and the priority of the patch can't
  831.             be changed right now.
  832.             Your task may wait and try again later.
  833.         PATERR_InvalidHandle
  834.             Indicates that the pointer to the patch passed
  835.             to the function was not or is no longer valid.
  836.             This might happen, if you pass a wrong pointer or
  837.             you got the pointer via FindPatch() and another
  838.             task has removed the patch before this task called
  839.             RemovePatchTags().
  840.         PATERR_NoTaskList
  841.             No valid TaskList is attached to the patch.
  842.             The SetPatchA() function with the PATT_CreateTaskList tag
  843.             specified, must be called to allocate a TaskList.
  844.         PATERR_TaskListExists
  845.             PATT_CreateTaskList was specified, but there already
  846.             exists a TaskList.
  847.         PATERR_InvalidTaskList
  848.             PATT_CreateTaskList was specified with a wrong parameter
  849.         PATERR_KickTooOld
  850.             PATT_AddTaskPattern was used on a system with Kickstart V36
  851.             or lower.
  852.         PATERR_InvalidPattern
  853.             PATT_AddTaskList was used with a string, which contained an
  854.             invalid pattern. See dos.library ParsePattern() for more
  855.             informations.
  856.         PATERR_Restricted
  857.             PATT_AddTaskPattern or PATT_StackSize was used for a
  858.             forbidden function (see TAGS).
  859.  
  860.    NOTES
  861.     Using the TaskList feature provided by this function will
  862.     (by a huge amount in the case of PATT_AddTaskPattern) increase
  863.     the stackusage of the patched function.
  864.     See PATT_StackSize for a solution.
  865.  
  866.    BUGS
  867.  
  868.    SEE ALSO
  869.     InstallPatchTags(), Patch.h, PatchTags.h, dos.library/ParsePatternNoCase(),
  870.     dos.library/ParsePattern()
  871.  patch.library/SetPatchProjectA                 patch.library/SetPatchProjectA
  872.  
  873.    NAME
  874.     SetPatchProjectA -- Changes certain attributes of a project. (V5)
  875.     SetPatchProject -- varargs stub for SetPatchProjectA(). (V5)
  876.  
  877.    SYNOPSIS
  878.     Error = SetPatchProjectA( project, taglist )
  879.     D0                      A0       A1
  880.  
  881.     ULONG Error SetPatchProjectA( project, struct TagItem *);
  882.  
  883.     Error = SetPatchProject( project, firsttag, ...)
  884.  
  885.     ULONG Error SetPatchProject( project, Tag, ...);
  886.  
  887.    FUNCTION
  888.     Changes certain attributes of a group of patches belonging to one
  889.     project. For now (V5) it mainly calls SetPatch() recursively for
  890.     all patches belonging to the project.
  891.     Certain project specific tags may be implemented later.
  892.  
  893.    INPUTS
  894.     project = pointer to a patch project obtained via CreatePatchProject()
  895.               or NULL for no action
  896.     taglist = pointer to array of tags
  897.  
  898.    TAGS
  899.     see SetPatch() for a list of valid tags.
  900.  
  901.    RESULT
  902.     Error = errorcode as defined in patch.h.
  903.         see SetPatch() for a list of errorcodes
  904.  
  905.    NOTES
  906.     Currently (V5) SetPatchProject() stops changing patches, when any of
  907.     the internal calls to SetPatch() return an error. Therefore when
  908.     SetPatchProject() returns an error, some patches may have been changed
  909.     and others not.
  910.  
  911.    BUGS
  912.  
  913.    SEE ALSO
  914.     SetPatch(), Patch.h, PatchTags.h, 
  915.  patch.library/WaitRemovePatch                   patch.library/WaitRemovePatch
  916.  
  917.    NAME
  918.     WaitRemovePatch -- Waits until it is possible to remove a patch.
  919.  
  920.    SYNOPSIS
  921.     Error = WaitRemovePatch( patch )
  922.     D0                 A0
  923.  
  924.     ULONG Error WaitRemovePatch( struct Patch * );
  925.  
  926.    FUNCTION
  927.     This function is obsolete from V2 on, use RemovePatchTags() instead.
  928.     It effectively calls the new function
  929.     RemovePatchTags(patch,  PATT_TimeOut, 0x7fffffff,
  930.                 PATT_DelayedExpunge, FALSE,
  931.                 TAG_DONE)
  932.  
  933.    INPUTS
  934.     patch = pointer to the patch structure or NULL for no action
  935.  
  936.    RESULT
  937.     Error = errorcode as defined in patch.h.
  938.         (for more information see RemovePatchTags() )
  939.  
  940.    NOTES
  941.  
  942.    BUGS (?)
  943.     This function will never return, if the patched library function
  944.     crashed for some reason.
  945.  
  946.    SEE ALSO
  947.     RemovePatchTags()
  948.