roza/lib/value.h

25 lines
366 B
C
Raw Normal View History

2023-12-09 17:24:41 +00:00
#ifndef RZ_VALUE_H
#define RZ_VALUE_H
#include "type.h"
typedef struct {
type_t* type;
union {
double num;
2023-12-09 21:59:24 +00:00
int bool;
2023-12-10 03:49:28 +00:00
char* str;
2023-12-09 17:24:41 +00:00
} value;
} value_t;
void value_init(value_t* value, type_t* type);
void value_free(value_t* value);
int value_eq(value_t* value, value_t* rhs);
size_t value_str(value_t* value, char* buffer, size_t size);
#endif