X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglprint.funcs.t;h=db626c0539efecdb4a3530fb2b88f79625198a04;hb=3c32a221de1435ae7af8d96182560e8b28f1a4c0;hp=927fa366ea3afd75b9e97d52b358ea70a6a594ad;hpb=2e4973ec66cd8ae12d4253e3c3ad9e36a8a4bca6;p=gldbg.git diff --git a/source/glprint.funcs.t b/source/glprint.funcs.t index 927fa36..db626c0 100644 --- a/source/glprint.funcs.t +++ b/source/glprint.funcs.t @@ -1,7 +1,4 @@ # $Id$ -^typemap gl.tm -^iomap gl.io -^spec gl gl.spec w('static void print_%s(void *user_data', func.name) if ret.ctype!="void": w(', %s ret', ret.ctype) @@ -16,18 +13,37 @@ for p in params: if not first: w(', ') if p.kind=="value": - w("%s", p.io[1]) - else: - w("%%p") + w('%s', p.io[1]) + elif p.kind=="reference": + if p.io: + w('{%s}', p.io[1]) + else: + w('', p.type) + elif p.kind=="array": + w('%%s') first = False w(')') if ret.ctype!="void": w(' = %s', ret.io[1]) w('"') -for p in params: - w(', %s', p.name) -if ret.ctype!="void": - w(', ret') +for p in params+[ret]: + if p.ctype!="void": + if p.kind=="value": + if len(p.io)>=3 and p.io[2]: + f = p.io[2].split(':') + w(', %s(%s)', f[0], ", ".join(eval(x) for x in f[1:])) + else: + w(', %s', p.name) + elif p.kind=="reference": + if p.io: + w(', *%s', p.name) + elif p.kind=="array": + if not p.csize: + w(', print_data(%s, 0)', p.name) + elif p.base_ctype=="GLvoid" or p.base_ctype=="void": + w(', print_data(%s, %s)', p.name, p.csize) + else: + w(', print_array("%s", %s, sizeof(%s), %s)', p.io[1], p.name, p.base_ctype, p.csize) wl(');') wl('}') :static void init_print(GlDecoder *dec)