exported Autoarr_KVPair & Autoarr_Unitype
This commit is contained in:
10
base/types.c
10
base/types.c
@@ -7,8 +7,8 @@
|
||||
const char* my_type_name(my_type t){
|
||||
switch (t) {
|
||||
case Null: return "Null";
|
||||
case Double: return "Double";
|
||||
case Float: return "Float";
|
||||
case Float64: return "Float64";
|
||||
case Float32: return "Float32";
|
||||
case Bool: return "Bool";
|
||||
case Char: return "Char";
|
||||
case Int8: return "Int8";
|
||||
@@ -49,8 +49,8 @@ const char* my_type_name(my_type t){
|
||||
void Unitype_free(Unitype u){
|
||||
switch (u.type) {
|
||||
case Null:
|
||||
case Float:
|
||||
case Double:
|
||||
case Float32:
|
||||
case Float64:
|
||||
case Char:
|
||||
case Bool:
|
||||
case Int8:
|
||||
@@ -119,7 +119,7 @@ void Unitype_free(Unitype u){
|
||||
void printuni(Unitype v){
|
||||
switch (v.type) {
|
||||
case Null: printf("{Null}");break;
|
||||
case Double: printf("{%s : %lf}",my_type_name(v.type),v.Double);break;
|
||||
case Float64: printf("{%s : %lf}",my_type_name(v.type),v.Float64);break;
|
||||
case Char: printf("{%s : '%c'}",my_type_name(v.type),v.Char);break;
|
||||
case Bool:
|
||||
case UInt64: printf("{%s : %lu}",my_type_name(v.type),v.UInt64);break;
|
||||
|
||||
@@ -14,8 +14,10 @@ typedef int32_t int32;
|
||||
typedef uint32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
typedef float float32;
|
||||
typedef double float64;
|
||||
typedef enum __attribute__((__packed__)) my_type {
|
||||
Null, Float, Double, Char, Bool,
|
||||
Null, Float32, Float64, Char, Bool,
|
||||
UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64, Int64,
|
||||
UInt8Ptr, Int8Ptr, UInt16Ptr, Int16Ptr, UInt32Ptr, Int32Ptr, UInt64Ptr, Int64Ptr,
|
||||
CharPtr, STNodePtr, HashtablePtr,
|
||||
@@ -31,7 +33,7 @@ typedef struct Unitype{
|
||||
union {
|
||||
int64 Int64;
|
||||
uint64 UInt64;
|
||||
double Double;
|
||||
double Float64;
|
||||
char Char;
|
||||
bool Bool;
|
||||
void* VoidPtr;
|
||||
|
||||
Reference in New Issue
Block a user