2021-06-27 09:32:03 +03:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-11 17:05:00 +03:00
|
|
|
#include "cBackend.h"
|
|
|
|
|
2021-07-11 13:18:16 +03:00
|
|
|
Value *newValue(size_t size);
|
2020-10-11 17:05:00 +03:00
|
|
|
Value *newReference(Value *source);
|
|
|
|
void removeReference(Value *source);
|
|
|
|
|
2022-09-21 13:13:15 +03:00
|
|
|
#define IDRIS2_NEW_VALUE(t) ((t *)newValue(sizeof(t)))
|
2021-07-11 13:18:16 +03:00
|
|
|
|
2020-10-11 17:05:00 +03:00
|
|
|
Value_Arglist *newArglist(int missing, int total);
|
|
|
|
Value_Constructor *newConstructor(int total, int tag, const char *name);
|
|
|
|
|
|
|
|
// copies arglist, no pointer bending
|
|
|
|
Value_Closure *makeClosureFromArglist(fun_ptr_t f, Value_Arglist *);
|
|
|
|
|
|
|
|
Value_Double *makeDouble(double d);
|
|
|
|
Value_Char *makeChar(char d);
|
2021-06-03 12:44:42 +03:00
|
|
|
Value_Bits8 *makeBits8(uint8_t i);
|
|
|
|
Value_Bits16 *makeBits16(uint16_t i);
|
|
|
|
Value_Bits32 *makeBits32(uint32_t i);
|
|
|
|
Value_Bits64 *makeBits64(uint64_t i);
|
2020-10-11 17:05:00 +03:00
|
|
|
Value_Int8 *makeInt8(int8_t i);
|
|
|
|
Value_Int16 *makeInt16(int16_t i);
|
|
|
|
Value_Int32 *makeInt32(int32_t i);
|
|
|
|
Value_Int64 *makeInt64(int64_t i);
|
2021-06-03 12:44:42 +03:00
|
|
|
Value_Int8 *makeBool(int p);
|
|
|
|
Value_Integer *makeInteger();
|
|
|
|
Value_Integer *makeIntegerLiteral(char *i);
|
2020-10-11 17:05:00 +03:00
|
|
|
Value_String *makeEmptyString(size_t l);
|
|
|
|
Value_String *makeString(char *);
|
|
|
|
|
|
|
|
Value_Pointer *makePointer(void *);
|
2021-05-17 16:01:09 +03:00
|
|
|
Value_GCPointer *makeGCPointer(void *ptr_Raw, Value_Closure *onCollectFct);
|
2021-05-17 16:03:59 +03:00
|
|
|
Value_Buffer *makeBuffer(void *buf);
|
2020-10-11 17:05:00 +03:00
|
|
|
Value_Array *makeArray(int length);
|
|
|
|
Value_World *makeWorld(void);
|