- return sym;
-}
-
-#define PSI_DEBUG_PRINT(ctx, ...) do { \
- if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
- dprintf(PSI_DATA(ctx)->debug_fd, __VA_ARGS__); \
- } \
-} while(0)
-#define PSI_DEBUG_PRINTV(ctx, msg, argv) do { \
- if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
- vdprintf(PSI_DATA(ctx)->debug_fd, msg, argv); \
- } \
-} while(0)
-#define PSI_DEBUG_DUMP(ctx, dump_func, ...) do { \
- if ((ctx) && (PSI_DATA(ctx)->flags & PSI_DEBUG)) { \
- struct psi_dump dump_ = {{ .fd = PSI_DATA(ctx)->debug_fd}, \
- .fun = (psi_dump_cb) dprintf}; \
- dump_func(&dump_, __VA_ARGS__); \
- } \
-} while (0)
-
-union psi_dump_arg {
- void *hn;
- int fd;
-};
-typedef void (*psi_dump_cb)(union psi_dump_arg, const char *msg, ...);
-struct psi_dump {
- union psi_dump_arg ctx;
- psi_dump_cb fun;
-};
-#define PSI_DUMP(dump, ...) (dump)->fun((dump)->ctx, __VA_ARGS__)