started an official API to the C runtime

This commit is contained in:
kr.angelov
2012-12-12 11:25:58 +00:00
parent 5e091d2e3d
commit aa13090b66
15 changed files with 329 additions and 173 deletions

View File

@@ -5,13 +5,24 @@
#include <gu/file.h>
#include <gu/utf8.h>
#include <locale.h>
#include <stdlib.h>
GU_DECLARE_TYPE(PgfAbstr, struct);
int main(void) {
int main(int argc, char* argv[]) {
// Set the character locale, so we can produce proper output.
setlocale(LC_CTYPE, "");
if (argc != 1) {
fprintf(stderr, "usage: %s pgf\n", argv[0]);
return EXIT_FAILURE;
}
char* filename = argv[1];
GuPool* pool = gu_new_pool();
GuExn* err = gu_exn(NULL, type, pool);
GuIn* in = gu_file_in(stdin, pool);
PgfPGF* pgf = pgf_read(in, pool, err);
PgfPGF* pgf = pgf_read(filename, pool, err);
int status = 0;
if (!gu_ok(err)) {
fprintf(stderr, "Reading PGF failed\n");