Permalink
Browse files

more EXTERN_C wrapping of ZEND_API prototypes

  • Loading branch information...
1 parent 7674501 commit 1727c6a2bb0dec1635b9da90f88308effb54ebb2 Hartmut Holzgraefe committed Feb 20, 2004
Showing with 19 additions and 9 deletions.
  1. +3 −2 Zend/zend.h
  2. +4 −0 Zend/zend_API.h
  3. +2 −0 Zend/zend_iterators.h
  4. +7 −3 Zend/zend_operators.h
  5. +3 −4 Zend/zend_variables.h
View
@@ -460,8 +460,9 @@ void zend_exec_finished(TSRMLS_D);
ZEND_API extern char *empty_string;
+BEGIN_EXTERN_C()
ZEND_API void free_estring(char **str_p);
-
+END_EXTERN_C()
#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
@@ -513,9 +514,9 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, void *data);
-END_EXTERN_C()
ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents);
+END_EXTERN_C()
/* Messages for applications of Zend */
View
@@ -139,6 +139,7 @@ typedef struct _zend_function_entry {
int zend_next_free_module(void);
+BEGIN_EXTERN_C()
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC);
ZEND_API int zend_get_parameters_ex(int param_count, ...);
@@ -296,6 +297,7 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC);
ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, zend_uint param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC);
+END_EXTERN_C()
typedef struct _zend_fcall_info {
size_t size;
@@ -316,6 +318,7 @@ typedef struct _zend_fcall_info_cache {
zval **object_pp;
} zend_fcall_info_cache;
+BEGIN_EXTERN_C()
ZEND_API extern zend_fcall_info_cache empty_fcall_info_cache;
ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
@@ -328,6 +331,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
ZEND_API ZEND_FUNCTION(display_disabled_function);
ZEND_API ZEND_FUNCTION(display_disabled_class);
+END_EXTERN_C()
#if ZEND_DEBUG
#define CHECK_ZVAL_STRING(z) \
View
@@ -74,13 +74,15 @@ enum zend_object_iterator_kind {
ZEND_ITER_OBJECT
};
+BEGIN_EXTERN_C()
/* given a zval, returns stuff that can be used to iterate it. */
ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC);
/* given an iterator, wrap it up as a zval for use by the engine opcodes */
ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC);
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D);
+END_EXTERN_C()
/*
* Local variables:
View
@@ -37,6 +37,7 @@
#define MAX_LENGTH_OF_LONG 18
#define MAX_LENGTH_OF_DOUBLE 32
+BEGIN_EXTERN_C()
ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -61,6 +62,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR
ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC);
ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC);
+END_EXTERN_C()
static inline zend_bool is_numeric_string(char *str, int length, long *lval, double *dval, zend_bool allow_errors)
{
@@ -169,10 +171,11 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
return NULL;
}
+
+BEGIN_EXTERN_C()
ZEND_API int increment_function(zval *op1);
ZEND_API int decrement_function(zval *op2);
-BEGIN_EXTERN_C()
ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
@@ -190,7 +193,6 @@ ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
ZEND_API double zend_string_to_double(const char *number, zend_uint length);
-END_EXTERN_C()
ZEND_API int zval_is_true(zval *op);
ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
@@ -199,13 +201,15 @@ ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_D
ZEND_API void zend_str_tolower(char *str, unsigned int length);
ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length);
+END_EXTERN_C()
static inline char *
zend_str_tolower_dup(const char *source, unsigned int length)
{
return zend_str_tolower_copy((char *)emalloc(length+1), source, length);
}
+BEGIN_EXTERN_C()
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
@@ -223,7 +227,7 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
ZEND_API int zend_atoi(const char *str, int str_len);
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
-
+END_EXTERN_C()
#define convert_to_ex_master(ppzv, lower_type, upper_type) \
if ((*ppzv)->type!=IS_##upper_type) { \
SEPARATE_ZVAL_IF_NOT_REF(ppzv); \
View
@@ -23,9 +23,9 @@
#define ZEND_VARIABLES_H
-ZEND_API int zend_print_variable(zval *var);
BEGIN_EXTERN_C()
+ZEND_API int zend_print_variable(zval *var);
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
@@ -56,11 +56,10 @@ ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zvalue);
#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor
#endif
-END_EXTERN_C()
-
-
ZEND_API void zval_add_ref(zval **p);
+END_EXTERN_C()
+
#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
#define ZVAL_INTERNAL_DTOR (void (*)(void *)) zval_internal_dtor_wrapper

0 comments on commit 1727c6a

Please sign in to comment.