just predefine stdc inttypes
[m6w6/ext-psi] / src / types / decl.c
index 51dd733350b49073fbf4befc921426e1718c5633..2d974808b7bd8ee3d7cf735632ba22ad8f878876 100644 (file)
 
 #include "php_psi_stdinc.h"
 
+#include "php_psi.h"
+
 #include <dlfcn.h>
+#include <fnmatch.h>
+
 #include "data.h"
 
 #define PSI_FUNC_REDIRS
@@ -86,12 +90,7 @@ static inline bool psi_decl_validate_func(struct psi_data *data,
        struct psi_func_redir *redir;
 
        if (!func->var->name) {
-               data->error(data, func->token, PSI_WARNING, "Anonymous decl!");
-               return false;
-       }
-       if (!strcmp(func->var->name, "dlsym")) {
-               data->error(data, func->token, PSI_WARNING,
-                               "Cannot dlsym dlsym (sic!)");
+               data->error(data, func->token, PSI_WARNING, "Cannot load anonymous decl");
                return false;
        }
 
@@ -162,3 +161,17 @@ bool psi_decl_validate_nodl(struct psi_data *data, struct psi_decl *decl,
 
        return true;
 }
+
+bool psi_decl_is_blacklisted(const char *name)
+{
+       char *blacklisted;
+       size_t i = 0;
+
+       while (psi_plist_get(PSI_G(blacklist).decls, i++, &blacklisted)) {
+               if (!fnmatch(blacklisted, name, 0)) {
+                       return true;
+               }
+       }
+       return false;
+}
+