summaryrefslogtreecommitdiff
path: root/libstd/fmt2.myr
diff options
context:
space:
mode:
Diffstat (limited to 'libstd/fmt2.myr')
-rw-r--r--libstd/fmt2.myr15
1 files changed, 15 insertions, 0 deletions
diff --git a/libstd/fmt2.myr b/libstd/fmt2.myr
index 5d3511f..bc1de45 100644
--- a/libstd/fmt2.myr
+++ b/libstd/fmt2.myr
@@ -42,6 +42,21 @@ pkg std =
$noret const f2fatalv : (fmt : byte[:], ap : valist# -> void)
;;
+/* same as 'put', but exits the program after printing */
+const f2fatal = {fmt, args
+ var ap
+
+ ap = vastart(&args)
+ f2putv(fmt, &ap)
+ exit(1)
+}
+
+/* same as 'putv', but exits the program after printing */
+const f2fatalv = {fmt, ap
+ f2putv(fmt, ap)
+ exit(1)
+}
+
var fmtmapinited : bool = false
var fmtmap : htab(byte[:], (sb : strbuf#, ap : valist#, opts : byte[:] -> void))#