aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mapi/glapi/gen/gl_procs.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-06-15 21:36:28 +0200
committermarha <marha@users.sourceforge.net>2015-06-15 21:36:28 +0200
commit008a8d8051786badb83e455bd9281103ba9a6470 (patch)
treef99ea672d105271cb60a726fac8022ce47ea2866 /mesalib/src/mapi/glapi/gen/gl_procs.py
parent912e881bec8b16f2331225960645c3bdf5a8ba2d (diff)
parente8d5e7c4bb11f7fcb0a4ba5c13f43e7929849a2f (diff)
downloadvcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.gz
vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.tar.bz2
vcxsrv-008a8d8051786badb83e455bd9281103ba9a6470.zip
Merge remote-tracking branch 'origin/released'
Conflicts: freetype/src/base/ftfntfmt.c freetype/src/cache/ftcimage.c freetype/src/cid/cidriver.c freetype/src/truetype/ttdriver.c mesalib/src/mesa/drivers/dri/common/dri_util.c mesalib/src/mesa/drivers/dri/swrast/swrast.c openssl/Makefile
Diffstat (limited to 'mesalib/src/mapi/glapi/gen/gl_procs.py')
-rwxr-xr-xmesalib/src/mapi/glapi/gen/gl_procs.py52
1 files changed, 28 insertions, 24 deletions
diff --git a/mesalib/src/mapi/glapi/gen/gl_procs.py b/mesalib/src/mapi/glapi/gen/gl_procs.py
index b1fffc4ca..685e2fac3 100755
--- a/mesalib/src/mapi/glapi/gen/gl_procs.py
+++ b/mesalib/src/mapi/glapi/gen/gl_procs.py
@@ -25,9 +25,12 @@
# Authors:
# Ian Romanick <idr@us.ibm.com>
+import argparse
+
import license
-import gl_XML, glX_XML
-import sys, getopt
+import gl_XML
+import glX_XML
+
class PrintGlProcs(gl_XML.gl_print_base):
def __init__(self, es=False):
@@ -39,7 +42,6 @@ class PrintGlProcs(gl_XML.gl_print_base):
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM")
-
def printRealHeader(self):
print """
/* This file is only included by glapi.c and is used for
@@ -161,26 +163,28 @@ typedef struct {
return
-def show_usage():
- print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0]
- print "-c Enable compatibility with OpenGL ES."
- sys.exit(1)
+def _parser():
+ """Parse arguments and return a namepsace."""
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-f', '--filename',
+ default='gl_API.xml',
+ metavar="input_file_name",
+ dest='file_name',
+ help="Path to an XML description of OpenGL API.")
+ parser.add_argument('-c', '--es-version',
+ dest='es',
+ action="store_true",
+ help="filter functions for es")
+ return parser.parse_args()
+
+
+def main():
+ """Main function."""
+ args = _parser()
+ api = gl_XML.parse_GL_API(args.file_name, glX_XML.glx_item_factory())
+ PrintGlProcs(args.es).Print(api)
+
if __name__ == '__main__':
- file_name = "gl_API.xml"
-
- try:
- (args, trail) = getopt.getopt(sys.argv[1:], "f:c")
- except Exception,e:
- show_usage()
-
- es = False
- for (arg,val) in args:
- if arg == "-f":
- file_name = val
- elif arg == "-c":
- es = True
-
- api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
- printer = PrintGlProcs(es)
- printer.Print(api)
+ main()