example.h 1.4 KB
Newer Older
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* LabComm declarations:
sample struct {
  int sequence;
  struct {
    boolean last;
    string data;
  } line[_];
} log_message;
sample float data;
*/


#ifndef __LABCOMM_example_H__
#define __LABCOMM_example_H__

#include "labcomm.h"

#ifndef PREDEFINED_example_log_message
typedef struct {
  int sequence;
  struct {
    int n_0;
    struct {
      unsigned char last;
      char* data;
    } *a;
  } line;
} example_log_message;
#endif
void labcomm_decoder_register_example_log_message(
  struct labcomm_decoder *d,
  void (*handler)(
    example_log_message *v,
    void *context
  ),
  void *context
);
void labcomm_encoder_register_example_log_message(
  struct labcomm_encoder *e);
void labcomm_encode_example_log_message(
  struct labcomm_encoder *e,
  example_log_message *v
);
extern int labcomm_sizeof_example_log_message(example_log_message *v);

#ifndef PREDEFINED_example_data
typedef float example_data;
#endif
void labcomm_decoder_register_example_data(
  struct labcomm_decoder *d,
  void (*handler)(
    example_data *v,
    void *context
  ),
  void *context
);
void labcomm_encoder_register_example_data(
  struct labcomm_encoder *e);
void labcomm_encode_example_data(
  struct labcomm_encoder *e,
  example_data *v
);
extern int labcomm_sizeof_example_data(example_data *v);

#define LABCOMM_FORALL_SAMPLES_example(func, sep) \
  func(log_message, example_log_message) sep \
  func(data, example_data)
#endif