diff options
| author | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-13 09:23:55 +0200 |
|---|---|---|
| committer | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-13 09:23:55 +0200 |
| commit | 09e52786905c8d5360ad90f0ab7c80e062b88e12 (patch) | |
| tree | 90df75b348348753611d7cd607f0a82d00a7c1fc /src/runtime/c/pgf/writer.h | |
| parent | 3aecefebdb4f1baa9638eb524dd3db73be85c0ea (diff) | |
added PGF writer to the C runtime
Diffstat (limited to 'src/runtime/c/pgf/writer.h')
| -rw-r--r-- | src/runtime/c/pgf/writer.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/writer.h b/src/runtime/c/pgf/writer.h new file mode 100644 index 000000000..de99ee266 --- /dev/null +++ b/src/runtime/c/pgf/writer.h @@ -0,0 +1,39 @@ +#ifndef WRITER_H_ +#define WRITER_H_ + +#include <gu/exn.h> +#include <gu/mem.h> +#include <gu/in.h> + +// the writer interface + +typedef struct PgfWriter PgfWriter; + +PGF_INTERNAL_DECL PgfWriter* +pgf_new_writer(GuOut* out, GuPool* pool, GuExn* err); + +PGF_INTERNAL_DECL void +pgf_write_tag(uint8_t tag, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_uint(uint32_t val, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_int(int32_t val, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_string(GuString val, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_double(double val, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_len(size_t len, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_cid(PgfCId id, PgfWriter* wtr); + +PGF_INTERNAL_DECL void +pgf_write_pgf(PgfPGF* pgf, PgfWriter* wtr); + +#endif // WRITER_H_ |
