2 :#define UNUSED __attribute__((unused))
3 wl('static unsigned decode_%s(GlDecoder *dec, GlPacket *pkt UNUSED)', func.name)
6 wl(' %s ret;', ret.ctype)
8 wl(' %s p_%s;', p.ctype, p.name)
11 wl(' read_%s((%s *)&p_%s, pkt);', p.io[0].replace(' ', '_'), p.io[0], p.name)
12 elif p.kind=="array" and p.io and p.io[0]=="string":
13 wl(' read_string_array(&p_%s, pkt);', p.name)
15 wl(' read_data((pointer *)&p_%s, pkt);', p.name)
17 wl(' read_pointer((pointer *)&p_%s, pkt);', p.name)
19 wl(' read_%s((%s *)&ret, pkt);', ret.io[0].replace(' ', '_'), ret.io[0])
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, GlPacket *pkt)
33 wl(' case FUNC_%s: decode_%s(dec, pkt); break;', func.name.upper(), func.name)