3 # $Id: gltable.py,v 1.3 2001/11/18 22:42:57 brianp Exp $
5 # Mesa 3-D graphics library
8 # Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
10 # Permission is hereby granted, free of charge, to any person obtaining a
11 # copy of this software and associated documentation files (the "Software"),
12 # to deal in the Software without restriction, including without limitation
13 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 # and/or sell copies of the Software, and to permit persons to whom the
15 # Software is furnished to do so, subject to the following conditions:
17 # The above copyright notice and this permission notice shall be included
18 # in all copies or substantial portions of the Software.
20 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
24 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 # Generate the glapitable.h file.
31 # gloffsets.py >glapitable.h
34 # The apispec file must be in the current directory.
41 print '/* DO NOT EDIT - This file generated automatically with gltable.py script */'
42 print '#ifndef _GLAPI_TABLE_H_'
43 print '#define _GLAPI_TABLE_H_'
45 print '#include <GL/gl.h>'
47 print 'struct _glapi_table'
62 def DoRecord(name
, returnType
, argTypeList
, argNameList
, alias
, offset
):
63 argList
= apiparser
.MakeArgList(argTypeList
, argNameList
)
64 if offset
>= 0 and not records
.has_key(offset
):
65 records
[offset
] = (name
, returnType
, argList
)
66 #print '#define _gloffset_%s %d' % (name, offset)
76 #print 'Missing offset %d' % (prevk)
79 (name
, returnType
, argList
) = records
[k
]
80 print ' %s (*%s)(%s); /* %d */' % (returnType
, name
, argList
, k
)
85 apiparser
.ProcessSpecFile("APIspec", DoRecord
)