diff options
Diffstat (limited to 'includes/rts/EventLogWriter.h')
-rw-r--r-- | includes/rts/EventLogWriter.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/includes/rts/EventLogWriter.h b/includes/rts/EventLogWriter.h new file mode 100644 index 0000000000..f9cb25fe62 --- /dev/null +++ b/includes/rts/EventLogWriter.h @@ -0,0 +1,40 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 2008-2017 + * + * Support for fast binary event logging. + * + * ---------------------------------------------------------------------------*/ + +#ifndef EVENTLOG_WRITER_H +#define EVENTLOG_WRITER_H + +#include <stddef.h> +#include <stdbool.h> + +#include "Rts.h" + +/* + * Abstraction for writing eventlog data. + */ +typedef struct { + // Initialize an EventLogWriter (may be NULL) + void (* initEventLogWriter) (void); + + // Write a series of events + bool (* writeEventLog) (void *eventlog, size_t eventlog_size); + + // Flush possibly existing buffers (may be NULL) + void (* flushEventLog) (void); + + // Close an initialized EventLogOutput (may be NULL) + void (* stopEventLogWriter) (void); +} EventLogWriter; + +/* + * An EventLogWriter which writes eventlogs to + * a file `program.eventlog`. + */ +extern const EventLogWriter FileEventLogWriter; + +#endif /* EVENTLOG_WRITER_H */ |