cpp: Use #pragma once instead of #ifndef guards
[ghc.git] / includes / rts / EventLogWriter.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2008-2017
4 *
5 * Support for fast binary event logging.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #include <stddef.h>
12 #include <stdbool.h>
13
14 #include "Rts.h"
15
16 /*
17 * Abstraction for writing eventlog data.
18 */
19 typedef struct {
20 // Initialize an EventLogWriter (may be NULL)
21 void (* initEventLogWriter) (void);
22
23 // Write a series of events
24 bool (* writeEventLog) (void *eventlog, size_t eventlog_size);
25
26 // Flush possibly existing buffers (may be NULL)
27 void (* flushEventLog) (void);
28
29 // Close an initialized EventLogOutput (may be NULL)
30 void (* stopEventLogWriter) (void);
31 } EventLogWriter;
32
33 /*
34 * An EventLogWriter which writes eventlogs to
35 * a file `program.eventlog`.
36 */
37 extern const EventLogWriter FileEventLogWriter;