-#define psi_predef_count(of) ((sizeof(psi_predef ##of## s)/sizeof(psi_predef ##of))-1)
-typedef struct psi_predef_type {
- token_t type_tag;
- const char *type_name;
- const char *alias;
-} psi_predef_type;
-static const psi_predef_type psi_predef_types[] = {
- PHP_PSI_TYPES{0}
-};
-#define psi_predef_type_count() psi_predef_count(_type)
-
-typedef struct psi_predef_const {
- token_t type_tag;
- const char *type_name;
- const char *name;
- const char *val_text;
- token_t val_type_tag;
-} psi_predef_const;
-static const psi_predef_const psi_predef_consts[] = {
- PHP_PSI_CONSTS{0}
-};
-#define psi_predef_const_count() psi_predef_count(_const)
-
-typedef struct psi_predef_struct_member {
- token_t type_tag;
- const char *type_name;
- const char *name;
- size_t off;
- size_t len;
- size_t pointer_level;
- size_t array_size;
-} psi_predef_struct_member;
-#define PSI_PREDEF_STRUCT_MEMBERS 32
-typedef struct psi_predef_struct {
- const char *name;
- size_t size;
- psi_predef_struct_member members[PSI_PREDEF_STRUCT_MEMBERS];
-} psi_predef_struct;
-static const psi_predef_struct psi_predef_structs[] = {
- PHP_PSI_STRUCTS{0}
-};
-#define psi_predef_struct_count() psi_predef_count(_struct)
-
-typedef struct psi_predef_func {
- const char *name;
- void (*func)(void);
-} psi_predef_func;
-static psi_predef_func psi_predef_funcs[] = {
- PHP_PSI_FUNCS{0}
-};
-#define psi_predef_func_count() psi_predef_count(_func)
-
-static int validate_lib(PSI_Data *data, void **dlopened) {
- char lib[MAXPATHLEN];
- const char *ptr = data->psi.file.ln;
- size_t len;
-
- if (!ptr) {
- /* FIXME: assume stdlib */
- return 1;
- } else if (!strchr(ptr, '/')) {
-#ifdef DARWIN
- len = snprintf(lib, MAXPATHLEN, "lib%s.dylib", ptr);