5 !handcode glXGetProcAddress
6 !handcode glXGetProcAddressARB
7 !handcode eglGetProcAddress
8 wl('%s APIENTRY %s(%s)', ret.ctype, func.name, ", ".join([p.ctype+" "+p.name for p in params]))
10 wl(' static %s (*orig)(%s) = NULL;', ret.ctype, ", ".join([p.ctype for p in params]))
13 wl(' %s ret;', ret.ctype)
15 wl(' orig = glsym("%s");', func.name)
16 wl(' tracepoint(FUNC_%s, BREAK_CALL);', func.name.upper())
17 wl(' pkt = packet_begin(FUNC_%s);', func.name.upper())
20 if p.direction=="out" and not head_sent:
21 wl(' packet_send_partial(pkt, get_out_fd());')
25 wl('orig(%s);', ", ".join([q.name for q in params]))
28 wl(' packet_write_%s(pkt, %s);', p.io[0].replace(' ', '_'), p.name)
29 elif p.kind=="array" and p.io and p.io[0]=="string":
30 wl(' packet_write_string_array(pkt, %s, %s);', p.name, p.csize)
32 wl(' packet_write_data(pkt, %s, %s);', p.name, p.csize)
34 wl(' packet_write_pointer(pkt, %s);', p.name)
37 wl(' packet_send_partial(pkt, get_out_fd());')
38 wl(' ret = orig(%s);', ", ".join([p.name for p in params]))
40 wl(' packet_write_%s(pkt, ret);', ret.io[0].replace(' ', '_'))
41 wl(' packet_send(pkt, get_out_fd());')
43 wl(' orig(%s);', ", ".join([p.name for p in params]))
44 if not func.name.startswith("glX"):
46 wl(' tracepoint(FUNC_%s, BREAK_RETURN);', func.name.upper())