summaryrefslogtreecommitdiff
path: root/progs/tests/functions.py
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-11-18 23:16:56 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-11-18 23:16:56 +0000
commit17fe22d3bfcce0471ab9ae638cc6b0c91f7d8e65 (patch)
treec57089430590548f3b0e68a5b20697db9e7c9c6d /progs/tests/functions.py
parenta6fdefa322b7cda81936069d85a9ca1c98466167 (diff)
test for glXGetProcAddress()
Diffstat (limited to 'progs/tests/functions.py')
-rw-r--r--progs/tests/functions.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/progs/tests/functions.py b/progs/tests/functions.py
new file mode 100644
index 0000000000..d1a8cc3434
--- /dev/null
+++ b/progs/tests/functions.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+
+# $Id: functions.py,v 1.1 2001/11/18 23:16:56 brianp Exp $
+
+# Helper for the getprocaddress.c test.
+
+
+import string
+
+def PrintHead():
+ print """
+static const char *functions[] = {"""
+
+
+def PrintTail():
+ print"""
+ NULL
+};
+"""
+
+
+def PrintFunctions(specFile):
+
+ # init some vars
+ prevCategory = ''
+ funcName = ''
+
+ f = open(specFile)
+ for line in f.readlines():
+
+ # split line into tokens
+ tokens = string.split(line)
+
+ if len(tokens) > 0 and line[0] != '#':
+
+ if tokens[0] == 'name':
+ if funcName != '':
+ if category != prevCategory:
+ print ' "-%s",' % category
+ prevCategory = category
+
+ print ' "gl%s",' % funcName
+ funcName = tokens[1]
+
+ elif tokens[0] == 'category':
+ category = tokens[1]
+
+ #endif
+ #endif
+ #endfor
+#enddef
+
+
+PrintHead()
+PrintFunctions("../bin/APIspec")
+PrintTail()