Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
zsuraski committed Mar 29, 2000
1 parent 6c8f9bf commit fcf0afc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
25 changes: 18 additions & 7 deletions Zend/zend_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int zend_load_extension(char *path)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
zend_extension extension, *new_extension;
zend_extension *new_extension;
zend_extension_version_info *extension_version_info;

handle = DL_LOAD(path);
Expand Down Expand Up @@ -106,21 +106,30 @@ int zend_load_extension(char *path)
return FAILURE;
}
}
return zend_register_extension(new_extension, handle);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
return FAILURE;
#endif
}


int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
{
zend_extension extension;

extension = *new_extension;
extension.handle = handle;

zend_llist_add_element(&zend_extensions, &extension);

zend_append_version_info(&extension);
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/

zend_append_version_info(&extension);
return SUCCESS;
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
return FAILURE;
#endif
}


static void zend_extension_shutdown(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
Expand All @@ -141,7 +150,9 @@ void zend_shutdown_extensions()
void zend_extension_dtor(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_UNLOAD(extension->handle);
if (extension->handle) {
DL_UNLOAD(extension->handle);
}
#endif
}

Expand Down
5 changes: 3 additions & 2 deletions Zend/zend_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API extern zend_llist zend_extensions;

void zend_extension_dtor(zend_extension *extension);
int zend_load_extension(char *path);
int zend_load_extensions(char **extension_paths);
ZEND_API int zend_load_extension(char *path);
ZEND_API int zend_load_extensions(char **extension_paths);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
void zend_append_version_info(zend_extension *extension);
void zend_shutdown_extensions(void);

Expand Down

0 comments on commit fcf0afc

Please sign in to comment.