32typedef void (*type_writer_func_t)(
void *, accum);
37 type_writer_func_t writer;
40static void write_s1615(
void *address, accum value) {
41 accum *values = (accum *) address;
45static void write_uint32(
void *address, accum value) {
46 uint32_t *values = (uint32_t *) address;
47 values[0] = (uint32_t) value;
50static void write_int32(
void *address, accum value) {
51 int32_t *values = (int32_t *) address;
52 values[0] = (int32_t) value;
55static void write_u032(
void *address, accum value) {
56 unsigned long fract *values = (
unsigned long fract *) address;
57 values[0] = (
unsigned long fract) value;
61 {S1615,
sizeof(accum), write_s1615},
62 {UINT32,
sizeof(uint32_t), write_uint32},
63 {INT32,
sizeof(int32_t), write_int32},
64 {U032,
sizeof(
unsigned long fract), write_u032}
67static type_info *get_type_writer(type t) {
68 if (t >=
sizeof(type_writers) /
sizeof(*type_writers)) {
70 log_error(
"type id=%u is outside sane range", t);
73 return &type_writers[t];
void log_error(const char *message,...)
void rt_error(uint code,...)