X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgldecoder.c;h=6e903736f726a5840c9252056858c52b910d0592;hb=6475e8951e1901b247f5d1d1dd9fcfc1e77e163a;hp=85d089d2034af846d3d7c990db52db680d40ea66;hpb=0cdc7b50b0e7758a1660c94be664a810504a88f4;p=gldbg.git diff --git a/source/gldecoder.c b/source/gldecoder.c index 85d089d..6e90373 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; + } +}