include: add tc_variant_t type

This commit is contained in:
jussi 2019-10-08 13:00:28 +03:00
parent 6ff3f673d2
commit 846a760ec6

View File

@ -4,6 +4,8 @@
extern "C" {
#endif
#include <stdint.h>
// Common definitions for tuxclocker
// Error values
@ -14,9 +16,20 @@ extern "C" {
// Tagged union of data types for simulating function overloading
enum tc_data_types {
TC_TYPE_INT,
TC_TYPE_DOUBLE,
TC_TYPE_STRING,
TC_TYPE_STRING_ARR
};
typedef struct {
enum tc_data_types data_type;
union {
int64_t int_value;
double double_value;
char *string_value;
};
} tc_variant_t;
typedef struct {
enum tc_data_types arg_type;
union {