|
Last change
on this file since 1026 was
1026,
checked in by moo, 10 months ago
|
|
refactor: split extension init to sub module. TODO: compatibility regression
|
-
Property svn:eol-style set to
native
|
|
File size:
606 bytes
|
| Line | |
|---|
| 1 | #include "xc_ini.h" |
|---|
| 2 | |
|---|
| 3 | PHP_INI_MH(xcache_OnUpdateDummy) |
|---|
| 4 | { |
|---|
| 5 | return SUCCESS; |
|---|
| 6 | } |
|---|
| 7 | |
|---|
| 8 | PHP_INI_MH(xcache_OnUpdateULong) |
|---|
| 9 | { |
|---|
| 10 | zend_ulong *p = (zend_ulong *) mh_arg1; |
|---|
| 11 | |
|---|
| 12 | *p = (zend_ulong) atoi(new_value); |
|---|
| 13 | return SUCCESS; |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | PHP_INI_MH(xcache_OnUpdateBool) |
|---|
| 17 | { |
|---|
| 18 | zend_bool *p = (zend_bool *)mh_arg1; |
|---|
| 19 | |
|---|
| 20 | if (strncasecmp("on", new_value, sizeof("on"))) { |
|---|
| 21 | *p = (zend_bool) atoi(new_value); |
|---|
| 22 | } |
|---|
| 23 | else { |
|---|
| 24 | *p = (zend_bool) 1; |
|---|
| 25 | } |
|---|
| 26 | return SUCCESS; |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | PHP_INI_MH(xcache_OnUpdateString) |
|---|
| 30 | { |
|---|
| 31 | char **p = (char**)mh_arg1; |
|---|
| 32 | if (*p) { |
|---|
| 33 | pefree(*p, 1); |
|---|
| 34 | } |
|---|
| 35 | *p = pemalloc(strlen(new_value) + 1, 1); |
|---|
| 36 | strcpy(*p, new_value); |
|---|
| 37 | return SUCCESS; |
|---|
| 38 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.