]> git.tdb.fi Git - gldbg.git/blobdiff - source/glprint.h
Consolidate genwrap.py and genenum.py into generate.py
[gldbg.git] / source / glprint.h
index 6d9ce15606b858b45cc56cc44f3b76715fd385ec..1244b9b05141710ac74ef4d2804da6f28702f628 100644 (file)
@@ -10,7 +10,28 @@ Distributed under the GPL
 
 #include "gldecoder.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 GlDecoder *glprint_new(char *, unsigned);
 char *glprint_get_buffer(GlDecoder *);
 
+#ifdef __cplusplus
+}
+
+class GlPrint
+{
+private:
+       GlDecoder *glp;
+
+public:
+       GlPrint(char *b, unsigned l): glp(glprint_new(b, l)) { }
+       ~GlPrint() { gldecoder_delete(glp); }
+
+       int decode(const char *d, unsigned l) { return gldecoder_decode(glp, d, l); }
+       char *get_buffer() { return glprint_get_buffer(glp); }
+};
+#endif
+
 #endif