gsoc:2009:api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
gsoc:2009:api [2009/06/03 05:19] – vpj | gsoc:2009:api [2009/07/31 10:10] – Update : 31st July vpj | ||
---|---|---|---|
Line 13: | Line 13: | ||
===== Documentation ===== | ===== Documentation ===== | ||
+ | |||
+ | ==== Versioning ==== | ||
+ | Versions are in the format major.minor[.build[.revision]] in the string representation. These are stored in unsigned integers for ease of searching. The first 8 bits are used for the major, next 8 for the minor, next 8 for the build and the last 8 bits for the revision. It is possible to convert from the string representation to an unsigned integer using zend_eapi_toi and from an unsigned integer to the string format using zend_eapi_toa function. | ||
+ | |||
+ | ==== Macros ==== | ||
+ | |||
+ | <code c> | ||
+ | EAPI_SET_CALLBACK(ext_name, | ||
+ | </ | ||
+ | Sets a callback - with reference to a extension and a version - should be called during MINIT. The callback will be called after all extensions have been initialized. Callback will be called with a reference to the API of the specified extension. See zend_eapi_set_callback. | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | EAPI_SET_EMPTY_CALLBACK(callback) | ||
+ | </ | ||
+ | Sets an empty callback - should be called during MINIT. The callback will be called after all extensions have been initialized. See zend_eapi_set_empty_callback. | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | EAPI_CALLBACK_FUNCTION(callback) | ||
+ | </ | ||
+ | Defines the callback function. The callback function will be called with the following parameters: type, module_number, | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | EAPI_EMPTY_CALLBACK_FUNCTION(callback) | ||
+ | </ | ||
+ | Defines the empty callback function. The callback function will be called with the following parameters: typei and module_number, | ||
+ | ^ '' | ||
+ | |||
==== Functions ==== | ==== Functions ==== | ||
+ | All functions return '' | ||
+ | |||
<code c> | <code c> | ||
- | int zend_ext_api_register(char *ext_name, char *version, void *api) | + | int zend_eapi_register(char *ext_name, char * version_text, void *api, size_t size) |
</ | </ | ||
Registers an API | Registers an API | ||
Line 21: | Line 55: | ||
^ '' | ^ '' | ||
^ '' | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_version_toi(char *version_text, | ||
+ | </ | ||
+ | Converts a version in text format to an integer. | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_version_toa(uint version, char * version_text) | ||
+ | </ | ||
+ | Converts a version in integer format to a string | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_find_versions(char *ext_name, uint version, uint mask, uint *result, int *size, int buf_length) | ||
+ | </ | ||
+ | Finds the set of versions available. Matches versions if '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_get_latest_version(char *ext_name, uint *version) | ||
+ | </ | ||
+ | Gives the latest version of the extension available | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_exists(char *ext_name, char *version) | ||
+ | </ | ||
+ | Checks if the API is available | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_get(char *ext_name, char *version, void **api) | ||
+ | </ | ||
+ | Retrieves the API | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_set_empty_callback(int type, int module_number, | ||
+ | </ | ||
+ | Sets an empty callback - should be called during MINIT. The callback will be called after all extensions have been initialized. Use EAPI_SET_EMPTY_CALLBACK. | ||
+ | ^ '' | ||
+ | |||
+ | <code c> | ||
+ | int zend_eapi_set_callback(int type, int module_number, | ||
+ | </ | ||
+ | Sets a callback - with reference to a extension and a version - should be called during MINIT. The callback will be called after all extensions have been initialized. Callback will be called with a reference to the API of the specified extension. Use EAPI_SET_CALLBACK. | ||
+ | ^ '' | ||
+ | ^ '' | ||
+ | ^ '' | ||
===== Timeline ===== | ===== Timeline ===== | ||
Line 26: | Line 122: | ||
20th April to 23rd May – Community bonding period | 20th April to 23rd May – Community bonding period | ||
- | | + | |
- | * Submitting the proposed API and design for suggestions | + | * Submitting the proposed API and design for suggestions |
- | * Getting ideas from the developer community on how this should be developed | + | * Getting ideas from the developer community on how this should be developed |
- | * Finalizing the design | + | * Finalizing the design |
23rd May to 1st July – Implementing most important features | 23rd May to 1st July – Implementing most important features | ||
- | | + | |
- | * The interface for setting up the callback function will not be implemented at this stage, instead a simpler interface (e.g. php_get_api) would be provided | + | * The interface for setting up the callback function will not be implemented at this stage, instead a simpler interface (e.g. php_get_api) would be provided |
- | * Code written will be unit tested | + | * Code written will be unit tested |
- | * This would be a standard to be distributed for testing | + | * This would be a standard to be distributed for testing |
1st July to 10th July – Testing the implemented section | 1st July to 10th July – Testing the implemented section | ||
- | | + | |
- | * Any bugs encountered will be fixed | + | * Any bugs encountered will be fixed |
- | * Any suggestions for improvements will be considered and implemented | + | * Any suggestions for improvements will be considered and implemented |
10th July to 1st August – Completing the implementation of all features | 10th July to 1st August – Completing the implementation of all features | ||
- | | + | |
- | * Code written will be unit tested | + | * Code written will be unit tested |
- | * Behavior of the component in various scenarios with interdependencies among extensions, will be tested thoroughly | + | * Behavior of the component in various scenarios with interdependencies among extensions, will be tested thoroughly |
1st August to 4th August – Buffer | 1st August to 4th August – Buffer | ||
- | | + | |
- | * The completed extension API and dependency interface will be made available for the developer community | + | * The completed extension API and dependency interface will be made available for the developer community |
- | * Any improvements suggested will be considered and implemented | + | * Any improvements suggested will be considered and implemented |
4th August to 17th August – Testing | 4th August to 17th August – Testing | ||
- | | + | |
- | * All documentations will be completed | + | * All documentations will be completed |
- | * It will be ready for distribution at the end of testing | + | * It will be ready for distribution at the end of testing |
===== Progress ===== | ===== Progress ===== | ||
Line 66: | Line 162: | ||
== 12th May == | == 12th May == | ||
- | | + | |
- | * Working on the GIT repository - [[git:// | + | * Working on the GIT repository - [[git:// |
- | * Made a few changes to the proposed design | + | * Made a few changes to the proposed design |
- | | + | |
- | | + | |
== 15th May == | == 15th May == | ||
- | | + | |
- | * Coded the basic functionality | + | * Coded the basic functionality |
- | | + | |
== 23rd May == | == 23rd May == | ||
- | | + | |
- | * A simple list is used to store the set of versions available | + | * A simple list is used to store the set of versions available |
- | * Versions are represented in major.minor[.build[.revision]] or major.minor[.maintenance[.build]] formats; i.e. " | + | * Versions are represented in major.minor[.build[.revision]] or major.minor[.maintenance[.build]] formats; i.e. " |
- | | + | |
- | | + | |
== 31st May == | == 31st May == | ||
- | | + | |
- | * Functions to convert version from major.minor[.build[.revision]] format to an uint and vice versa are provided. | + | * Functions to convert version from major.minor[.build[.revision]] format to an uint and vice versa are provided. |
- | | + | |
- | * A few memory leaks were fixed | + | * A few memory leaks were fixed |
+ | |||
+ | == 5th June == | ||
+ | |||
+ | * Added some documentation of the interface | ||
+ | * Did some testing | ||
+ | |||
+ | == 27th June == | ||
+ | |||
+ | * Coded the callback registration | ||
+ | * Callbacks are called from php_module_startup (main/ | ||
+ | * Tested callbacks | ||
+ | * Update sample usage code | ||
+ | |||
+ | == 10th July == | ||
+ | |||
+ | * Callbacks | ||
+ | * Module number is passed to the callback | ||
+ | * Callbacks can be registered for the latest API version | ||
+ | * Testing | ||
+ | * Two extension with a set of standard unit test cases were added to the git repository | ||
+ | * API interface was tested with the extensions mbstring and exif | ||
+ | * Name | ||
+ | * eapi is used instead of ext_api | ||
+ | |||
+ | == 20th July == | ||
+ | * Callbacks with no extension specified | ||
+ | * Used dependency interface on mbstring/ | ||
+ | == 31st July == | ||
+ | * Setting callbacks accept module_number / type (through macros) | ||
+ | * Callbacks are called with module_number / type. e.g. usage - INIs could be registered from the callback | ||
+ | * Functions to search versions of an extension | ||
+ | * Example usage of the dependency interface : [[http:// | ||
+ | * How dependency interface is implemented on mbstring / exif : [[http:// |
gsoc/2009/api.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1