X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgldecoder.c;h=863be925aeaaf55eee6961c9114ddaae7e0e3ebf;hb=3c32a221de1435ae7af8d96182560e8b28f1a4c0;hp=e11d13c46d51ef0a064415eecf7933b7cb0e6b10;hpb=c6b2f7585d51164dc32f4dd2a05855913e464c58;p=gldbg.git diff --git a/source/gldecoder.c b/source/gldecoder.c index e11d13c..863be92 100644 --- a/source/gldecoder.c +++ b/source/gldecoder.c @@ -12,7 +12,8 @@ Distributed under the GPL static unsigned read_short(short *, const char *); static unsigned read_int(int *, const char *); -static int decode_func(GlDecoder *, short, const char *); +static int decode_func(GlDecoder *, unsigned short, const char *); +static int decode_gldfunc(GlDecoder *, unsigned short, const char *); GlDecoder *gldecoder_new(void *user_data, void (*destroy)(void *)) { @@ -37,7 +38,7 @@ int gldecoder_decode(GlDecoder *dec, const char *data, unsigned len) { unsigned pos = 0; int pktlen; - short func; + unsigned short func; int ret; if(lengldError) + dec->gldError(dec->user_data, code); + return pos; +} + +static int decode_gldfunc(GlDecoder *dec, unsigned short func, const char *data) +{ + switch(func) + { + case FUNC_GLDERROR: return decode_gldError(dec, data); + default: return -1; + } +}