summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/InitEventLogging_c.c
blob: 369a4f010fb62f4c2ff0e898394724d34c79ef0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
#include <Rts.h>

void test_init(void) {
  printf("init\n");
  fflush(stdout);
}

bool test_write(void *eventlog, size_t eventlog_size) {
  printf("write\n");
  fflush(stdout);
  return true;
}

void test_flush(void) {
  printf("flush\n");
  fflush(stdout);
}

void test_stop(void) {
  printf("stop\n");
  fflush(stdout);
}

const EventLogWriter writer = {
  .initEventLogWriter = test_init,
  .writeEventLog = test_write,
  .flushEventLog = test_flush,
  .stopEventLogWriter = test_stop
};

void init_eventlog(void) {
  if (!startEventLogging(&writer)) {
    printf("failed to start eventlog\n");
  }
}