Permalink
Browse files

wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C

for C++ extension support
  • Loading branch information...
Hartmut Holzgraefe
Hartmut Holzgraefe committed Feb 18, 2004
1 parent 7deeb0f commit 3a3f95a3991283eb83b39d8803125b0ca954154a
View
@@ -435,6 +435,7 @@ END_EXTERN_C()
}
#define zend_first_try EG(bailout_set)=0; zend_try
+BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
ZEND_API int zend_print_zval(zval *expr, int indent);
@@ -443,6 +444,7 @@ ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+END_EXTERN_C()
void zend_activate(TSRMLS_D);
void zend_deactivate(TSRMLS_D);
@@ -23,7 +23,10 @@
#define ZEND_BUILTIN_FUNCTIONS_H
int zend_startup_builtin_functions(TSRMLS_D);
+
+BEGIN_EXTERN_C()
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC);
+END_EXTERN_C()
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
View
@@ -89,9 +89,10 @@ struct _zend_extension {
int resource_number;
};
-
+BEGIN_EXTERN_C()
ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API void zend_extension_dispatch_message(int message, void *arg);
+END_EXTERN_C()
#define ZEND_EXTMSG_NEW_EXTENSION 1
@@ -106,13 +107,16 @@ ZEND_API void zend_extension_dispatch_message(int message, void *arg);
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
-ZEND_API int zend_load_extension(char *path);
-ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
void zend_append_version_info(zend_extension *extension);
int zend_startup_extensions_mechanism(void);
int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
+
+BEGIN_EXTERN_C()
+ZEND_API int zend_load_extension(char *path);
+ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
ZEND_API zend_extension *zend_get_extension(char *extension_name);
+END_EXTERN_C()
#endif /* ZEND_EXTENSIONS_H */
View
@@ -22,7 +22,9 @@
#ifndef ZEND_INDENT_H
#define ZEND_INDENT_H
+BEGIN_EXTERN_C()
ZEND_API void zend_indent(void);
+END_EXTERN_C()
#endif /* ZEND_INDENT_H */
View
@@ -24,6 +24,8 @@
#include "zend.h"
#include "zend_API.h"
+BEGIN_EXTERN_C()
+
ZEND_API zend_class_entry *zend_ce_traversable;
ZEND_API zend_class_entry *zend_ce_aggregate;
ZEND_API zend_class_entry *zend_ce_iterator;
@@ -50,6 +52,8 @@ ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend
ZEND_API void zend_register_interfaces(TSRMLS_D);
+END_EXTERN_C()
+
#endif /* ZEND_INTERFACES_H */
/*
@@ -124,6 +124,7 @@ typedef struct _zend_object_handlers {
} zend_object_handlers;
extern ZEND_API zend_object_handlers std_object_handlers;
+BEGIN_EXTERN_C()
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC);
@@ -140,6 +141,7 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name TSRMLS_DC);
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
+END_EXTERN_C()
#endif
View
@@ -24,12 +24,14 @@
#include "zend.h"
+BEGIN_EXTERN_C()
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC);
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC);
ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC);
ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC);
+END_EXTERN_C()
#endif /* ZEND_OBJECTS_H */
View
@@ -54,6 +54,7 @@ typedef struct _zend_objects_store {
} zend_objects_store;
/* Global store handling functions */
+BEGIN_EXTERN_C()
ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size);
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC);
ZEND_API void zend_objects_store_destroy(zend_objects_store *objects);
@@ -73,6 +74,8 @@ ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects
ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);
ZEND_API zend_object_handlers *zend_get_std_object_handlers();
+END_EXTERN_C()
+
#endif /* ZEND_OBJECTS_H */
/*
View
@@ -31,13 +31,15 @@ typedef struct _zend_ptr_stack {
#define PTR_STACK_BLOCK_SIZE 64
+BEGIN_EXTERN_C()
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements);
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
+END_EXTERN_C()
static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr)
{
View
@@ -30,6 +30,7 @@ typedef struct _zend_stack {
#define STACK_BLOCK_SIZE 64
+BEGIN_EXTERN_C()
ZEND_API int zend_stack_init(zend_stack *stack);
ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size);
ZEND_API int zend_stack_top(zend_stack *stack, void **element);
@@ -41,6 +42,7 @@ ZEND_API void **zend_stack_base(zend_stack *stack);
ZEND_API int zend_stack_count(zend_stack *stack);
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
+END_EXTERN_C()
#define ZEND_STACK_APPLY_TOPDOWN 1
#define ZEND_STACK_APPLY_BOTTOMUP 2
View
@@ -47,11 +47,13 @@ typedef struct _zend_file_handle {
zend_bool free_filename;
} zend_file_handle;
+BEGIN_EXTERN_C()
ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC);
int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC);
int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC);
size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC);
+END_EXTERN_C()
#define zend_stream_close(handle) zend_file_handle_dtor((handle))

0 comments on commit 3a3f95a

Please sign in to comment.