]> git.tdb.fi Git - gldbg.git/blob - source/glprint.funcs.t
Fix things for 64-bit systems
[gldbg.git] / source / glprint.funcs.t
1 w('static void print_%s(void *user_data', func.name)
2 if ret.ctype!="void":
3         w(', %s ret', ret.ctype)
4 for p in params:
5         w(', %s %s', p.ctype, p.name)
6 wl(')')
7 wl('{')
8 wl('    GlPrintData *gpd = (GlPrintData *)user_data;')
9 w('     snprintf(gpd->buffer, gpd->bufsize, "%s(', func.name)
10 first = True
11 pname = None
12 for p in params:
13         if not first:
14                 w(', ')
15         if p.name=="pname":
16                 pname = p
17         if p.kind=="value":
18                 if pname and p.name=="param" and p.base_ctype=="GLint":
19                         w('%%s')
20                 elif p.type=="TextureComponentCount":
21                         w('%%s')
22                 else:
23                         w('%s', p.io[1])
24         elif p.kind=="reference" and not p.io:
25                 w('<ref:%s %%p>', p.type)
26         else:
27                 w('%%s')
28         first = False
29 w(')')
30 if ret.ctype!="void":
31         w(' = %s', ret.io[1])
32 w('"')
33 for p in params+[ret]:
34         if p.ctype!="void":
35                 if p.kind=="value":
36                         if pname and p.name=="param" and p.base_ctype=="GLint":
37                                 w(', print_parameter(%s, %s)', pname.name, p.name)
38                         elif p.type=="TextureComponentCount":
39                                 w(', print_internal_format(%s)', p.name)
40                         elif len(p.io)>=3 and p.io[2]:
41                                 if p.io[2][0]=='(':
42                                         w(', %s%s', p.io[2], p.name)
43                                 else:
44                                         w(', %s(%s, "%s")', p.io[2], p.name, p.type)
45                         else:
46                                 w(', %s', p.name)
47                 elif p.kind=="reference" and not p.io:
48                         w(', %s', p.name)
49                 elif not p.csize:
50                         w(', print_data(%s, 0)', p.name)
51                 elif p.base_ctype=="GLvoid" or p.base_ctype=="void":
52                         w(', print_data(%s, %s)', p.name, p.csize)
53                 elif len(p.io)>=3 and p.io[2]:
54                         w(', print_array_described(%s, "%s", %s, sizeof(%s), %s)', p.io[2], p.type, p.name, p.base_ctype, p.csize)
55                 else:
56                         w(', print_array("%s", %s, sizeof(%s), %s)', p.io[1], p.name, p.base_ctype, p.csize)
57 wl(');')
58 wl('}')
59 :static void init_print(GlDecoder *dec)
60 :{
61 wl('    dec->%s = print_%s;', func.name, func.name)
62 :}