aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-06 14:48:53 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-01-06 14:48:53 -0500
commit9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba (patch)
tree7b5339408b9770e2db7483eda61af2166635e912 /awk.h
parent0cb66f4f80cc8c2df63aed30e2cf5753a106b951 (diff)
downloadegawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.tar.gz
egawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.tar.bz2
egawk-9ef43720d1b2b3125f4367f3ccf2cb7129d1a9ba.zip
Enhance API to support extended-precision arithmetic and implement intdiv as a demonstration.
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h17
1 files changed, 17 insertions, 0 deletions
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;
+}