摘要:
One embodiment of the present invention provides a system that modifies a function defined within an application programming interface (API) so that the function includes additional code. The system receives an additional code module to be integrated into the function within the API. The system also receives a command to integrate the additional code module into the function. This command is received through a pre-defined function within the API for integrating additional code into functions within the API. In response to the command, the system links the additional code into the function so that the additional code module is executed when the function is called. In one embodiment of the present invention, linking the additional code module into the function involves linking the additional code module as an entry function that is executed at the beginning of the function. In one embodiment of the present invention, linking the additional code module into the function involves linking the additional code module as an exit function that is executed at the end of the function. In one embodiment of the present invention, linking the additional code module into the function involves linking the additional code module as a replacement for original code for the function.