This commit is contained in:
dzaima 2022-06-03 21:17:25 +03:00
parent d4da8a1127
commit 9d97c20c38
4 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,8 @@ typedef uint64_t BQNV;
extern "C" { extern "C" {
#endif #endif
void bqn_init(void);
void bqn_free(BQNV v); void bqn_free(BQNV v);
double bqn_toF64 (BQNV v); // includes bqn_free(v) double bqn_toF64 (BQNV v); // includes bqn_free(v)

View File

@ -1,4 +1,5 @@
{ {
bqn_init;
bqn_free; bqn_free;
bqn_toF64; bqn_toF64;
bqn_toChar; bqn_toChar;

View File

@ -30,6 +30,10 @@ uint32_t bqn_toChar(BQNV v) { uint32_t r = o2cu(getB(v)); freeTagged(v); return
double bqn_readF64 (BQNV v) { return o2fu(getB(v)); } double bqn_readF64 (BQNV v) { return o2fu(getB(v)); }
uint32_t bqn_readChar(BQNV v) { return o2cu(getB(v)); } uint32_t bqn_readChar(BQNV v) { return o2cu(getB(v)); }
void bqn_init() {
cbqn_init();
}
B type_c1(B t, B x); B type_c1(B t, B x);
int bqn_type(BQNV v) { int bqn_type(BQNV v) {
return o2i(type_c1(bi_N, inc(getB(v)))); return o2i(type_c1(bi_N, inc(getB(v))));

View File

@ -683,6 +683,7 @@ void base_init() { // very first init function
bool cbqn_initialized; bool cbqn_initialized;
void cbqn_init() { void cbqn_init() {
if (cbqn_initialized) return;
#define F(X) X##_init(); #define F(X) X##_init();
FOR_INIT(F) FOR_INIT(F)
#undef F #undef F