54 lines
917 B
C
54 lines
917 B
C
#ifndef BROLANG_RECORDS_H
|
|
#define BROLANG_RECORDS_H
|
|
|
|
typedef struct Pair {
|
|
int left;
|
|
int right;
|
|
} Pair;
|
|
|
|
typedef struct Triple {
|
|
int first;
|
|
int second;
|
|
int third;
|
|
} Triple;
|
|
|
|
typedef struct Floats {
|
|
float x;
|
|
float y;
|
|
} Floats;
|
|
|
|
typedef struct Large {
|
|
long values[3];
|
|
} Large;
|
|
|
|
typedef struct Nested {
|
|
Pair pair;
|
|
int tail;
|
|
} Nested;
|
|
|
|
typedef struct Arrays {
|
|
int values[3];
|
|
} Arrays;
|
|
|
|
typedef union Choice {
|
|
long integer;
|
|
double decimal;
|
|
} Choice;
|
|
|
|
typedef struct Forward Forward;
|
|
struct Forward {
|
|
int value;
|
|
};
|
|
|
|
Pair echo_pair(Pair value);
|
|
Triple echo_triple(Triple value);
|
|
Floats echo_floats(Floats value);
|
|
Large echo_large(Large value);
|
|
Nested echo_nested(Nested value);
|
|
Arrays echo_arrays(Arrays value);
|
|
Choice echo_choice(Choice value);
|
|
Forward echo_forward(Forward value);
|
|
int verify_records(Pair pair, Triple triple, Floats floats, Large large, Nested nested, Arrays arrays, Choice choice);
|
|
|
|
#endif
|