function pointers and callbacks
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include "include/native.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
Pair echo_pair(Pair value) { return value; }
|
||||
Triple echo_triple(Triple value) { return value; }
|
||||
Floats echo_floats(Floats value) { return value; }
|
||||
Large echo_large(Large value) { return value; }
|
||||
Nested echo_nested(Nested value) { return value; }
|
||||
Arrays echo_arrays(Arrays value) { return value; }
|
||||
Choice echo_choice(Choice value) { return value; }
|
||||
Forward echo_forward(Forward value) { return value; }
|
||||
|
||||
int verify_records(Pair pair, Triple triple, Floats floats, Large large, Nested nested, Arrays arrays, Choice choice) {
|
||||
if (!(pair.left == 10 && pair.right == 2 &&
|
||||
triple.first == 3 && triple.second == 4 && triple.third == 5 &&
|
||||
floats.x == 6.0f && floats.y == 7.0f &&
|
||||
large.values[0] == 8 && large.values[1] == 9 && large.values[2] == 10 &&
|
||||
nested.pair.left == 11 && nested.pair.right == 12 && nested.tail == 13 &&
|
||||
arrays.values[0] == 14 && arrays.values[1] == 15 && arrays.values[2] == 16 &&
|
||||
choice.integer == 17)) {
|
||||
abort();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user