result_output.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 HAW Hamburg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <stdint.h>
54 #include <stdbool.h>
55 #include <stddef.h>
56 
57 #include "result_output_types.h"
58 
70 typedef struct turo turo_t;
71 
77 void turo_init(turo_t *ctx);
78 
87 
96 void turo_s32(turo_t *ctx, int32_t val);
97 
106 void turo_u32(turo_t *ctx, uint32_t val);
107 
116 void turo_s64(turo_t *ctx, int64_t val);
117 
126 void turo_u64(turo_t *ctx, uint64_t val);
127 
136 void turo_float(turo_t *ctx, float val);
137 
146 void turo_string(turo_t *ctx, const char *str);
147 
156 void turo_bool(turo_t *ctx, bool val);
157 
168 
179 void turo_dict_key(turo_t *ctx, const char *key);
180 
190 
201 
211 
220 void turo_container_close(turo_t *ctx, int exit_status);
237 void turo_array_u8(turo_t *ctx, uint8_t *vals, size_t size);
238 
248 void turo_array_s32(turo_t *ctx, int32_t *vals, size_t size);
249 
259 void turo_dict_string(turo_t *ctx, const char *key, const char *val);
260 
270 void turo_dict_s32(turo_t *ctx, const char *key, int32_t val);
271 
282 void turo_simple_s32(turo_t *ctx, int32_t val);
283 
295 void turo_simple_array_u8(turo_t *ctx, uint8_t *vals, size_t size);
296 
308 void turo_simple_array_s32(turo_t *ctx, int32_t *vals, size_t size);
309 
321 void turo_simple_dict_string(turo_t *ctx, const char *key, const char *val);
322 
334 void turo_simple_dict_s32(turo_t *ctx, const char *key, int32_t val);
335 
346 void turo_simple_exit_status(turo_t *ctx, int exit_status);
349 #ifdef __cplusplus
350 }
351 #endif
void turo_string(turo_t *ctx, const char *str)
Outputs a formatted string string.
void turo_array_close(turo_t *ctx)
Outputs a formatted close of an array result.
void turo_float(turo_t *ctx, float val)
Outputs a formatted float result of varied precision.
void turo_bool(turo_t *ctx, bool val)
Outputs a formatted boolean result.
void turo_s64(turo_t *ctx, int64_t val)
Outputs a signed 64 bit integer.
void turo_array_open(turo_t *ctx)
Outputs a formatted open of an array result.
void turo_container_open(turo_t *ctx)
Outputs a container open.
void turo_container_close(turo_t *ctx, int exit_status)
Outputs a formatted close of a container result.
void turo_s32(turo_t *ctx, int32_t val)
Outputs a signed 32 bit integer.
void turo_dict_key(turo_t *ctx, const char *key)
Outputs a formatted open of a dictionary result.
void turo_dict_open(turo_t *ctx)
Outputs a formatted open of a dictionary result.
void turo_init(turo_t *ctx)
Provides initial values for the turo context.
void turo_u32(turo_t *ctx, uint32_t val)
Outputs an unsigned 32 bit integer.
void turo_dict_close(turo_t *ctx)
Outputs a formatted close of a dictionary result.
void turo_u64(turo_t *ctx, uint64_t val)
Outputs a formatted result unsigned 64 bit integer.
void turo_array_s32(turo_t *ctx, int32_t *vals, size_t size)
Outputs a int32 array result.
void turo_array_u8(turo_t *ctx, uint8_t *vals, size_t size)
Outputs a formatted uint8 array result.
void turo_simple_s32(turo_t *ctx, int32_t val)
Outputs a full successful int32 turo result.
void turo_simple_exit_status(turo_t *ctx, int exit_status)
Outputs a full turo result with exit code.
void turo_simple_dict_string(turo_t *ctx, const char *key, const char *val)
Outputs a full successful dict with string turo result.
void turo_dict_string(turo_t *ctx, const char *key, const char *val)
Outputs a dict with string data.
void turo_simple_dict_s32(turo_t *ctx, const char *key, int32_t val)
Outputs a full successful dict with an integer turo result.
void turo_simple_array_s32(turo_t *ctx, int32_t *vals, size_t size)
Outputs a full successful int32 array turo result.
void turo_simple_array_u8(turo_t *ctx, uint8_t *vals, size_t size)
Outputs a full successful uint8 array turo result.
void turo_dict_s32(turo_t *ctx, const char *key, int32_t val)
Outputs a dict with integer data.
turo type