]> granicus.if.org Git - php/commitdiff
EXTERN_C wrapping for PHPAPI prototypes
authorHartmut Holzgraefe <hholzgra@php.net>
Fri, 20 Feb 2004 08:22:12 +0000 (08:22 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Fri, 20 Feb 2004 08:22:12 +0000 (08:22 +0000)
(Zend and main should now be ok)

main/streams/php_stream_context.h
main/streams/php_stream_filter_api.h
main/streams/php_stream_mmap.h
main/streams/php_stream_plain_wrapper.h
main/streams/php_stream_transport.h

index eb8b404cfb60a2ec98c91600d6dadfa0daffc76f..3b1eb099434e60f9ea878755a7a81b024dad86ac 100644 (file)
@@ -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, \
index b5b129e968f06b23c286a79e760424646cfd4f6c..dcab09efd6c578452f321a4538f538ea504e9ac9 100644 (file)
@@ -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:
index 024eb7c6d2852cb486014a79f9f371d479e0a2cc..65f294dea948a67143be1d61bd027cb99fb58b9d 100644 (file)
@@ -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:
index 9a23527532929fb8f57667c59628a9d451c9d310..94fc87de3df790f9514c6432e1d40c5d695470c5 100644 (file)
@@ -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
index d1fbb273f1fbc4fe9857254773d676f3ac37c0eb..f63c1e8f6a8480f9d9ba82dee30c86f66611fb95 100644 (file)
@@ -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: