- setvbuf(l_file, 0, _IONBF, 0);
+ if (!(new_file = fopen(name, "a")))
+ return;
+ if (l_file != stderr)
+ {
+ setvbuf(new_file, 0, _IONBF, 0);
+ fclose (l_file);
+ }
+ l_file = new_file;
+}
+
+static void (*start_hook_func)(int, const char *, void *) = NULL;
+static void *start_hook_info;
+static void (*end_hook_func)(int, const char *, void *) = NULL;
+static void *end_hook_info;
+
+void log_event_start (void (*func)(int, const char *, void *), void *info)
+{
+ start_hook_func = func;
+ start_hook_info = info;
+}
+
+void log_event_end (void (*func)(int, const char *, void *), void *info)
+{
+ end_hook_func = func;
+ end_hook_info = info;