Skip to content

Commit

Permalink
add php_create_socket/php_destroy_socket PHP_SOCKETS_API to abel to c…
Browse files Browse the repository at this point in the history
…reate socket ressource in other ext
  • Loading branch information
mcarbonneaux committed Nov 10, 2014
1 parent 249e3de commit a0909f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ext/sockets/php_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ struct sockaddr_un {
#endif

PHP_SOCKETS_API int php_sockets_le_socket(void);
PHP_SOCKETS_API php_socket *php_create_socket(void);
PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC);

#define php_sockets_le_socket_name "Socket"

Expand Down
4 changes: 2 additions & 2 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ PHP_SOCKETS_API int php_sockets_le_socket(void) /* {{{ */

/* allocating function to make programming errors due to uninitialized fields
* less likely */
static php_socket *php_create_socket(void) /* {{{ */
PHP_SOCKETS_API php_socket *php_create_socket(void) /* {{{ */
{
php_socket *php_sock = emalloc(sizeof(php_socket));

Expand All @@ -398,7 +398,7 @@ static php_socket *php_create_socket(void) /* {{{ */
}
/* }}} */

static void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
PHP_SOCKETS_API void php_destroy_socket(zend_resource *rsrc TSRMLS_DC) /* {{{ */
{
php_socket *php_sock = rsrc->ptr;

Expand Down

0 comments on commit a0909f0

Please sign in to comment.