X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fdata.h;h=964b46816a2b94d12bc4bb4a2159ef0d1bc38738;hp=3c48716cd21820af4b1d4e30f657e8a3479c04e9;hb=02e801eabbe26a129ea05e6723c94e10bb653dab;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84 diff --git a/src/data.h b/src/data.h index 3c48716..964b468 100644 --- a/src/data.h +++ b/src/data.h @@ -29,6 +29,7 @@ #include "types.h" #include "error.h" #include "plist.h" +#include "validate.h" #define PSI_DEBUG 0x1 #define PSI_SILENT 0x2 @@ -36,7 +37,7 @@ #include #define PSI_DEBUG_PRINT(ctx, msg, ...) do { \ - if (PSI_DATA(ctx)->flags & PSI_DEBUG) { \ + if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \ fprintf(stderr, msg, __VA_ARGS__); \ } \ } while(0) @@ -52,8 +53,8 @@ struct psi_plist *unions; \ struct psi_plist *enums; \ struct psi_plist *decls; \ + struct psi_plist *vars; \ struct psi_plist *impls; \ - struct psi_plist *libs; \ psi_error_cb error; \ char last_error[0x1000]; \ unsigned errors; \ @@ -66,7 +67,6 @@ struct psi_data { struct psi_data *psi_data_ctor(struct psi_data *data, psi_error_cb error, unsigned flags); struct psi_data *psi_data_ctor_with_dtors(struct psi_data *data, psi_error_cb error, unsigned flags); struct psi_data *psi_data_exchange(struct psi_data *dest, struct psi_data *src); -bool psi_data_validate(struct psi_data *dst, struct psi_data *src); void psi_data_dtor(struct psi_data *data); void psi_data_dump(int fd, struct psi_data *data);