file_event_handlers add before_open function

This commit is contained in:
seker
2021-11-13 17:19:23 +08:00
parent ff9313e6dd
commit 24a551c14e
8 changed files with 29 additions and 17 deletions

View File

@@ -256,11 +256,15 @@ struct source_loc
const char *funcname{nullptr};
};
typedef struct
typedef struct file_event_handlers
{
std::function<void(const filename_t &filename)> before_open;
std::function<void(const filename_t &filename, std::FILE *file_stream)> after_open;
std::function<void(const filename_t &filename, std::FILE *file_stream)> before_close;
std::function<void(const filename_t &filename)> after_close;
file_event_handlers(): before_open(nullptr), after_open(nullptr), before_close(nullptr), after_close(nullptr)
{}
} file_event_handlers_t;
namespace details {