summaryrefslogtreecommitdiff
path: root/src/runtime/c/utils/pgf-print.c
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2017-01-26 12:48:22 +0000
committerkrasimir <krasimir@chalmers.se>2017-01-26 12:48:22 +0000
commit3467a54965e532c07d43784609ddc05b54e958e5 (patch)
tree59363c4b9d109da7af8cb418667894988ad8b668 /src/runtime/c/utils/pgf-print.c
parent17163ae88163587f2c9615898a5789aaf3bee298 (diff)
bring the Haskell binding a bit closer to the pure Haskell API
Diffstat (limited to 'src/runtime/c/utils/pgf-print.c')
-rw-r--r--src/runtime/c/utils/pgf-print.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/runtime/c/utils/pgf-print.c b/src/runtime/c/utils/pgf-print.c
deleted file mode 100644
index 07b343a4d..000000000
--- a/src/runtime/c/utils/pgf-print.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <pgf/pgf.h>
-#include <pgf/data.h>
-
-#include <gu/file.h>
-#include <gu/utf8.h>
-
-#include <locale.h>
-#include <stdlib.h>
-
-int main(int argc, char* argv[]) {
- // Set the character locale, so we can produce proper output.
- setlocale(LC_CTYPE, "");
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s pgf\n", argv[0]);
- return EXIT_FAILURE;
- }
- char* filename = argv[1];
-
- GuPool* pool = gu_new_pool();
- GuExn* err = gu_exn(pool);
- PgfPGF* pgf = pgf_read(filename, pool, err);
- int status = 0;
- if (!gu_ok(err)) {
- fprintf(stderr, "Reading PGF failed\n");
- status = 1;
- goto fail_read;
- }
- GuOut* out = gu_file_out(stdout, pool);
- pgf_print(pgf, out, err);
- gu_out_flush(out, err);
-fail_read:
- gu_pool_free(pool);
- return status;
-}
-