diff src/c/urweb.c @ 284:77a28e7430bf

intToString
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 10:13:02 -0400
parents c0e4ac23522d
children e89076c41c39
line wrap: on
line diff
--- a/src/c/urweb.c	Sun Sep 07 10:02:27 2008 -0400
+++ b/src/c/urweb.c	Sun Sep 07 10:13:02 2008 -0400
@@ -670,3 +670,14 @@
   else
     return (char *)&true;
 }
+
+lw_Basis_string lw_Basis_intToString(lw_context ctx, lw_Basis_int n) {
+  int len;
+  char *r;
+
+  lw_check_heap(ctx, INTS_MAX);
+  r = ctx->heap_front;
+  sprintf(r, "%lld%n", n, &len);
+  ctx->heap_front += len+1;
+  return r;
+}