X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglprint.h;h=1244b9b05141710ac74ef4d2804da6f28702f628;hb=68bbf8f302d01d2ee82dee28b9f64cff3660e234;hp=6d9ce15606b858b45cc56cc44f3b76715fd385ec;hpb=9d1825d591a7261b1cff620ba535d333352984bf;p=gldbg.git diff --git a/source/glprint.h b/source/glprint.h index 6d9ce15..1244b9b 100644 --- a/source/glprint.h +++ b/source/glprint.h @@ -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