2 wl('static unsigned decode_%s(GlDecoder *dec, const char *data)', func.name)
4 wl(' unsigned pos = 0;')
6 wl(' %s ret;', ret.ctype)
8 wl(' %s p_%s;', p.ctype, p.name)
10 wl(' pos += read_%s(&ret, data+pos);', ret.io[0])
13 wl(' pos += read_%s(&p_%s, data+pos);', p.io[0], p.name)
14 elif p.kind=="array" and p.io and p.io[0]=="string":
15 wl(' pos += read_string_array(&p_%s, data+pos);', p.name)
17 wl(' pos += read_data((const void **)&p_%s, data+pos);', p.name)
19 wl(' pos += read_pointer((void **)&p_%s, data+pos);', p.name)
20 wl(' if(dec->%s)', func.name)
21 w(' dec->%s(dec->user_data', func.name)
29 :static int decode_func(GlDecoder *dec, unsigned short func, const char *data)
33 wl(' case FUNC_%s: return decode_%s(dec, data);', func.name.upper(), func.name)