`Roy et al.
`
`(10) Patent N0.:
`(45) Date of Patent:
`
`US 6,721,809 B1
`Apr. 13, 2004
`
`US006721809B1
`
`(54) METHOD AND APPARATUS FOR
`CONFIGURING EXTENSIBLE APPLICATION
`PROGRAMMING INTERFACES
`
`(75) Inventors: Anindo Roy, Fremont, CA (US); M.
`Shoaib Lari, Palo Alto, CA (US);
`Sreenivas Gollupudi, Fremont, CA
`(US); Debashis Saha, Menlo Park, CA
`(US); Lakshminarayanan
`Chidambaran, Fremont, CA (US);
`Debashish Chatterjee, Fremont, CA
`(Us)
`(73) Assignee: Oracle International Corporation,
`Redwood Shores, CA (US)
`
`( * ) Notice:
`
`Subject to any disclaimer, the term of this
`patent is extended or adjusted under 35
`U.S.C. 154(b) by 486 days.
`
`(21) Appl. No.: 09/643,318
`(22) Filed:
`Aug. 21, 2000
`
`(51) Int. Cl.7 ................................................ .. G06F 9/00
`(52) US. Cl. ...................................... .. 709/328; 709/310
`(58) Field of Search ............................... .. 709/328, 318,
`709/329
`
`(56)
`
`References Cited
`
`U.S. PATENT DOCUMENTS
`
`5,819,090 A * 10/1998 Wolf et al. ............... .. 709/320
`6,535,903 B2 * 3/2003 Yates et al. ............... .. 709/100
`
`Primary Examiner—John Courtenay
`Assistant Examiner—The Thanh Ho
`(74) Attorney, Agent, or Firm—Park, Vaughan & Fleming
`LLP
`
`(57)
`
`ABSTRACT
`
`One embodiment of the present invention provides a system
`that modi?es a function de?ned Within an application pro
`gramming 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-de?ned 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 addi
`tional code module as a replacement for original code for the
`function.
`
`* cited by examiner
`
`36 Claims, 4 Drawing Sheets
`
`
`
`
`
`FUNCTIONQ { ORIGINAL CODE 202
`
`FUNCTIONO {
`ENTRY FU NCTlON
`204
`
`ORlGlNAL CODE
`202
`
`EXIT FUNCTION
`206
`
`FUNCTIONO {
`‘“-~* REPLACEMENT CODE
`208
`
`Page 1 of 11
`
`GOOGLE EXHIBIT 1029
`
`
`
`U.S. Patent
`
`Apr. 13, 2004
`
`Sheet 1 0f 4
`
`US 6,721,809 B1
`
`DEVELOPER
`110
`
`I‘:
`
`APPLICATION PROGRAMMING
`INTERFACE (WITH PRE-DEFINED
`FUNCTION FOR INTEGRATING < ----- --
`ADDITIONAL CODE)
`102
`
`THIRD PARTY
`CODE
`10B
`
`COMPUTER
`SYSTEM
`100
`
`DATfOZASE
`
`STORAGE
`DEvIcE
`10s
`
`FUNCTIONQ {
`ENTRY FUNCTION
`204
`
`ORIGINAL CODE
`
`---
`
`.oar"
`
`FUNCTIONQ {
`ORIGINAL CODE
`
`..... --
`
`}
`
`202
`
`ExIT FUNCTION
`206
`
`}
`
`FUNCTIONO I
`
`REPLACEMENT CODE
`20s
`
`}
`
`Page 2 of 11
`
`
`
`U.S. Patent
`
`Apr. 13, 2004
`
`Sheet 2 0f 4
`
`US 6,721,809 B1
`
`FUNCTlON(){
`ENTRY
`302
`
`ENTRY
`303
`
`ENTRY
`304
`
`_’ m_
`
`FUNCTIQNO ORIGINAL CODE
`
`202
`
`}
`
`REPLACEMENT
`308
`v
`
`REPLACEMENT
`309
`v
`
`REPLACEMENT _h_____
`310
`v
`
`EXIT
`312
`
`EXIT
`313
`
`EXIT
`314
`
`}
`
`USER
`CALLBACK
`ARRAY
`400
`
`ENTRY
`ENTRY
`r» FUNCTlON -> FUNCTION -> NULL
`5
`402
`403
`f
`
`ExIT
`EXIT
`-
`"
`‘ 422 ’ """"" "-~> FUNCTION -> FUNCTION -> NULL
`/- 421
`q 423
`406
`407
`
`
`
`ENTRY 42°
`
`REPLACEMENT
`REPLACEMENT
`5
`L .................. my FUNCTION -p FUNCTION —> NULL
`410
`411
`
`FIG. 4
`
`Page 3 of 11
`
`
`
`U.S. Patent
`
`Apr. 13, 2004
`
`Sheet 3 0f 4
`
`US 6,721,809 B1
`
`/- f001 500
`CALLBACK
`CONFIGURATION
`CODE
`502
`
`K- foo2 510
`CALLBACK
`CONFIGURATION
`CODE
`512
`
`/- foo3 520
`CALLBACK
`CONFIGURATION
`CODE
`522
`
`CALLBACK
`ROUTINES
`503
`
`CONTEXT
`504
`
`CALLBACK
`ROUTINES
`513
`
`CONTEXT
`514
`
`CALLBACK
`ROUTINES
`523
`
`CONTEXT
`524
`
`RETRIEVE SHELL
`ENVIRONMENT VARIABLE
`602
`
`LOOK FOR LIBRARY
`ROUTINES SPECIFIED IN
`SHELL ENVIRONMENT
`VARIABLE
`604
`
`LOAD CALLS ASSOCIATED
`WITH LIBRARY ROUTINES
`606
`
`FIG. 6
`
`Page 4 of 11
`
`
`
`U.S. Patent
`
`Apr. 13, 2004
`
`Sheet 4 0f 4
`
`US 6,721,809 B1
`
`START
`700
`
`RECEIVE ADDITIONAL CODE
`TO BE INTEGRATED INTO
`FUNCTION
`702
`
`EXECUTE CALLBACK
`REGISTRATION FUNCTION
`TO INTEGRATE ADDITIONAL
`CODE INTO FUNCTION
`704
`
`LINK ADDITIONAL CODE
`MODULE INTO FUNCTION
`706
`
`FIG. 7
`
`START
`800 v
`
`RETRIEVE INDEX TO
`CALLBACK FUNCTION
`B02
`
`RETRIEVE INDEX TO
`CONTEXT
`B04
`
`SPECIFY WHICH CALL
`806
`
`SPECIFY WHICH TYPE OF
`CALL
`808
`
`MODIFY DATA STRUCTURES
`TO INSERT CALLBACK
`FUNCTION
`B1 0
`
`FIG. 8
`
`Page 5 of 11
`
`
`
`US 6,721,809 B1
`
`1
`METHOD AND APPARATUS FOR
`CONFIGURING EXTENSIBLE APPLICATION
`PROGRAMMING INTERFACES
`
`BACKGROUND
`
`1. Field of the Invention
`The present invention relates to application programming
`interfaces (APIs) for computer systems. More speci?cally,
`the present invention relates to a method and an apparatus
`for extending the functionality of functions de?ned Within
`an application programming interface.
`2. Related Art
`System softWare designers typically de?ne an application
`program interface (API) in order to de?ne a boundary across
`Which application softWare accesses services provided by an
`application platform, such as a database or an operating
`system. For example, a database system typically includes
`an API de?ning hoW functions that can be called to perform
`various database operations. Similarly, an operating system
`typically includes an API de?ning hoW functions can be
`called to perform operating system tasks.
`There are a number of advantages to using an API. AnAPI
`insulates the application programmer from the intricacies of
`the operations performed by the underlying application
`platform. This simpli?es the task of Writing application
`programs. Additionally, applications designed around an
`API are modular, because they can be used With any
`application platform that supports the same API. For
`example, application that is Written to access a ?rst database
`Within a ?rst computer system through an API can easily be
`moved to a second computer system to access a second
`database if the second database also supports the same API.
`Unfortunately, using an API also has a number of disad
`vantages. Application platforms typically evolve over time.
`Consequently, it is often necessary to add neW functionality
`to an API. This is typically accomplished by shipping a neW
`version of the application platform and the associated API to
`the customer, so that the customer can link the neW version
`of the application platform and API into the customer’s
`application programs. This installation and linking process
`can be very inconvenient and time-consuming.
`Furthermore, certain application programs may require
`more functionality than is provided by an API. Application
`platforms are also commonly used in conjunction With third
`party code, and this third party code often requires additional
`functionality that is not present in the API for the application
`platform. In order to provide this additional functionality, an
`application programmer or third party code developer must
`Write external functions (if this is possible). Alternatively,
`the application programmer must somehoW convince the
`designer of the application platform to incorporate the
`additional functionality into the application platform and the
`API. Either one of these options requires the application
`programmer or third party code developer to perform a large
`amount of Work in order to make relatively minor changes
`to the functionality provided by functions de?ned Within an
`API.
`Hence, What is needed is a method and an apparatus that
`alloWs an API to be easily modi?ed by an application
`programmer or a third party code developer to include
`additional functionality.
`
`10
`
`15
`
`25
`
`35
`
`45
`
`55
`
`SUMMARY
`One embodiment of the present invention provides a
`system that modi?es a function de?ned Within an application
`
`65
`
`2
`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-de?ned 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. In a variation on this embodiment, the
`system con?gures the additional code module to selectively
`call the original code for the function.
`In one embodiment of the present invention, the system
`receives a second additional code module to be integrated
`into the function. Upon receiving a second command to
`integrate the second additional code module into the
`function, the system links the second additional code mod
`ule into the function so that the second additional code
`module is executed along With the additional code module
`When the function is called.
`In one embodiment of the present invention, linking the
`second additional code module into the function involves
`chaining the second additional code module With the addi
`tional code module so that the second additional code
`module is executed in sequence With the additional code
`module. In a variation on this embodiment, chaining the
`second additional code module With the additional code
`module involves facilitating passing at least one parameter
`betWeen the additional code module and the second addi
`tional code module.
`In one embodiment of the present invention, linking the
`additional code module into the function involves con?g
`uring the linkage to ensure that executing the additional code
`module does not involve recursion.
`In one embodiment of the present invention, linking the
`additional code module into the function involves ensuring
`an error code is propagated back to the function.
`In one embodiment of the present invention, during
`development of the function, the system con?gures the
`function to include callback points for receiving the addi
`tional code module.
`
`BRIEF DESCRIPTION OF THE FIGURES
`FIG. 1 illustrates a computer system including a con?g
`urable API in accordance With an embodiment of the present
`invention.
`FIG. 2 illustrates options for modifying a function Within
`an API in accordance With an embodiment of the present
`invention.
`FIG. 3 illustrates in general hoW a function Within an API
`can be modi?ed in accordance With an embodiment of the
`present invention.
`FIG. 4 illustrates a data structure involved in modifying
`an API in accordance With an embodiment of the present
`invention.
`
`Page 6 of 11
`
`
`
`US 6,721,809 B1
`
`3
`FIG. 5 illustrates code and data that can be used to modify
`an API in accordance With an embodiment of the present
`invention.
`FIG. 6 is a How chart illustrating hoW calls are loaded in
`accordance With an embodiment of the present invention.
`FIG. 7 is a How chart illustrating hoW code is integrated
`into a function Within an API in accordance With an embodi
`ment of the present invention.
`FIG. 8 is a How chart illustrating more speci?cally hoW
`code is integrated into the function Within the API in
`accordance With an embodiment of the present invention.
`
`DETAILED DESCRIPTION
`The folloWing description is presented to enable any
`person skilled in the art to make and use the invention, and
`is provided in the context of a particular application and its
`requirements. Various modi?cations to the disclosed
`embodiments Will be readily apparent to those skilled in the
`art, and the general principles de?ned herein may be applied
`to other embodiments and applications Without departing
`from the spirit and scope of the present invention. Thus, the
`present invention is not intended to be limited to the embodi
`ments shoWn, but is to be accorded the Widest scope
`consistent With the principles and features disclosed herein.
`The data structures and code described in this detailed
`description are typically stored on a computer readable
`storage medium, Which may be any device or medium that
`can store code and/or data for use by a computer system.
`This includes, but is not limited to, magnetic and optical
`storage devices such as disk drives, magnetic tape, CDs
`(compact discs) and DVDs (digital video discs), and com
`puter instruction signals embodied in a transmission
`medium (With or Without a carrier Wave upon Which the
`signals are modulated). For example, the transmission
`medium may include a communications netWork, such as
`the Internet.
`Computer System
`FIG. 1 illustrates a computer system 100 including a
`con?gurable API 102 in accordance With an embodiment of
`the present invention. Computer system 100 can generally
`include any type of computer system, including, but not
`limited to, a computer system based on a microprocessor, a
`mainframe computer, a digital signal processor, a personal
`organiZer, a device controller, and a computational engine
`Within an appliance.
`Computer system 100 includes API 102, Which de?nes
`functions to access database 104. Note that API 102 can
`generally include any type of API for accessing services
`from an application platform, and is not meant to be limited
`to an API for a database. For example, in an alternative
`embodiment of the present invention, API 102 de?nes
`functions to access services from an operating system. Note
`that API 102 includes a prede?ned function to facilitate
`integrating additional code into API 102.
`Database 104 can include any type of system that facili
`tates storing data in non-volatile storage. Database 104
`communicates With storage device 106. Storage device 106
`can include any type of non-volatile storage device that can
`be coupled to a computer system. This includes, but is not
`limited to, magnetic, optical, and magneto-optical storage
`devices, as Well as storage devices based on ?ash memory
`and/or battery-backed up memory.
`Functions Within API 102 receive third party code 108 to
`be integrated into functions Within API 102. Third party
`code 108 can generally include any code that provides
`additional functionality for functions de?ned Within API
`102, and is not meant to be limited to code provided by a
`third party.
`
`4
`Third party code 108 is integrated into API 102 by
`developer 110, Who makes use of the pre-de?ned function
`for integrating additional code into API 102.
`Modifying a Function Within an API
`FIG. 2 illustrates options for modifying a function Within
`API 102 in accordance With an embodiment of the present
`invention. The original function on the left-hand-side of
`FIG. 2 starts With original code 202, Which performs an
`action that involves communicating With the underlying
`application platform. This function can be modi?ed by
`incorporating an entry function 204 and/or an exit function
`206 into the original function along With original code 202
`(see the upper right-hand side of FIG. 2).
`Entry function 204 and exit function 206 can be used to
`add pre-processing and/or post-processing code to the origi
`nal function. For example, entry function 204 and exit
`function 206 can be used to add tracing and performance
`measurement code to the original function.
`The original function can also be modi?ed by inserting
`replacement code 208 in place of the original code 202 (see
`loWer right-hand side of FIG. 2).
`FIG. 3 illustrates in general hoW a function Within an API
`can be modi?ed in accordance With an embodiment of the
`present invention. This function includes a number of entry
`functions 302—304, Which are chained together so that they
`execute sequentially. The function also includes a number of
`exit functions 312—314, Which can similarly be chained
`together so that they execute sequentially.
`Furthermore, the function includes a number of replace
`ment functions 308—310, Which can be chained together,
`except that these replacement functions can selectively
`decide Whether or not to call the next replacement function
`in the chain. Note that the last replacement function in the
`chain can optionally call original code 202.
`The above-described function structure is implemented
`by con?guring each function de?ned Within API 102 so that
`the function provides callback points to call entry functions,
`replacement functions and exit functions. Asample function
`structure is illustrated by the example pseudo-code in Table
`1 beloW.
`Data Structures and Code for Modifying Functions
`FIG. 4 illustrates a data structure that facilitates modify
`ing API 102 in accordance With an embodiment of the
`present invention. The data structure illustrated in FIG. 4
`includes user callback array 400, Which stores references to
`callback functions associated With modi?ed functions in API
`102.
`By referring to user callback array 400, the system is able
`to determine Which entry functions, replacement functions
`and exit functions are associated With a speci?c modi?ed
`function Within API 106.
`
`10
`
`15
`
`25
`
`35
`
`45
`
`TABLE 1
`
`55
`
`Int APISampleCall( )
`{
`
`ReturnStatus = PreProcessingCode
`
`. .,
`
`. .);
`&ProcessingErrorNumber, .
`if(ReturnStatus ! = CONTINUE)
`
`errorcode = ProcessingErrorNumber;
`goto PostProcessing;
`
`}
`. .;
`APISampleCall body .
`errorcode = error code returned from APISampleCall body;
`PostProcessing:
`ProcessingErrorNumber = errorcode;
`PostProcessingCode . ., &ProcessingErrorNumber, .
`errorcode = ProcessingErrorNumber;
`
`. .);
`
`65
`
`Page 7 of 11
`
`
`
`US 6,721,809 B1
`
`5
`
`TABLE l-continued
`
`return errorcode;
`
`int PreProcessingCode(. . ., int *ProcessingErrorNumber, .
`
`.
`
`{
`
`returnStatus = CONTINUE;
`/* We go thru all ENTRY callbacks irrespective of returnStatus */
`for all ENTRY callbacks do
`
`(*entryCallback) (callbackcontext, .
`
`. .);
`
`l
`for all REPLACEMENT callbacks do
`{
`
`returnStatus = (*replacementCallback) (callbackcontext,
`&errorno, .
`. .);
`/* if the return Status is not CONTINUE then We
`stop processing and
`and record the error number (may be 0) */
`if (returnStatus ! = CONTINUE)
`
`*ProcessingErrorNumber = errorno;
`break;
`
`return returnStatus;
`
`int PostProcessingCode(. .
`
`., int *ProcessingErrorNumber, .
`
`.
`
`returnStatus = CONTINUE;
`/* We go through all EXIT callbacks irrespective of returnStatus */
`for all EXIT callbacks do
`{
`/* Any Exit callback may decide to change the
`ProcessingErrorNumber */
`(*exitCallback) (callbackcontext,
`ProcessingErrorNumber. . .);
`
`return returnStatus;
`
`User callback array 400 includes a number of entries,
`including entry 420. Entry 420 includes three different
`pointers 421—423. Pointer 421 points to a NULL-terminated
`linked list containing structures associated With entry func
`tions 402—403. Pointer 422 points to a NULL-terminated
`linked list containing structures associated With replacement
`functions 410—411. Pointer 423 points to a NULL
`terminated linked list containing structures associated With
`exit functions 406—407.
`Note that the each of the above-discussed structures
`contains a pointer to an associated callback routine, as Well
`as a pointer to context information associated With the
`callback routine.
`FIG. 5 illustrates code and data that can be used to modify
`an API in accordance With an embodiment of the present
`invention. FIG. 5 contains a number of modules containing
`code and data, including modules foo1 500, foo2 510 and
`foo3 520. The top portion of module fool 500 includes
`callback con?guration code 502. Callback con?guration
`code 502 con?gures at least one function Within API 102 to
`execute at least one routine from callback routines 503
`Within module foo1 500. Module foo1 500 additionally
`includes context 504, Which contains contextual information
`parameters) to be provided to callback routines 503.
`Similarly, module foo2 includes callback con?guration
`code 512, callback routines 513 and context 514, and
`module foo3 includes callback con?guration code 522,
`callback routines 523 and context 524. Note that the mod
`ules foo1 500, foo2 510 and foo3 500 may originate from
`different entities that are supplying their oWn code to be
`added to API 102.
`Process of Loading Calls
`FIG. 6 is a How chart illustrating hoW calls are loaded into
`functions Within API 102 in accordance With an embodiment
`
`6
`of the present invention. This con?guration process can take
`place either statically at API initialization time, or dynami
`cally at environment initialization time for a speci?c process
`and/or user. By con?guring the API at API initialization
`time, the API can be modi?ed by the API designers to
`provide neW functionality Without having distribute a neW
`API; only neW code for updating the API has to be distrib
`uted. This neW functionality can be implemented through
`callbacks to the neW code Within the existing functions.
`In order to load the calls, the system ?rst retrieves a shell
`environment variable (step 602), and then looks for any
`library routines that are speci?ed in the shell environment
`variable (step 604). For example, the shell environment
`variable may contain the string “foo1;foo2;foo3”, Which
`speci?es the code modules foo1 500, foo2 510 and foo3 520
`Which are illustrated in FIG. 5. Next, the system loads calls
`associated With the library routines foo1 500, foo2 510 and
`foo3 520 by executing callback con?guration code modules
`502, 512 and 522.
`Process of Integrating Code into a Function
`FIG. 7 is a How chart illustrating hoW additional code is
`integrated into a function Within an API in accordance With
`an embodiment of the present invention. FIG. 7 illustrates in
`more detail the process that takes place in step 606 of FIG.
`6. After receiving a library routine module, such as module
`foo1 500, the system executes callback con?guration code
`502. While executing callback con?guration code 502, the
`system executes at least one callback registration function to
`integrate additional code into a speci?c function Within API
`102. Executing this callback registration function causes the
`additional code to be linked into the speci?ed function.
`FIG. 8 is a How chart illustrating more speci?cally hoW
`code is integrated into the speci?c function Within the API
`in accordance With an embodiment of the present invention.
`This code is integrated into the function by using a callback
`registration function.
`In one embodiment of the present invention, the callback
`registration function has the folloWing form
`“CallbackRegister(cbptr, ctxptr, fcode, When, .
`.
`. )”. This
`function takes in a number of parameters including “cbptr,”
`Which is a pointer to the callback function to be inserted into
`the speci?ed API function. “ctxptr” is a pointer to context
`information associated With the callback function. “fcode”
`speci?es a function Within API 102 into Which the callback
`function is to be inserted. The parameter “When” speci?es
`the point Within the speci?ed function at Which the callback
`function is to be inserted (entry, replacement or exit).
`In executing the callback registration function, the system
`?rst retrieves an index to the callback routine, Which is
`received as the parameter “cbptr” (step 802). Next, the
`system retrieves an index to the context information for the
`callback function, Which is received as the parameter 804
`(step 804). The system also retrieves the parameter “fcode”
`to specify Which function Within API 102 the callback is to
`be inserted into (step 806). The system also retrieves the
`parameter “When” Which speci?es When the callback is
`made Within the speci?ed function (entry, replacement or
`exit) (step 808). Finally, the function modi?es data struc
`tures in order to insert the callback into the speci?ed
`function (step 810). For example, the system can insert an
`entry function structure into the NULL-terminated linked
`list pointed to by pointer 421 in FIG. 4. This causes the entry
`function to be executed Whenever the associated function is
`called. Note that the context pointer ctxptr is inserted into
`the entry function structure so that the context is associated
`With the function.
`The foregoing descriptions of embodiments of the inven
`tion have been presented for purposes of illustration and
`
`15
`
`25
`
`35
`
`45
`
`55
`
`65
`
`Page 8 of 11
`
`
`
`US 6,721,809 B1
`
`7
`description only. They are not intended to be exhaustive or
`to limit the present invention to the forms disclosed.
`Accordingly, many modi?cations and variations Will be
`apparent to practitioners skilled in the art. Additionally, the
`above disclosure is not intended to limit the present inven
`tion. The scope of the present invention is de?ned by the
`appended claims.
`What is claimed is:
`1. A method for modifying an existing function Within an
`application programming interface Within a computer sys
`tem so that the existing function includes additional code,
`comprising:
`receiving an additional code module to be integrated into
`the existing function Within the application program
`ming interface;
`Wherein the application programming interface de?nes a
`plurality of functions and Wherein the additional code
`module modi?es the existing function Within the appli
`cation programming interface;
`receiving a command to integrate the additional code
`module into the existing function Within the application
`programming interface;
`Wherein the command is received through a pre-de?ned
`function Within the application programming interface
`for integrating additional code into existing functions
`Within the application programming interface; and
`linking the additional code into the existing function
`Within the application programming interface so that
`the additional code module is executed When the exist
`ing function is called;
`Whereby an application is able to modify the functionality
`of the application programming interface; and
`Whereby the additional code modi?es the existing func
`tion Within the application programming interface
`instead of adding neW functions to the application
`programming interface.
`2. The method of claim 1, Wherein linking the additional
`code module into the existing function involves linking the
`additional code module as an entry function that is executed
`at the beginning of the existing function.
`3. The method of claim 1, Wherein linking the additional
`code module into the existing function involves linking the
`additional code module as an exit function that is executed
`at the end of the existing function.
`4. The method of claim 1, Wherein linking the additional
`code module into the existing function involves linking the
`additional code module as a replacement for original code
`for the existing function.
`5. The method of claim 4, further comprising con?guring
`the additional code module to selectively call the original
`code for the existing function.
`6. The method of claim 1, further comprising:
`receiving a second additional code module to be inte
`grated into the existing function Within the application
`programming interface;
`receiving a second command to integrate the second
`additional code module into the existing function
`Within the application programming interface;
`Wherein the second command is received through the
`pre-de?ned function Within the application program
`ming interface; and
`linking the second additional code module into the exist
`ing function Within the application programming inter
`face so that the second additional code module is
`executed along With the additional code module When
`the existing function is called.
`
`25
`
`35
`
`55
`
`65
`
`8
`7. The method of claim 6, Wherein linking the second
`additional code module into the existing function involves
`one of:
`linking the second additional code module as a replace
`ment for the additional code module for the existing
`function;
`linking the additional code module as an entry function in
`the beginning of the existing function, so that the
`additional code module is executed at the beginning of
`the existing function; and
`linking the second additional code module as an exit
`function at the end of the existing function, so that the
`additional code module is executed at the end of the
`existing function.
`8. The method of claim 6, Wherein linking the second
`additional code module into the existing function involves
`chaining the second additional code module With the addi
`tional code module so that the second additional code
`module is executed in sequence With the additional code
`module.
`9. The method of claim 8, Wherein chaining the second
`additional code module With the additional code module
`involves facilitating passing at least one parameter betWeen
`the additional code module and the second additional code
`module.
`10. The method of claim 1, Wherein linking the additional
`code module into the existing function involves con?guring
`the linkage to ensure that executing the additional code
`module does not involve recursion.
`11. The method of claim 1, Wherein linking the additional
`code module into the existing function involves ensuring an
`error code is propagated back to the existing function.
`12. The method of claim 1, further comprising, during
`development of the plurality of functions de?ned Within the
`application programming interface, con?guring the existing
`function to include callback points for receiving the addi
`tional code module.
`13. A computer-readable storage medium storing instruc
`tions that When executed by a computer cause the computer
`to perform a method for modifying an existing function
`Within an application programming interface Within a com
`puter system so that the existing function includes additional
`code, comprising:
`receiving an additional code module to be integrated into
`the existing function Within the application program
`ming interface;
`Wherein the application programming interface de?nes a
`plurality of functions and Wherein the additional code
`module modi?es the existing function Within the appli
`cation programming interface;
`receiving a command to integrate the additional code
`module into the existing function Within the application
`programming interface;
`Wherein the command is received through a pre-de?ned
`function Within the application programming interface
`for integrating additional code into existing functions
`Within the application programming interface; and
`linking the additional code into the existing function
`Within the application programming interface so that
`the additional code module is executed When the exist
`ing function is called;
`Whereby an application is able to modify the functionality
`of the application programming interface; and
`Whereby the additional code modi?es the existing func
`tion Within the application programming interface
`
`Page 9 of 11
`
`
`
`US 6,721,809 B1
`
`9
`instead of adding neW functions to the application
`programming interface.
`14. The computer-readable storage medium of claim 13,
`Wherein linking the additional code module into the existing
`function involves linking the additional code module as an
`entry function that is executed at the beginning of the
`existing function.
`15. The computer-readable storage medium of claim 13,
`Wherein linking the additional code module into the existing
`function involves linking the additional code module as an
`exit function that is executed at the end of the existing
`function.
`16. The computer-readable storage medium of claim 13,
`Wherein linking the additional code module into the existing
`function involves linking the additional code module as a
`replacement for origina