]> git.tdb.fi Git - gldbg.git/blob - source/glprint.funcs.t
927fa366ea3afd75b9e97d52b358ea70a6a594ad
[gldbg.git] / source / glprint.funcs.t
1 # $Id$
2 ^typemap gl.tm
3 ^iomap gl.io
4 ^spec gl gl.spec
5 w('static void print_%s(void *user_data', func.name)
6 if ret.ctype!="void":
7         w(', %s ret', ret.ctype)
8 for p in params:
9         w(', %s %s', p.ctype, p.name)
10 wl(')')
11 wl('{')
12 wl('    GlPrintData *gpd = (GlPrintData *)user_data;')
13 w('     snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name)
14 first = True
15 for p in params:
16         if not first:
17                 w(', ')
18         if p.kind=="value":
19                 w("%s", p.io[1])
20         else:
21                 w("%%p")
22         first = False
23 w(')')
24 if ret.ctype!="void":
25         w(' = %s', ret.io[1])
26 w('"')
27 for p in params:
28         w(', %s', p.name)
29 if ret.ctype!="void":
30         w(', ret')
31 wl(');')
32 wl('}')
33 :static void init_print(GlDecoder *dec)
34 :{
35 wl('    dec->%s = print_%s;', func.name, func.name)
36 :}