From: Hartmut Holzgraefe Date: Fri, 20 Feb 2004 08:22:12 +0000 (+0000) Subject: EXTERN_C wrapping for PHPAPI prototypes X-Git-Tag: RELEASE_0_2_0~253 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c32fa79d71942415b338763a6695bece1a8489e;p=php EXTERN_C wrapping for PHPAPI prototypes (Zend and main should now be ok) --- diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index eb8b404cfb..3b1eb09943 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -57,6 +57,7 @@ struct _php_stream_context { int rsrc_id; /* used for auto-cleanup */ }; +BEGIN_EXTERN_C() PHPAPI void php_stream_context_free(php_stream_context *context); PHPAPI php_stream_context *php_stream_context_alloc(void); PHPAPI int php_stream_context_get_option(php_stream_context *context, @@ -73,6 +74,7 @@ PHPAPI int php_stream_context_del_link(php_stream_context *context, PHPAPI php_stream_notifier *php_stream_notification_alloc(void); PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); +END_EXTERN_C() /* not all notification codes are implemented */ #define PHP_STREAM_NOTIFY_RESOLVE 1 @@ -90,9 +92,11 @@ PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); #define PHP_STREAM_NOTIFY_SEVERITY_WARN 1 #define PHP_STREAM_NOTIFY_SEVERITY_ERR 2 +BEGIN_EXTERN_C() PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity, char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC); PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context); +END_EXTERN_C() #define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \ php_stream_notification_notify((context), (code), PHP_STREAM_NOTIFY_SEVERITY_INFO, \ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index b5b129e968..dcab09efd6 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -66,6 +66,7 @@ typedef enum { } php_stream_filter_status_t; /* Buckets API. */ +BEGIN_EXTERN_C() PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int own_buf, int buf_persistent TSRMLS_DC); PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left, php_stream_bucket **right, size_t length TSRMLS_DC); PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket TSRMLS_DC); @@ -74,6 +75,7 @@ PHPAPI void php_stream_bucket_prepend(php_stream_bucket_brigade *brigade, php_st PHPAPI void php_stream_bucket_append(php_stream_bucket_brigade *brigade, php_stream_bucket *bucket TSRMLS_DC); PHPAPI void php_stream_bucket_unlink(php_stream_bucket *bucket TSRMLS_DC); PHPAPI php_stream_bucket *php_stream_bucket_make_writeable(php_stream_bucket *bucket TSRMLS_DC); +END_EXTERN_C() #define PSFS_FLAG_NORMAL 0 /* regular read/write */ #define PSFS_FLAG_FLUSH_INC 1 /* an incremental flush */ @@ -115,11 +117,13 @@ struct _php_stream_filter { }; /* stack filter onto a stream */ +BEGIN_EXTERN_C() PHPAPI void php_stream_filter_prepend(php_stream_filter_chain *chain, php_stream_filter *filter); PHPAPI void php_stream_filter_append(php_stream_filter_chain *chain, php_stream_filter *filter); PHPAPI php_stream_filter *php_stream_filter_remove(php_stream_filter *filter, int call_dtor TSRMLS_DC); PHPAPI void php_stream_filter_free(php_stream_filter *filter TSRMLS_DC); PHPAPI php_stream_filter *_php_stream_filter_alloc(php_stream_filter_ops *fops, void *abstract, int persistent STREAMS_DC TSRMLS_DC); +END_EXTERN_C() #define php_stream_filter_alloc(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_CC TSRMLS_CC) #define php_stream_filter_alloc_rel(fops, thisptr, persistent) _php_stream_filter_alloc((fops), (thisptr), (persistent) STREAMS_REL_CC TSRMLS_CC) @@ -129,9 +133,11 @@ typedef struct _php_stream_filter_factory { php_stream_filter *(*create_filter)(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); } php_stream_filter_factory; +BEGIN_EXTERN_C() PHPAPI int php_stream_filter_register_factory(const char *filterpattern, php_stream_filter_factory *factory TSRMLS_DC); PHPAPI int php_stream_filter_unregister_factory(const char *filterpattern TSRMLS_DC); PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC); +END_EXTERN_C() /* * Local variables: diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index 024eb7c6d2..65f294dea9 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -64,13 +64,14 @@ typedef struct { * 0 otherwise */ #define php_stream_mmap_possible(stream) (!php_stream_is_filtered((stream)) && php_stream_mmap_supported((stream))) +BEGIN_EXTERN_C() PHPAPI char *_php_stream_mmap_range(php_stream *stream, size_t offset, size_t length, php_stream_mmap_operation_t mode, size_t *mapped_len TSRMLS_DC); #define php_stream_mmap_range(stream, offset, length, mode, mapped_len) _php_stream_mmap_range((stream), (offset), (length), (mode), (mapped_len) TSRMLS_CC) /* un-maps the last mapped range */ PHPAPI int _php_stream_mmap_unmap(php_stream *stream TSRMLS_DC); #define php_stream_mmap_unmap(stream) _php_stream_mmap_unmap((stream) TSRMLS_CC) - +END_EXTERN_C() /* * Local variables: diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 9a23527532..94fc87de3d 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -23,6 +23,8 @@ /* operations for a plain file; use the php_stream_fopen_XXX funcs below */ PHPAPI extern php_stream_ops php_stream_stdio_ops; +BEGIN_EXTERN_C() + /* like fopen, but returns a stream */ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, char **opened_path, int options STREAMS_DC TSRMLS_DC); #define php_stream_fopen(filename, mode, opened) _php_stream_fopen((filename), (mode), (opened), 0 STREAMS_CC TSRMLS_CC) @@ -51,6 +53,8 @@ PHPAPI php_stream *_php_stream_fopen_temporary_file(const char *dir, const char PHPAPI FILE * _php_stream_open_wrapper_as_file(char * path, char * mode, int options, char **opened_path STREAMS_DC TSRMLS_DC); #define php_stream_open_wrapper_as_file(path, mode, options, opened_path) _php_stream_open_wrapper_as_file((path), (mode), (options), (opened_path) STREAMS_CC TSRMLS_CC) +END_EXTERN_C() + /* * Local variables: * tab-width: 4 diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index d1fbb273f1..f63c1e8f6a 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -29,6 +29,7 @@ typedef php_stream *(php_stream_transport_factory_func)(const char *proto, long php_stream_context *context STREAMS_DC TSRMLS_DC); typedef php_stream_transport_factory_func *php_stream_transport_factory; +BEGIN_EXTERN_C() PHPAPI int php_stream_xport_register(char *protocol, php_stream_transport_factory factory TSRMLS_DC); PHPAPI int php_stream_xport_unregister(char *protocol TSRMLS_DC); @@ -103,6 +104,7 @@ PHPAPI int php_stream_xport_recvfrom(php_stream *stream, char *buf, size_t bufle * sending it as OOB data */ PHPAPI int php_stream_xport_sendto(php_stream *stream, const char *buf, size_t buflen, long flags, void *addr, socklen_t addrlen TSRMLS_DC); +END_EXTERN_C() /* Structure definition for the set_option interface that the above functions wrap */ @@ -157,8 +159,10 @@ typedef enum { STREAM_CRYPTO_METHOD_TLS_SERVER } php_stream_xport_crypt_method_t; +BEGIN_EXTERN_C() PHPAPI int php_stream_xport_crypto_setup(php_stream *stream, php_stream_xport_crypt_method_t crypto_method, php_stream *session_stream TSRMLS_DC); PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRMLS_DC); +END_EXTERN_C() typedef struct _php_stream_xport_crypto_param { enum { @@ -175,8 +179,10 @@ typedef struct _php_stream_xport_crypto_param { } outputs; } php_stream_xport_crypto_param; +BEGIN_EXTERN_C() PHPAPI HashTable *php_stream_xport_get_hash(void); PHPAPI php_stream_transport_factory_func php_stream_generic_socket_factory; +END_EXTERN_C() /* * Local variables: