hholzgra Fri Feb 20 03:04:31 2004 EDT Modified files: /php-src/main php_memory_streams.h php_network.h php_open_temporary_file.h php_output.h php_reentrancy.h php_streams.h php_ticks.h safe_mode.h Log: wrap all PHPAPI prototypes into BEGIN_EXTERN_C/END_EXTERN_C blocks (else they won't be usable from C++ extensions)
http://cvs.php.net/diff.php/php-src/main/php_memory_streams.h?r1=1.10&r2=1.11&ty=u Index: php-src/main/php_memory_streams.h diff -u php-src/main/php_memory_streams.h:1.10 php-src/main/php_memory_streams.h:1.11 --- php-src/main/php_memory_streams.h:1.10 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_memory_streams.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_memory_streams.h,v 1.10 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_memory_streams.h,v 1.11 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_MEMORY_STREAM_H #define PHP_MEMORY_STREAM_H @@ -38,13 +38,14 @@ #define php_stream_temp_create_rel(mode, max_memory_usage) _php_stream_temp_create((mode), (max_memory_usage) STREAMS_REL_CC TSRMLS_CC) #define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC TSRMLS_CC) - +BEGIN_EXTERN_C() PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC TSRMLS_DC); PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC TSRMLS_DC); PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC TSRMLS_DC); PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC TSRMLS_DC); PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC TSRMLS_DC); +END_EXTERN_C() extern php_stream_ops php_stream_memory_ops; extern php_stream_ops php_stream_temp_ops; http://cvs.php.net/diff.php/php-src/main/php_network.h?r1=1.51&r2=1.52&ty=u Index: php-src/main/php_network.h diff -u php-src/main/php_network.h:1.51 php-src/main/php_network.h:1.52 --- php-src/main/php_network.h:1.51 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_network.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_network.h,v 1.51 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_network.h,v 1.52 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef _PHP_NETWORK_H #define _PHP_NETWORK_H @@ -62,7 +62,9 @@ /* like strerror, but caller must efree the returned string, * unless buf is not NULL. * Also works sensibly for win32 */ +BEGIN_EXTERN_C() PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize); +END_EXTERN_C() #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> @@ -120,6 +122,7 @@ } php_sockaddr_storage; #endif +BEGIN_EXTERN_C() PHPAPI php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short port, int socktype, int asynchronous, struct timeval *timeout, char **error_string, int *error_code @@ -163,7 +166,7 @@ PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short port); PHPAPI int php_sockaddr_size(php_sockaddr_storage *addr); - +END_EXTERN_C() struct _php_netstream_data_t { php_socket_t socket; @@ -177,6 +180,7 @@ extern php_stream_ops php_stream_generic_socket_ops; #define PHP_STREAM_IS_SOCKET (&php_stream_socket_ops) +BEGIN_EXTERN_C() PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const char *persistent_id STREAMS_DC TSRMLS_DC ); /* open a connection to a host using php_hostconnect and return a stream */ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short port, @@ -193,6 +197,7 @@ PHPAPI int php_network_parse_network_address_with_port(const char *addr, long addrlen, struct sockaddr *sa, socklen_t *sl TSRMLS_DC); +END_EXTERN_C() #define php_stream_sock_open_from_socket(socket, persistent) _php_stream_sock_open_from_socket((socket), (persistent) STREAMS_CC TSRMLS_CC) #define php_stream_sock_open_host(host, port, socktype, timeout, persistent) _php_stream_sock_open_host((host), (port), (socktype), (timeout), (persistent) STREAMS_CC TSRMLS_CC) http://cvs.php.net/diff.php/php-src/main/php_open_temporary_file.h?r1=1.10&r2=1.11&ty=u Index: php-src/main/php_open_temporary_file.h diff -u php-src/main/php_open_temporary_file.h:1.10 php-src/main/php_open_temporary_file.h:1.11 --- php-src/main/php_open_temporary_file.h:1.10 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_open_temporary_file.h Fri Feb 20 03:04:30 2004 @@ -16,12 +16,14 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_open_temporary_file.h,v 1.10 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_open_temporary_file.h,v 1.11 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_OPEN_TEMPORARY_FILE_H #define PHP_OPEN_TEMPORARY_FILE_H +BEGIN_EXTERN_C() PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); +END_EXTERN_C() #endif /* PHP_OPEN_TEMPORARY_FILE_H */ http://cvs.php.net/diff.php/php-src/main/php_output.h?r1=1.50&r2=1.51&ty=u Index: php-src/main/php_output.h diff -u php-src/main/php_output.h:1.50 php-src/main/php_output.h:1.51 --- php-src/main/php_output.h:1.50 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_output.h Fri Feb 20 03:04:30 2004 @@ -16,13 +16,14 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_output.h,v 1.50 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_output.h,v 1.51 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_OUTPUT_H #define PHP_OUTPUT_H typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); +BEGIN_EXTERN_C() PHPAPI void php_output_startup(void); PHPAPI void php_output_activate(TSRMLS_D); PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC); @@ -44,6 +45,7 @@ PHPAPI int php_ob_init_conflict(char *handler_new, char *handler_set TSRMLS_DC); PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); +END_EXTERN_C() PHP_FUNCTION(ob_start); PHP_FUNCTION(ob_flush); http://cvs.php.net/diff.php/php-src/main/php_reentrancy.h?r1=1.21&r2=1.22&ty=u Index: php-src/main/php_reentrancy.h diff -u php-src/main/php_reentrancy.h:1.21 php-src/main/php_reentrancy.h:1.22 --- php-src/main/php_reentrancy.h:1.21 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_reentrancy.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reentrancy.h,v 1.21 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_reentrancy.h,v 1.22 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_REENTRANCY_H #define PHP_REENTRANCY_H @@ -49,6 +49,8 @@ #undef HAVE_GMTIME_R #endif +BEGIN_EXTERN_C() + #if defined(HAVE_POSIX_READDIR_R) #define php_readdir_r readdir_r #else @@ -114,6 +116,8 @@ #define php_rand_r rand_r #endif +END_EXTERN_C() + #if !defined(ZTS) #undef PHP_NEED_REENTRANCY #endif http://cvs.php.net/diff.php/php-src/main/php_streams.h?r1=1.92&r2=1.93&ty=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.92 php-src/main/php_streams.h:1.93 --- php-src/main/php_streams.h:1.92 Wed Jan 28 17:21:53 2004 +++ php-src/main/php_streams.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_streams.h,v 1.92 2004/01/28 22:21:53 pollita Exp $ */ +/* $Id: php_streams.h,v 1.93 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -27,8 +27,10 @@ #include <sys/types.h> #include <sys/stat.h> +BEGIN_EXTERN_C() PHPAPI int php_file_le_stream(void); PHPAPI int php_file_le_pstream(void); +END_EXTERN_C() /* {{{ Streams memory debugging stuff */ @@ -226,8 +228,10 @@ #define PHP_STREAM_FCLOSE_FOPENCOOKIE 2 /* allocate a new stream for a particular ops */ +BEGIN_EXTERN_C() PHPAPI php_stream *_php_stream_alloc(php_stream_ops *ops, void *abstract, const char *persistent_id, const char *mode STREAMS_DC TSRMLS_DC); +END_EXTERN_C() #define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC) @@ -247,6 +251,7 @@ #define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream()) #define php_stream_from_zval_no_verify(xstr, ppzval) (xstr) = (php_stream*)zend_fetch_resource((ppzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream()) +BEGIN_EXTERN_C() PHPAPI int php_stream_from_persistent_id(const char *persistent_id, php_stream **stream TSRMLS_DC); #define PHP_STREAM_PERSISTENT_SUCCESS 0 /* id exists */ #define PHP_STREAM_PERSISTENT_FAILURE 1 /* id exists but is not a stream! */ @@ -260,6 +265,7 @@ #define PHP_STREAM_FREE_CLOSE (PHP_STREAM_FREE_CALL_DTOR | PHP_STREAM_FREE_RELEASE_STREAM) #define PHP_STREAM_FREE_CLOSE_CASTED (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PRESERVE_HANDLE) #define PHP_STREAM_FREE_CLOSE_PERSISTENT (PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_PERSISTENT) + PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC); #define php_stream_free(stream, close_options) _php_stream_free((stream), (close_options) TSRMLS_CC) #define php_stream_close(stream) _php_stream_free((stream), PHP_STREAM_FREE_CLOSE TSRMLS_CC) @@ -337,6 +343,9 @@ #define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC) +END_EXTERN_C() + + /* Flags for mkdir method in wrapper ops */ #define PHP_STREAM_MKDIR_RECURSIVE 1 /* define REPORT ERRORS 8 (below) */ @@ -384,8 +393,10 @@ #define php_stream_truncate_supported(stream) (_php_stream_set_option((stream), PHP_STREAM_OPTION_TRUNCATE_API, PHP_STREAM_TRUNCATE_SUPPORTED, NULL TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) +BEGIN_EXTERN_C() PHPAPI int _php_stream_truncate_set_size(php_stream *stream, size_t newsize TSRMLS_DC); #define php_stream_truncate_set_size(stream, size) _php_stream_truncate_set_size((stream), (size) TSRMLS_CC) +END_EXTERN_C() #define PHP_STREAM_OPTION_META_DATA_API 11 /* ptrparam is a zval* to which to add meta data information */ #define php_stream_populate_meta_data(stream, zv) (_php_stream_set_option((stream), PHP_STREAM_OPTION_META_DATA_API, 0, zv TSRMLS_CC) == PHP_STREAM_OPTION_RETURN_OK ? 1 : 0) @@ -401,6 +412,7 @@ /* copy up to maxlen bytes from src to dest. If maxlen is PHP_STREAM_COPY_ALL, copy until eof(src). * Uses mmap if the src is a plain file and at offset 0 */ #define PHP_STREAM_COPY_ALL -1 +BEGIN_EXTERN_C() PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size_t maxlen STREAMS_DC TSRMLS_DC); #define php_stream_copy_to_stream(src, dest, maxlen) _php_stream_copy_to_stream((src), (dest), (maxlen) STREAMS_CC TSRMLS_CC) @@ -414,6 +426,7 @@ /* output all data from a stream */ PHPAPI size_t _php_stream_passthru(php_stream * src STREAMS_DC TSRMLS_DC); #define php_stream_passthru(stream) _php_stream_passthru((stream) STREAMS_CC TSRMLS_CC) +END_EXTERN_C() #include "streams/php_stream_transport.h" #include "streams/php_stream_plain_wrapper.h" @@ -435,7 +448,9 @@ #define PHP_STREAM_CAST_RELEASE 0x40000000 /* stream becomes invalid on success */ #define PHP_STREAM_CAST_INTERNAL 0x20000000 /* stream cast for internal use */ #define PHP_STREAM_CAST_MASK (PHP_STREAM_CAST_TRY_HARD | PHP_STREAM_CAST_RELEASE | PHP_STREAM_CAST_INTERNAL) +BEGIN_EXTERN_C() PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC); +END_EXTERN_C() /* use this to check if a stream can be cast into another form */ #define php_stream_can_cast(stream, as) _php_stream_cast((stream), (as), NULL, 0 TSRMLS_CC) #define php_stream_cast(stream, as, ret, show_err) _php_stream_cast((stream), (as), (ret), (show_err) TSRMLS_CC) @@ -491,6 +506,7 @@ int php_shutdown_stream_wrappers(int module_number TSRMLS_DC); PHP_RSHUTDOWN_FUNCTION(streams); +BEGIN_EXTERN_C() PHPAPI int php_register_url_stream_wrapper(char *protocol, php_stream_wrapper *wrapper TSRMLS_DC); PHPAPI int php_unregister_url_stream_wrapper(char *protocol TSRMLS_DC); PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); @@ -524,6 +540,7 @@ /* Give other modules access to the url_stream_wrappers_hash and stream_filters_hash */ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash(); PHPAPI HashTable *php_get_stream_filters_hash(); +END_EXTERN_C() #endif /* http://cvs.php.net/diff.php/php-src/main/php_ticks.h?r1=1.12&r2=1.13&ty=u Index: php-src/main/php_ticks.h diff -u php-src/main/php_ticks.h:1.12 php-src/main/php_ticks.h:1.13 --- php-src/main/php_ticks.h:1.12 Thu Jan 8 12:33:04 2004 +++ php-src/main/php_ticks.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ticks.h,v 1.12 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: php_ticks.h,v 1.13 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef PHP_TICKS_H #define PHP_TICKS_H @@ -24,8 +24,11 @@ int php_startup_ticks(TSRMLS_D); void php_shutdown_ticks(TSRMLS_D); void php_run_ticks(int count); + +BEGIN_EXTERN_C() PHPAPI void php_add_tick_function(void (*func)(int)); PHPAPI void php_remove_tick_function(void (*func)(int)); +END_EXTERN_C() #endif http://cvs.php.net/diff.php/php-src/main/safe_mode.h?r1=1.11&r2=1.12&ty=u Index: php-src/main/safe_mode.h diff -u php-src/main/safe_mode.h:1.11 php-src/main/safe_mode.h:1.12 --- php-src/main/safe_mode.h:1.11 Thu Jan 8 12:33:04 2004 +++ php-src/main/safe_mode.h Fri Feb 20 03:04:30 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: safe_mode.h,v 1.11 2004/01/08 17:33:04 sniper Exp $ */ +/* $Id: safe_mode.h,v 1.12 2004/02/20 08:04:30 hholzgra Exp $ */ #ifndef SAFE_MODE_H #define SAFE_MODE_H @@ -32,8 +32,10 @@ /* flags for php_checkuid_ex() */ #define CHECKUID_NO_ERRORS 0x01 -extern PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode); -extern PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags); -extern PHPAPI char *php_get_current_user(void); +BEGIN_EXTERN_C() +PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode); +PHPAPI int php_checkuid_ex(const char *filename, char *fopen_mode, int mode, int flags); +PHPAPI char *php_get_current_user(void); +END_EXTERN_C() #endif
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php