+//#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
+
+static void OnUpdateBlacklist(const char *str, void (*cb)(const char*, size_t))
+{
+ const char *end;
+
+ do {
+ size_t len;
+
+ end = strchr(str, ',');
+ if (end) {
+ len = end - str;
+ } else {
+ len = strlen(str);
+ }
+ if (len) {
+ cb(str, len);
+ }
+
+ str = end + 1;
+ } while (end);
+}
+
+static void psi_blacklist_add_decl(const char *pattern, size_t len);
+static ZEND_INI_MH(OnUpdateBlacklistedDecls)
+{
+ OnUpdateBlacklist(new_value->val, psi_blacklist_add_decl);
+ return SUCCESS;
+}
+
+static void psi_blacklist_add_var(const char *pattern, size_t len);
+static ZEND_INI_MH(OnUpdateBlacklistedVars)
+{
+ OnUpdateBlacklist(new_value->val, psi_blacklist_add_var);
+ return SUCCESS;
+}
+
+static void OnDisplayBlacklist(struct psi_plist *bl)
+{
+ size_t i = 0;
+ char *item;
+
+ while (psi_plist_get(bl, i++, &item)) {
+ if (i > 1) {
+ PUTS(",");
+ }
+ PUTS(item);
+ }
+}
+static ZEND_INI_DISP(OnDisplayBlacklistedDecls)
+{
+ OnDisplayBlacklist(PSI_G(blacklist).decls);
+}
+static ZEND_INI_DISP(OnDisplayBlacklistedVars)
+{
+ OnDisplayBlacklist(PSI_G(blacklist).vars);
+}
+