From 9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 6 Jan 2017 14:48:53 -0500 Subject: Enhance API to support extended-precision arithmetic and implement intdiv as a demonstration. --- awk.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'awk.h') diff --git a/awk.h b/awk.h index 278f54c5..514dfdcb 100644 --- a/awk.h +++ b/awk.h @@ -1060,6 +1060,8 @@ enum block_id { BLOCK_INVALID = 0, /* not legal */ BLOCK_NODE, BLOCK_BUCKET, + BLOCK_MPFR, + BLOCK_MPZ, BLOCK_MAX /* count */ }; @@ -1945,3 +1947,18 @@ erealloc_real(void *ptr, size_t count, const char *where, const char *var, const return ret; } + +static inline NODE * +make_number_node(unsigned int tp) +{ + NODE *r; + getnode(r); + r->type = Node_val; + r->valref = 1; + r->flags = (tp|MALLOC|NUMBER|NUMCUR); + r->stptr = NULL; + r->stlen = 0; + r->wstptr = NULL; + r->wstlen = 0; + return r; +} -- cgit v1.2.3