X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcontext.h;h=24bdb9c5a8083d450c3dc5445ae812acfee84f6b;hp=d75c19ed829106580848241504575919f7f79402;hb=eea1703836c35020dd45e465f5cb1450eadfaa1c;hpb=4a49fe2f8eb21cdeabb06acec7a0395b6708d911 diff --git a/src/context.h b/src/context.h index d75c19e..24bdb9c 100644 --- a/src/context.h +++ b/src/context.h @@ -1,24 +1,29 @@ #ifndef _PSI_CONTEXT_H #define _PSI_CONTEXT_H +#include "parser.h" + #define PSI_ERROR 16 #define PSI_WARNING 32 typedef void (*PSI_ContextErrorFunc)(int type, const char *msg, ...); -typedef struct PSI_ContextOps { - void (*init)(struct PSI_Context *C); - void (*dtor)(struct PSI_Context *C); - zend_function_entry *(*compile)(struct PSI_Context *C, struct PSI_Data *D); -} PSI_ContextOps; +typedef struct PSI_Context PSI_Context; +typedef struct PSI_ContextOps PSI_ContextOps; + +struct PSI_ContextOps { + void (*init)(PSI_Context *C); + void (*dtor)(PSI_Context *C); + zend_function_entry *(*compile)(PSI_Context *C, PSI_Data *D); +}; -typedef struct PSI_Context { - void *opaque; +struct PSI_Context { + void *context; PSI_ContextErrorFunc error; struct PSI_ContextOps *ops; struct PSI_Data *data; zend_function_entry **closures; size_t count; -} PSI_Context; +}; PSI_Context *PSI_ContextInit(PSI_Context *C, PSI_ContextOps *ops, PSI_ContextErrorFunc error); void PSI_ContextBuild(PSI_Context *C, const char *path);