X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglprint.h;h=c23fbc3e794c38b81428ba5719d825f8bce3af64;hb=a832996c884a0e0acc9a38ba4dd258edb75ec7af;hp=6d9ce15606b858b45cc56cc44f3b76715fd385ec;hpb=9d1825d591a7261b1cff620ba535d333352984bf;p=gldbg.git diff --git a/source/glprint.h b/source/glprint.h index 6d9ce15..c23fbc3 100644 --- a/source/glprint.h +++ b/source/glprint.h @@ -1,16 +1,30 @@ -/* $Id$ - -This file is part of gldbg -Copyright © 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the GPL -*/ - #ifndef GLPRINT_H_ #define GLPRINT_H_ #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