diff options
author | Zeev Suraski <zeev@php.net> | 1999-04-28 21:14:47 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-04-28 21:14:47 +0000 |
commit | a877f6d3807b7c29da8adea30491381feecfc40f (patch) | |
tree | e3c119a286f4198203ba578c147f75bb987be281 /main/php_ini.h | |
parent | 66476011ddb8a3bee0558df90a201cbbfee1434c (diff) | |
download | php-git-a877f6d3807b7c29da8adea30491381feecfc40f.tar.gz |
Additional generalization of the INI mechanism. Avoid needing specialized
message handlers in 99% of the cases.
Diffstat (limited to 'main/php_ini.h')
-rw-r--r-- | main/php_ini.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/main/php_ini.h b/main/php_ini.h index 12e7b5da7b..f76dd83cbb 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -1,7 +1,6 @@ #ifndef _PHP_INI_H #define _PHP_INI_H - #define PHP_INI_USER (1<<0) #define PHP_INI_PERDIR (1<<1) #define PHP_INI_SYSTEM (1<<2) @@ -44,7 +43,8 @@ long php_ini_long(char *name, uint name_length, int orig); double php_ini_double(char *name, uint name_length, int orig); char *php_ini_string(char *name, uint name_length, int orig); -#define PHP_INI_BEGIN() static php_ini_entry ini_entries[] = { +#define PHP_INI_BEGIN() static php_ini_entry ini_entries[] = { +#define PHP_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, 0, NULL, 0, 0 } }; #define PHP_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \ { 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0 }, @@ -58,8 +58,13 @@ char *php_ini_string(char *name, uint name_length, int orig); #define PHP_INI_ENTRY(name, default_value, modifyable, on_modify) \ PHP_INI_ENTRY3(name, default_value, modifyable, on_modify, NULL, NULL, NULL) -#define PHP_INI_END() \ - { 0, 0, NULL, 0, NULL, NULL, NULL, 0, NULL, 0, 0 } }; +#ifdef ZTS +#define STD_PHP_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ + PHP_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) +#else +#define STD_PHP_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \ + PHP_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) +#endif #define INI_INT(name) php_ini_long((name), sizeof(name), 0) #define INI_FLT(name) php_ini_double((name), sizeof(name), 0) |