linkage for C++

This commit is contained in:
Wez Furlong 2003-08-18 23:19:27 +00:00
parent 391c027da6
commit ef498a27b8
6 changed files with 33 additions and 6 deletions

View file

@ -82,7 +82,7 @@ struct _zend_ini_entry {
void (*displayer)(zend_ini_entry *ini_entry, int type);
};
BEGIN_EXTERN_C();
ZEND_API int zend_ini_startup(TSRMLS_D);
ZEND_API int zend_ini_shutdown(TSRMLS_D);
ZEND_API int zend_ini_global_shutdown(TSRMLS_D);
@ -108,6 +108,7 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
ZEND_API ZEND_INI_DISP(display_link_numbers);
END_EXTERN_C();
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
@ -171,12 +172,13 @@ ZEND_API ZEND_INI_DISP(display_link_numbers);
#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
/* Standard message handlers */
BEGIN_EXTERN_C();
ZEND_API ZEND_INI_MH(OnUpdateBool);
ZEND_API ZEND_INI_MH(OnUpdateLong);
ZEND_API ZEND_INI_MH(OnUpdateReal);
ZEND_API ZEND_INI_MH(OnUpdateString);
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
END_EXTERN_C();
#define ZEND_INI_DISPLAY_ORIG 1
#define ZEND_INI_DISPLAY_ACTIVE 2
@ -189,7 +191,10 @@ ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
/* INI parsing engine */
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
BEGIN_EXTERN_C();
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
END_EXTERN_C();
#define ZEND_INI_PARSER_ENTRY 1
#define ZEND_INI_PARSER_SECTION 2
#define ZEND_INI_PARSER_POP_ENTRY 3

View file

@ -61,8 +61,9 @@ typedef struct {
typedef struct _sapi_post_entry sapi_post_entry;
typedef struct _sapi_module_struct sapi_module_struct;
BEGIN_EXTERN_C();
extern SAPI_API sapi_module_struct sapi_module; /* true global */
END_EXTERN_C();
/* Some values in this structure needs to be filled in before
* calling sapi_activate(). We WILL change the `char *' entries,
@ -124,6 +125,7 @@ typedef struct _sapi_globals_struct {
} sapi_globals_struct;
BEGIN_EXTERN_C();
#ifdef ZTS
# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
SAPI_API extern int sapi_globals_id;
@ -137,6 +139,7 @@ SAPI_API void sapi_shutdown(void);
SAPI_API void sapi_activate(TSRMLS_D);
SAPI_API void sapi_deactivate(TSRMLS_D);
SAPI_API void sapi_initialize_empty_request(TSRMLS_D);
END_EXTERN_C();
/*
* This is the preferred and maintained API for
@ -161,9 +164,9 @@ typedef enum { /* Parameter: */
SAPI_HEADER_SET_STATUS /* int */
} sapi_header_op_enum;
BEGIN_EXTERN_C();
SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC);
/* Deprecated functions. Use sapi_header_op instead. */
SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC);
#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1 TSRMLS_CC)
@ -194,6 +197,7 @@ SAPI_API int sapi_force_http_10(TSRMLS_D);
SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC);
SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC);
END_EXTERN_C();
struct _sapi_module_struct {
char *name;
@ -274,10 +278,12 @@ struct _sapi_post_entry {
#define SAPI_TREAT_DATA_FUNC(treat_data) void treat_data(int arg, char *str, zval* destArray TSRMLS_DC)
#define SAPI_INPUT_FILTER_FUNC(input_filter) unsigned int input_filter(int arg, char *var, char **val, unsigned int val_len TSRMLS_DC)
BEGIN_EXTERN_C();
SAPI_API SAPI_POST_READER_FUNC(sapi_read_standard_form_data);
SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader);
SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data);
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
END_EXTERN_C();
#define STANDARD_SAPI_MODULE_PROPERTIES

View file

@ -122,19 +122,25 @@
}
#ifndef HAVE_STRLCPY
BEGIN_EXTERN_C();
PHPAPI size_t php_strlcpy(char *dst, const char *src, size_t siz);
END_EXTERN_C();
#undef strlcpy
#define strlcpy php_strlcpy
#endif
#ifndef HAVE_STRLCAT
BEGIN_EXTERN_C();
PHPAPI size_t php_strlcat(char *dst, const char *src, size_t siz);
END_EXTERN_C();
#undef strlcat
#define strlcat php_strlcat
#endif
#ifndef HAVE_STRTOK_R
BEGIN_EXTERN_C();
char *strtok_r(char *s, const char *delim, char **last);
END_EXTERN_C();
#endif
#ifndef HAVE_SOCKLEN_T
@ -266,12 +272,14 @@ ssize_t pwrite(int, void *, size_t, off64_t);
ssize_t pread(int, void *, size_t, off64_t);
#endif
BEGIN_EXTERN_C();
void phperror(char *error);
PHPAPI int php_write(void *buf, uint size TSRMLS_DC);
PHPAPI int php_printf(const char *format, ...);
PHPAPI void php_log_err(char *log_message TSRMLS_DC);
int Debug(char *format, ...);
int cfgparse(void);
END_EXTERN_C();
#define php_error zend_error
@ -281,6 +289,7 @@ typedef enum {
EH_THROW
} error_handling_t;
BEGIN_EXTERN_C();
PHPAPI void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC);
PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) ;
@ -289,6 +298,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...);
PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...);
PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...);
END_EXTERN_C();
#define php_error_docref php_error_docref0
@ -302,6 +312,7 @@ PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1,
#define php_memnstr zend_memnstr
/* functions */
BEGIN_EXTERN_C();
int php_startup_internal_extensions(void);
int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
@ -311,7 +322,7 @@ PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userda
PHPAPI int cfg_get_long(char *varname, long *result);
PHPAPI int cfg_get_double(char *varname, double *result);
PHPAPI int cfg_get_string(char *varname, char **result);
END_EXTERN_C();
/* PHP-named Zend macro wrappers */
#define PHP_FN ZEND_FN

View file

@ -23,10 +23,12 @@
#include "zend_ini.h"
BEGIN_EXTERN_C();
int php_init_config();
int php_shutdown_config(void);
void php_ini_delayed_modules_startup(TSRMLS_D);
zval *cfg_get_entry(char *name, uint name_length);
END_EXTERN_C();
#define PHP_INI_USER ZEND_INI_USER
#define PHP_INI_PERDIR ZEND_INI_PERDIR

View file

@ -26,6 +26,7 @@
#include "php_globals.h"
#include "SAPI.h"
BEGIN_EXTERN_C();
PHPAPI int php_request_startup(TSRMLS_D);
PHPAPI void php_request_shutdown(void *dummy);
PHPAPI void php_request_shutdown_for_exec(void *dummy);
@ -52,5 +53,6 @@ extern void php_call_shutdown_functions(void);
/* environment module */
extern int php_init_environ(void);
extern int php_shutdown_environ(void);
END_EXTERN_C();
#endif

View file

@ -30,6 +30,7 @@
#define PARSE_COOKIE 2
#define PARSE_STRING 3
BEGIN_EXTERN_C();
void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC);
void php_startup_auto_globals(TSRMLS_D);
extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC);
@ -39,7 +40,7 @@ PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, pval *
PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_array TSRMLS_DC);
int php_hash_environment(TSRMLS_D);
END_EXTERN_C();
#define NUM_TRACK_VARS 6