From: José Fonseca Date: Mon, 22 Nov 2010 17:14:47 +0000 (+0000) Subject: Distinguish and ignore functions without side effects. X-Git-Tag: 2.0_alpha^2~1353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee855d94b01c24f2e2dc96a6aa1d7a09f7d19f3e;p=tools%2Fapitrace.git Distinguish and ignore functions without side effects. --- diff --git a/base.py b/base.py index 9cbec28..184e42a 100644 --- a/base.py +++ b/base.py @@ -400,7 +400,7 @@ class Arg: class Function: - def __init__(self, type, name, args, call = '__stdcall', fail = None): + def __init__(self, type, name, args, call = '__stdcall', fail = None, sideeffects=True): self.type = type self.name = name @@ -413,6 +413,7 @@ class Function: self.call = call self.fail = fail + self.sideeffects = sideeffects def prototype(self, name=None): if name is not None: diff --git a/dl.py b/dl.py index acf328b..1edcec7 100644 --- a/dl.py +++ b/dl.py @@ -31,8 +31,8 @@ from base import * class DllFunction(Function): - def __init__(self, type, name, args, call = '', fail = None): - Function.__init__(self, type, name, args, call=call, fail=fail) + def __init__(self, type, name, args, call = '', **kwargs): + Function.__init__(self, type, name, args, call=call, **kwargs) def get_true_pointer(self): ptype = self.pointer_type() diff --git a/gl.py b/gl.py index 71055ea..2fa1153 100644 --- a/gl.py +++ b/gl.py @@ -2782,34 +2782,34 @@ def basic_functions(Function): F(Void, "glCopyPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "type")]), F(Void, "glReadPixels", [(GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), Out(Pointer(GLvoid), "pixels")]), F(Void, "glDrawPixels", [(GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(Const(GLvoid)), "pixels")]), - F(Void, "glGetBooleanv", [(GLenum, "pname"), Out(Pointer(GLboolean), "params")]), - F(Void, "glGetClipPlane", [(GLenum, "plane"), Out(Array(GLdouble, "4"), "equation")]), - F(Void, "glGetDoublev", [(GLenum, "pname"), Out(Pointer(GLdouble), "params")]), - F(GLenum, "glGetError", []), - F(Void, "glGetFloatv", [(GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetIntegerv", [(GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetLightfv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetLightiv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetMapdv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLdouble), "v")]), - F(Void, "glGetMapfv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLfloat), "v")]), - F(Void, "glGetMapiv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLint), "v")]), - F(Void, "glGetMaterialfv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetMaterialiv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetPixelMapfv", [(GLenum, "map"), Out(Pointer(GLfloat), "values")]), - F(Void, "glGetPixelMapuiv", [(GLenum, "map"), Out(Pointer(GLuint), "values")]), - F(Void, "glGetPixelMapusv", [(GLenum, "map"), Out(Pointer(GLushort), "values")]), - F(Void, "glGetPolygonStipple", [Out(Pointer(GLubyte), "mask")]), - F(Alias("const GLubyte *", String), "glGetString", [(GLenum, "name")]), - F(Void, "glGetTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetTexEnviv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetTexGendv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLdouble), "params")]), - F(Void, "glGetTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetTexImage", [(GLenum, "target"), (GLint, "level"), (GLenum, "format"), (GLenum, "type"), Out(Pointer(GLvoid), "pixels")]), - F(Void, "glGetTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetTexLevelParameterfv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetTexLevelParameteriv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), + F(Void, "glGetBooleanv", [(GLenum, "pname"), Out(Pointer(GLboolean), "params")], sideeffects=False), + F(Void, "glGetClipPlane", [(GLenum, "plane"), Out(Array(GLdouble, "4"), "equation")], sideeffects=False), + F(Void, "glGetDoublev", [(GLenum, "pname"), Out(Pointer(GLdouble), "params")], sideeffects=False), + F(GLenum, "glGetError", [], sideeffects=False), + F(Void, "glGetFloatv", [(GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetIntegerv", [(GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetLightfv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetLightiv", [(GLenum, "light"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetMapdv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLdouble), "v")], sideeffects=False), + F(Void, "glGetMapfv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLfloat), "v")], sideeffects=False), + F(Void, "glGetMapiv", [(GLenum, "target"), (GLenum, "query"), Out(Pointer(GLint), "v")], sideeffects=False), + F(Void, "glGetMaterialfv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetMaterialiv", [(GLenum, "face"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetPixelMapfv", [(GLenum, "map"), Out(Pointer(GLfloat), "values")], sideeffects=False), + F(Void, "glGetPixelMapuiv", [(GLenum, "map"), Out(Pointer(GLuint), "values")], sideeffects=False), + F(Void, "glGetPixelMapusv", [(GLenum, "map"), Out(Pointer(GLushort), "values")], sideeffects=False), + F(Void, "glGetPolygonStipple", [Out(Pointer(GLubyte), "mask")], sideeffects=False), + F(Alias("const GLubyte *", String), "glGetString", [(GLenum, "name")], sideeffects=False), + F(Void, "glGetTexEnvfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetTexEnviv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetTexGendv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetTexGenfv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetTexGeniv", [(GLenum, "coord"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetTexImage", [(GLenum, "target"), (GLint, "level"), (GLenum, "format"), (GLenum, "type"), Out(Pointer(GLvoid), "pixels")], sideeffects=False), + F(Void, "glGetTexParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetTexParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetTexLevelParameterfv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetTexLevelParameteriv", [(GLenum, "target"), (GLint, "level"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsEnabled", [(GLenum, "cap")]), F(GLboolean, "glIsList", [(GLuint, "list")]), F(Void, "glDepthRange", [(GLclampd, "zNear"), (GLclampd, "zFar")]), @@ -2853,7 +2853,7 @@ def basic_functions(Function): F(Void, "glCopyTexSubImage2D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), F(Void, "glDeleteTextures", [(GLsizei, "n"), (Array(Const(GLuint), "n"), "textures")]), F(Void, "glGenTextures", [(GLsizei, "n"), Out(Array(GLuint, "n"), "textures")]), - F(Void, "glGetPointerv", [(GLenum, "pname"), Out(Pointer(OpaquePointer(GLvoid)), "params")]), + F(Void, "glGetPointerv", [(GLenum, "pname"), Out(Pointer(OpaquePointer(GLvoid)), "params")], sideeffects=False), F(GLboolean, "glIsTexture", [(GLuint, "texture")]), F(Void, "glPrioritizeTextures", [(GLsizei, "n"), (Array(Const(GLuint), "n"), "textures"), (Array(Const(GLclampf), "n"), "priorities")]), F(Void, "glTexSubImage1D", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (Blob(Const(GLvoid), "__gl_image_size(format, type, width, 1, 1, 0)"), "pixels")]), @@ -2867,9 +2867,9 @@ def basic_functions(Function): F(Void, "glColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(Const(GLfloat)), "params")]), F(Void, "glColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(Const(GLint)), "params")]), F(Void, "glCopyColorTable", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), - F(Void, "glGetColorTable", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "table")]), - F(Void, "glGetColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), + F(Void, "glGetColorTable", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "table")], sideeffects=False), + F(Void, "glGetColorTableParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetColorTableParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), F(Void, "glColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLsizei, "count"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(Const(GLvoid)), "data")]), F(Void, "glCopyColorSubTable", [(GLenum, "target"), (GLsizei, "start"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), F(Void, "glConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(Const(GLvoid)), "image")]), @@ -2880,17 +2880,17 @@ def basic_functions(Function): F(Void, "glConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(Const(GLint)), "params")]), F(Void, "glCopyConvolutionFilter1D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width")]), F(Void, "glCopyConvolutionFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLint, "x"), (GLint, "y"), (GLsizei, "width"), (GLsizei, "height")]), - F(Void, "glGetConvolutionFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "image")]), - F(Void, "glGetConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetSeparableFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "row"), (OpaquePointer(GLvoid), "column"), (OpaquePointer(GLvoid), "span")]), + F(Void, "glGetConvolutionFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "image")], sideeffects=False), + F(Void, "glGetConvolutionParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetConvolutionParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetSeparableFilter", [(GLenum, "target"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "row"), (OpaquePointer(GLvoid), "column"), (OpaquePointer(GLvoid), "span")], sideeffects=False), F(Void, "glSeparableFilter2D", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(Const(GLvoid)), "row"), (OpaquePointer(Const(GLvoid)), "column")]), - F(Void, "glGetHistogram", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")]), - F(Void, "glGetHistogramParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetHistogramParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), - F(Void, "glGetMinmax", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")]), - F(Void, "glGetMinmaxParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")]), - F(Void, "glGetMinmaxParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")]), + F(Void, "glGetHistogram", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")], sideeffects=False), + F(Void, "glGetHistogramParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetHistogramParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), + F(Void, "glGetMinmax", [(GLenum, "target"), (GLboolean, "reset"), (GLenum, "format"), (GLenum, "type"), (OpaquePointer(GLvoid), "values")], sideeffects=False), + F(Void, "glGetMinmaxParameterfv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetMinmaxParameteriv", [(GLenum, "target"), (GLenum, "pname"), Out(Pointer(GLint), "params")], sideeffects=False), F(Void, "glHistogram", [(GLenum, "target"), (GLsizei, "width"), (GLenum, "internalformat"), (GLboolean, "sink")]), F(Void, "glMinmax", [(GLenum, "target"), (GLenum, "internalformat"), (GLboolean, "sink")]), F(Void, "glResetHistogram", [(GLenum, "target")]), @@ -2946,11 +2946,11 @@ def extended_functions(Function): F(Void, "glDeleteProgram", [(GLuint, "program")]), F(Void, "glDeleteShader", [(GLuint, "program")]), F(Void, "glDetachShader", [(GLuint, "program"), (GLuint, "shader")]), - F(Void, "glGetAttachedShaders", [(GLuint, "program"), (GLsizei, "maxCount"), (OpaquePointer(GLsizei), "count"), (OpaquePointer(GLuint), "obj")]), - F(Void, "glGetProgramInfoLog", [(GLuint, "program"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLchar), "infoLog")]), - F(Void, "glGetProgramiv", [(GLuint, "program"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetShaderInfoLog", [(GLuint, "shader"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLchar), "infoLog")]), - F(Void, "glGetShaderiv", [(GLuint, "shader"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetAttachedShaders", [(GLuint, "program"), (GLsizei, "maxCount"), (OpaquePointer(GLsizei), "count"), (OpaquePointer(GLuint), "obj")], sideeffects=False), + F(Void, "glGetProgramInfoLog", [(GLuint, "program"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLchar), "infoLog")], sideeffects=False), + F(Void, "glGetProgramiv", [(GLuint, "program"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetShaderInfoLog", [(GLuint, "shader"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLchar), "infoLog")], sideeffects=False), + F(Void, "glGetShaderiv", [(GLuint, "shader"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsProgram", [(GLuint, "program")]), F(GLboolean, "glIsShader", [(GLuint, "shader")]), F(Void, "glStencilFuncSeparate", [(GLenum, "face"), (GLenum, "func"), (GLint, "ref"), (GLuint, "mask")]), @@ -2973,18 +2973,18 @@ def extended_functions(Function): F(Void, "glCompressedTexSubImage1DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLsizei, "width"), (GLenum, "format"), (GLsizei, "imageSize"), (OpaquePointer(Const(GLvoid)), "data")]), F(Void, "glCompressedTexSubImage2DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLenum, "format"), (GLsizei, "imageSize"), (OpaquePointer(Const(GLvoid)), "data")]), F(Void, "glCompressedTexSubImage3DARB", [(GLenum, "target"), (GLint, "level"), (GLint, "xoffset"), (GLint, "yoffset"), (GLint, "zoffset"), (GLsizei, "width"), (GLsizei, "height"), (GLsizei, "depth"), (GLenum, "format"), (GLsizei, "imageSize"), (OpaquePointer(Const(GLvoid)), "data")]), - F(Void, "glGetCompressedTexImageARB", [(GLenum, "target"), (GLint, "level"), (OpaquePointer(GLvoid), "img")]), + F(Void, "glGetCompressedTexImageARB", [(GLenum, "target"), (GLint, "level"), (OpaquePointer(GLvoid), "img")], sideeffects=False), F(Void, "glDisableVertexAttribArrayARB", [(GLuint, "index")]), F(Void, "glEnableVertexAttribArrayARB", [(GLuint, "index")]), - F(Void, "glGetProgramEnvParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetProgramEnvParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetProgramLocalParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetProgramLocalParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetProgramStringARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLvoid), "string")]), - F(Void, "glGetProgramivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetVertexAttribdvARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetVertexAttribfvARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetVertexAttribivARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetProgramEnvParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetProgramEnvParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetProgramLocalParameterdvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetProgramLocalParameterfvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetProgramStringARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLvoid), "string")], sideeffects=False), + F(Void, "glGetProgramivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetVertexAttribdvARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetVertexAttribfvARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetVertexAttribivARB", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(Void, "glProgramEnvParameter4dARB", [(GLenum, "target"), (GLuint, "index"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), F(Void, "glProgramEnvParameter4dvARB", [(GLenum, "target"), (GLuint, "index"), (OpaquePointer(Const(GLdouble)), "params")]), F(Void, "glProgramEnvParameter4fARB", [(GLenum, "target"), (GLuint, "index"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), @@ -3036,9 +3036,9 @@ def extended_functions(Function): F(Void, "glBufferSubDataARB", [(GLenum, "target"), (GLintptrARB, "offset"), (GLsizeiptrARB, "size"), (OpaquePointer(Const(GLvoid)), "data")]), F(Void, "glDeleteBuffersARB", [(GLsizei, "n"), (OpaquePointer(Const(GLuint)), "buffer")]), F(Void, "glGenBuffersARB", [(GLsizei, "n"), (OpaquePointer(GLuint), "buffer")]), - F(Void, "glGetBufferParameterivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetBufferPointervARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(OpaquePointer(GLvoid)), "params")]), - F(Void, "glGetBufferSubDataARB", [(GLenum, "target"), (GLintptrARB, "offset"), (GLsizeiptrARB, "size"), (OpaquePointer(GLvoid), "data")]), + F(Void, "glGetBufferParameterivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetBufferPointervARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(OpaquePointer(GLvoid)), "params")], sideeffects=False), + F(Void, "glGetBufferSubDataARB", [(GLenum, "target"), (GLintptrARB, "offset"), (GLsizeiptrARB, "size"), (OpaquePointer(GLvoid), "data")], sideeffects=False), F(GLboolean, "glIsBufferARB", [(GLuint, "buffer")]), F(OpaquePointer(GLvoid), "glMapBufferARB", [(GLenum, "target"), (GLenum, "access")]), F(GLboolean, "glUnmapBufferARB", [(GLenum, "target")]), @@ -3046,9 +3046,9 @@ def extended_functions(Function): F(Void, "glDeleteQueriesARB", [(GLsizei, "n"), (OpaquePointer(Const(GLuint)), "ids")]), F(Void, "glEndQueryARB", [(GLenum, "target")]), F(Void, "glGenQueriesARB", [(GLsizei, "n"), (OpaquePointer(GLuint), "ids")]), - F(Void, "glGetQueryObjectivARB", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetQueryObjectuivARB", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLuint), "params")]), - F(Void, "glGetQueryivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetQueryObjectivARB", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetQueryObjectuivARB", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLuint), "params")], sideeffects=False), + F(Void, "glGetQueryivARB", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsQueryARB", [(GLuint, "id")]), F(Void, "glAttachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "obj")]), F(Void, "glCompileShaderARB", [(GLhandleARB, "shader")]), @@ -3056,16 +3056,16 @@ def extended_functions(Function): F(GLhandleARB, "glCreateShaderObjectARB", [(GLenum, "shaderType")]), F(Void, "glDeleteObjectARB", [(GLhandleARB, "obj")]), F(Void, "glDetachObjectARB", [(GLhandleARB, "containerObj"), (GLhandleARB, "attachedObj")]), - F(Void, "glGetActiveUniformARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLint), "size"), (OpaquePointer(GLenum), "type"), (OpaquePointer(GLcharARB), "name")]), - F(Void, "glGetAttachedObjectsARB", [(GLhandleARB, "containerObj"), (GLsizei, "maxLength"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLhandleARB), "infoLog")]), - F(GLhandleARB, "glGetHandleARB", [(GLenum, "pname")]), - F(Void, "glGetInfoLogARB", [(GLhandleARB, "obj"), (GLsizei, "maxLength"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLcharARB), "infoLog")]), - F(Void, "glGetObjectParameterfvARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetObjectParameterivARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetShaderSourceARB", [(GLhandleARB, "shader"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLcharARB), "source")]), - F(GLint, "glGetUniformLocationARB", [(GLhandleARB, "program"), (OpaquePointer(Const(GLcharARB)), "name")]), - F(Void, "glGetUniformfvARB", [(GLhandleARB, "program"), (GLint, "location"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetUniformivARB", [(GLhandleARB, "program"), (GLint, "location"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetActiveUniformARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLint), "size"), (OpaquePointer(GLenum), "type"), (OpaquePointer(GLcharARB), "name")], sideeffects=False), + F(Void, "glGetAttachedObjectsARB", [(GLhandleARB, "containerObj"), (GLsizei, "maxLength"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLhandleARB), "infoLog")], sideeffects=False), + F(GLhandleARB, "glGetHandleARB", [(GLenum, "pname")], sideeffects=False), + F(Void, "glGetInfoLogARB", [(GLhandleARB, "obj"), (GLsizei, "maxLength"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLcharARB), "infoLog")], sideeffects=False), + F(Void, "glGetObjectParameterfvARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetObjectParameterivARB", [(GLhandleARB, "obj"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetShaderSourceARB", [(GLhandleARB, "shader"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLcharARB), "source")], sideeffects=False), + F(GLint, "glGetUniformLocationARB", [(GLhandleARB, "program"), (OpaquePointer(Const(GLcharARB)), "name")], sideeffects=False), + F(Void, "glGetUniformfvARB", [(GLhandleARB, "program"), (GLint, "location"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetUniformivARB", [(GLhandleARB, "program"), (GLint, "location"), (OpaquePointer(GLint), "params")], sideeffects=False), F(Void, "glLinkProgramARB", [(GLhandleARB, "program")]), F(Void, "glShaderSourceARB", [(GLhandleARB, "shader"), (GLsizei, "count"), (Array(GLstringARB, "count"), "string"), (Array(Const(GLint), "count"), "length")]), # FIXME F(Void, "glUniform1fARB", [(GLint, "location"), (GLfloat, "v0")]), @@ -3090,13 +3090,13 @@ def extended_functions(Function): F(Void, "glUseProgramObjectARB", [(GLhandleARB, "program")]), F(Void, "glValidateProgramARB", [(GLhandleARB, "program")]), F(Void, "glBindAttribLocationARB", [(GLhandleARB, "program"), (GLuint, "index"), (OpaquePointer(Const(GLcharARB)), "name")]), - F(Void, "glGetActiveAttribARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLint), "size"), (OpaquePointer(GLenum), "type"), (OpaquePointer(GLcharARB), "name")]), - F(GLint, "glGetAttribLocationARB", [(GLhandleARB, "program"), (OpaquePointer(Const(GLcharARB)), "name")]), + F(Void, "glGetActiveAttribARB", [(GLhandleARB, "program"), (GLuint, "index"), (GLsizei, "bufSize"), (OpaquePointer(GLsizei), "length"), (OpaquePointer(GLint), "size"), (OpaquePointer(GLenum), "type"), (OpaquePointer(GLcharARB), "name")], sideeffects=False), + F(GLint, "glGetAttribLocationARB", [(GLhandleARB, "program"), (OpaquePointer(Const(GLcharARB)), "name")], sideeffects=False), F(Void, "glDrawBuffersARB", [(GLsizei, "n"), (OpaquePointer(Const(GLenum)), "bufs")]), F(Void, "glRenderbufferStorageMultisample", [(GLenum, "target"), (GLsizei, "samples"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), F(Void, "glPolygonOffsetEXT", [(GLfloat, "factor"), (GLfloat, "bias")]), - #F(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - #F(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), (OpaquePointer(GLint), "params")]), + #F(Void, "glGetPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + #F(Void, "glGetPixelTexGenParameterivSGIS", [(GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), #F(Void, "glPixelTexGenParameterfSGIS", [(GLenum, "pname"), (GLfloat, "param")]), #F(Void, "glPixelTexGenParameterfvSGIS", [(GLenum, "pname"), (OpaquePointer(Const(GLfloat)), "params")]), #F(Void, "glPixelTexGenParameteriSGIS", [(GLenum, "pname"), (GLint, "param")]), @@ -3150,12 +3150,12 @@ def extended_functions(Function): F(Void, "glCombinerParameteriNV", [(GLenum, "pname"), (GLint, "param")]), F(Void, "glCombinerParameterivNV", [(GLenum, "pname"), (OpaquePointer(Const(GLint)), "params")]), F(Void, "glFinalCombinerInputNV", [(GLenum, "variable"), (GLenum, "input"), (GLenum, "mapping"), (GLenum, "componentUsage")]), - F(Void, "glGetCombinerInputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetCombinerInputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetCombinerOutputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetCombinerOutputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetFinalCombinerInputParameterfvNV", [(GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetFinalCombinerInputParameterivNV", [(GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetCombinerInputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetCombinerInputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetCombinerOutputParameterfvNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetCombinerOutputParameterivNV", [(GLenum, "stage"), (GLenum, "portion"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetFinalCombinerInputParameterfvNV", [(GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetFinalCombinerInputParameterivNV", [(GLenum, "variable"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(Void, "glResizeBuffersMESA", []), F(Void, "glWindowPos2dMESA", [(GLdouble, "x"), (GLdouble, "y")]), F(Void, "glWindowPos2dvMESA", [(Array(Const(GLdouble), "2"), "v")]), @@ -3186,7 +3186,7 @@ def extended_functions(Function): F(Void, "glDeleteFencesNV", [(GLsizei, "n"), (OpaquePointer(Const(GLuint)), "fences")]), F(Void, "glFinishFenceNV", [(GLuint, "fence")]), F(Void, "glGenFencesNV", [(GLsizei, "n"), (OpaquePointer(GLuint), "fences")]), - F(Void, "glGetFenceivNV", [(GLuint, "fence"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetFenceivNV", [(GLuint, "fence"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsFenceNV", [(GLuint, "fence")]), F(Void, "glSetFenceNV", [(GLuint, "fence"), (GLenum, "condition")]), F(GLboolean, "glTestFenceNV", [(GLuint, "fence")]), @@ -3195,15 +3195,15 @@ def extended_functions(Function): F(Void, "glDeleteProgramsNV", [(GLsizei, "n"), (OpaquePointer(Const(GLuint)), "programs")]), F(Void, "glExecuteProgramNV", [(GLenum, "target"), (GLuint, "id"), (OpaquePointer(Const(GLfloat)), "params")]), F(Void, "glGenProgramsNV", [(GLsizei, "n"), (OpaquePointer(GLuint), "programs")]), - F(Void, "glGetProgramParameterdvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetProgramParameterfvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetProgramStringNV", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLubyte), "program")]), - F(Void, "glGetProgramivNV", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetTrackMatrixivNV", [(GLenum, "target"), (GLuint, "address"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetVertexAttribPointervNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(OpaquePointer(GLvoid)), "pointer")]), - F(Void, "glGetVertexAttribdvNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetVertexAttribfvNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")]), - F(Void, "glGetVertexAttribivNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetProgramParameterdvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetProgramParameterfvNV", [(GLenum, "target"), (GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetProgramStringNV", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLubyte), "program")], sideeffects=False), + F(Void, "glGetProgramivNV", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetTrackMatrixivNV", [(GLenum, "target"), (GLuint, "address"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetVertexAttribPointervNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(OpaquePointer(GLvoid)), "pointer")], sideeffects=False), + F(Void, "glGetVertexAttribdvNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetVertexAttribfvNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLfloat), "params")], sideeffects=False), + F(Void, "glGetVertexAttribivNV", [(GLuint, "index"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsProgramNV", [(GLuint, "program")]), F(Void, "glLoadProgramNV", [(GLenum, "target"), (GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "program")]), F(Void, "glProgramParameters4dvNV", [(GLenum, "target"), (GLuint, "index"), (GLuint, "num"), (OpaquePointer(Const(GLdouble)), "params")]), @@ -3250,8 +3250,8 @@ def extended_functions(Function): F(Void, "glVertexAttribs4fvNV", [(GLuint, "index"), (GLsizei, "n"), (Array(Const(GLfloat), "4"), "v")]), F(Void, "glVertexAttribs4svNV", [(GLuint, "index"), (GLsizei, "n"), (Array(Const(GLshort), "4"), "v")]), F(Void, "glVertexAttribs4ubvNV", [(GLuint, "index"), (GLsizei, "n"), (Array(Const(GLubyte), "4"), "v")]), - F(Void, "glGetTexBumpParameterfvATI", [(GLenum, "pname"), (OpaquePointer(GLfloat), "param")]), - F(Void, "glGetTexBumpParameterivATI", [(GLenum, "pname"), (OpaquePointer(GLint), "param")]), + F(Void, "glGetTexBumpParameterfvATI", [(GLenum, "pname"), (OpaquePointer(GLfloat), "param")], sideeffects=False), + F(Void, "glGetTexBumpParameterivATI", [(GLenum, "pname"), (OpaquePointer(GLint), "param")], sideeffects=False), F(Void, "glTexBumpParameterfvATI", [(GLenum, "pname"), (OpaquePointer(Const(GLfloat)), "param")]), F(Void, "glTexBumpParameterivATI", [(GLenum, "pname"), (OpaquePointer(Const(GLint)), "param")]), F(Void, "glAlphaFragmentOp1ATI", [(GLenum, "op"), (GLuint, "dst"), (GLuint, "dstMod"), (GLuint, "arg1"), (GLuint, "arg1Rep"), (GLuint, "arg1Mod")]), @@ -3275,8 +3275,8 @@ def extended_functions(Function): F(Void, "glDeleteVertexArraysAPPLE", [(GLsizei, "n"), (OpaquePointer(Const(GLuint)), "arrays")]), F(Void, "glGenVertexArraysAPPLE", [(GLsizei, "n"), (OpaquePointer(GLuint), "arrays")]), F(GLboolean, "glIsVertexArrayAPPLE", [(GLuint, "array")]), - F(Void, "glGetProgramNamedParameterdvNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (OpaquePointer(GLdouble), "params")]), - F(Void, "glGetProgramNamedParameterfvNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (OpaquePointer(GLfloat), "params")]), + F(Void, "glGetProgramNamedParameterdvNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (OpaquePointer(GLdouble), "params")], sideeffects=False), + F(Void, "glGetProgramNamedParameterfvNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (OpaquePointer(GLfloat), "params")], sideeffects=False), F(Void, "glProgramNamedParameter4dNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (GLdouble, "x"), (GLdouble, "y"), (GLdouble, "z"), (GLdouble, "w")]), F(Void, "glProgramNamedParameter4dvNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (Array(Const(GLdouble), "4"), "v")]), F(Void, "glProgramNamedParameter4fNV", [(GLuint, "id"), (GLsizei, "len"), (OpaquePointer(Const(GLubyte)), "name"), (GLfloat, "x"), (GLfloat, "y"), (GLfloat, "z"), (GLfloat, "w")]), @@ -3295,8 +3295,8 @@ def extended_functions(Function): F(Void, "glGenFramebuffersEXT", [(GLsizei, "n"), (OpaquePointer(GLuint), "framebuffers")]), F(Void, "glGenRenderbuffersEXT", [(GLsizei, "n"), (OpaquePointer(GLuint), "renderbuffers")]), F(Void, "glGenerateMipmapEXT", [(GLenum, "target")]), - F(Void, "glGetFramebufferAttachmentParameterivEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), - F(Void, "glGetRenderbufferParameterivEXT", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")]), + F(Void, "glGetFramebufferAttachmentParameterivEXT", [(GLenum, "target"), (GLenum, "attachment"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), + F(Void, "glGetRenderbufferParameterivEXT", [(GLenum, "target"), (GLenum, "pname"), (OpaquePointer(GLint), "params")], sideeffects=False), F(GLboolean, "glIsFramebufferEXT", [(GLuint, "framebuffer")]), F(GLboolean, "glIsRenderbufferEXT", [(GLuint, "renderbuffer")]), F(Void, "glRenderbufferStorageEXT", [(GLenum, "target"), (GLenum, "internalformat"), (GLsizei, "width"), (GLsizei, "height")]), @@ -3305,6 +3305,6 @@ def extended_functions(Function): F(Void, "glStencilFuncSeparateATI", [(GLenum, "frontfunc"), (GLenum, "backfunc"), (GLint, "ref"), (GLuint, "mask")]), F(Void, "glProgramEnvParameters4fvEXT", [(GLenum, "target"), (GLuint, "index"), (GLsizei, "count"), (OpaquePointer(Const(GLfloat)), "params")]), F(Void, "glProgramLocalParameters4fvEXT", [(GLenum, "target"), (GLuint, "index"), (GLsizei, "count"), (OpaquePointer(Const(GLfloat)), "params")]), - F(Void, "glGetQueryObjecti64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint64EXT), "params")]), - F(Void, "glGetQueryObjectui64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLuint64EXT), "params")]), + F(Void, "glGetQueryObjecti64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLint64EXT), "params")], sideeffects=False), + F(Void, "glGetQueryObjectui64vEXT", [(GLuint, "id"), (GLenum, "pname"), (OpaquePointer(GLuint64EXT), "params")], sideeffects=False), ] diff --git a/glretrace.py b/glretrace.py index 821b256..2c0122b 100644 --- a/glretrace.py +++ b/glretrace.py @@ -80,37 +80,47 @@ class ValueExtractor(base.Visitor): def retrace_function(function): print 'static void retrace_%s(Trace::Call &call) {' % function.name - if not function.name.startswith('glX'): - success = True - for arg in function.args: - arg.type = ConstRemover().visit(arg.type) - print ' %s %s;' % (arg.type, arg.name) - rvalue = 'call.arg("%s")' % (arg.name,) - lvalue = arg.name - try: - ValueExtractor().visit(arg.type, lvalue, rvalue) - except NotImplementedError: - success = False - print ' %s = 0; // FIXME' % arg.name - if not success: - print ' std::cerr << "warning: unsupported call %s\\n";' % function.name - print ' return;' - arg_names = ", ".join([arg.name for arg in function.args]) - print ' %s(%s);' % (function.name, arg_names) + success = True + for arg in function.args: + arg.type = ConstRemover().visit(arg.type) + print ' %s %s;' % (arg.type, arg.name) + rvalue = 'call.arg("%s")' % (arg.name,) + lvalue = arg.name + try: + ValueExtractor().visit(arg.type, lvalue, rvalue) + except NotImplementedError: + success = False + print ' %s = 0; // FIXME' % arg.name + if not success: + print ' std::cerr << "warning: unsupported call %s\\n";' % function.name + print ' return;' + arg_names = ", ".join([arg.name for arg in function.args]) + print ' %s(%s);' % (function.name, arg_names) print '}' print def retrace_functions(functions): for function in functions: - retrace_function(function) + if function.sideeffects: + retrace_function(function) print 'static bool retrace_call(Trace::Call &call) {' for function in functions: - print ' if (call.name == "%s") {' % function.name - print ' retrace_%s(call);' % function.name - print ' return true;' - print ' }' + if not function.sideeffects: + print ' if (call.name == "%s") {' % function.name + print ' return true;' + print ' }' + print + print ' std::cout << call;' + print ' std::cout.flush();' + print + for function in functions: + if function.sideeffects: + print ' if (call.name == "%s") {' % function.name + print ' retrace_%s(call);' % function.name + print ' return true;' + print ' }' print ' std::cerr << "warning: unsupported call " << call.name << "\\n";' print ' return false;' print '}' @@ -135,8 +145,6 @@ if __name__ == '__main__': class Retracer : public Trace::Parser { void handle_call(Trace::Call &call) { - std::cout << call; - std::cout.flush(); retrace_call(call); } }; diff --git a/glx.py b/glx.py index 2335254..d8884b1 100644 --- a/glx.py +++ b/glx.py @@ -65,8 +65,8 @@ libgl.functions.append(glXgetprocaddress) class GlxFunction(Function): - def __init__(self, type, name, args, call = '', fail = None): - Function.__init__(self, type, name, args, call=call, fail=fail) + def __init__(self, type, name, args, call = '', **kwargs): + Function.__init__(self, type, name, args, call=call, **kwargs) def get_true_pointer(self): ptype = self.pointer_type() diff --git a/opengl32.py b/opengl32.py index ceb5ccc..d3fd670 100644 --- a/opengl32.py +++ b/opengl32.py @@ -136,12 +136,12 @@ opengl32.functions += [ DllFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]), DllFunction(HGLRC, "wglCreateLayerContext", [(HDC, "hdc"), (Int, "iLayerPlane")]), DllFunction(BOOL, "wglDeleteContext", [(HGLRC, "hglrc")]), - DllFunction(HGLRC, "wglGetCurrentContext", []), - DllFunction(HDC, "wglGetCurrentDC", []), - DllFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")]), + DllFunction(HGLRC, "wglGetCurrentContext", [], sideeffects=False), + DllFunction(HDC, "wglGetCurrentDC", [], sideeffects=False), + DllFunction(PROC, "wglGetDefaultProcAddress", [(LPCSTR, "lpszProc")], sideeffects=False), DllFunction(Int, "wglChoosePixelFormat", [(HDC, "hdc"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), DllFunction(Int, "wglDescribePixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (UINT, "nBytes"), Out(Pointer(PIXELFORMATDESCRIPTOR), "ppfd")]), - DllFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")]), + DllFunction(Int, "wglGetPixelFormat", [(HDC, "hdc")], sideeffects=False), DllFunction(BOOL, "wglSetPixelFormat", [(HDC, "hdc"), (Int, "iPixelFormat"), (Pointer(Const(PIXELFORMATDESCRIPTOR)), "ppfd")]), DllFunction(BOOL, "wglMakeCurrent", [(HDC, "hdc"), (HGLRC, "hglrc")]), DllFunction(BOOL, "wglShareLists", [(HGLRC, "hglrc1"), (HGLRC, "hglrc2")]), @@ -152,7 +152,7 @@ opengl32.functions += [ DllFunction(BOOL, "wglUseFontOutlinesW", [(HDC, "hdc"), (DWORD, "first"), (DWORD, "count"), (DWORD, "listBase"), (FLOAT, "deviation"), (FLOAT, "extrusion"), (Int, "format"), (LPGLYPHMETRICSFLOAT, "lpgmf")]), DllFunction(BOOL , "wglDescribeLayerPlane", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nBytes"), Out(Pointer(LAYERPLANEDESCRIPTOR), "plpd")]), DllFunction(Int , "wglSetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (Array(Const(COLORREF), "cEntries"), "pcr")]), - DllFunction(Int , "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")]), + DllFunction(Int , "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), Out(Array(COLORREF, "cEntries"), "pcr")], sideeffects=False), DllFunction(BOOL , "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]), DllFunction(BOOL , "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]), DllFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Array(Const(WGLSWAP), "n"), "ps")]), @@ -161,8 +161,8 @@ opengl32.functions += [ class WglGetProcAddressFunction(DllFunction): - def __init__(self, type, name, args): - DllFunction.__init__(self, type, name, args) + def __init__(self, type, name, args **kwargs): + DllFunction.__init__(self, type, name, args **kwargs) self.functions = [] def wrap_decl(self): @@ -252,22 +252,22 @@ wglgetprocaddress.functions += extended_functions(WglFunction) wglgetprocaddress.functions += [ # WGL_ARB_extensions_string - WglFunction(Const(String), "wglGetExtensionsStringARB", [(HDC, "hdc")]), + WglFunction(Const(String), "wglGetExtensionsStringARB", [(HDC, "hdc")], sideeffects=False), # WGL_ARB_pbuffer WglFunction(HPBUFFERARB, "wglCreatePbufferARB", [(HDC, "hDC"), (Int, "iPixelFormat"), (Int, "iWidth"), (Int, "iHeight"), (Pointer(Const(Int)), "piAttribList")]), - WglFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")]), + WglFunction(HDC, "wglGetPbufferDCARB", [(HPBUFFERARB, "hPbuffer")], sideeffects=False), WglFunction(Int, "wglReleasePbufferDCARB", [(HPBUFFERARB, "hPbuffer"), (HDC, "hDC")]), WglFunction(BOOL, "wglDestroyPbufferARB", [(HPBUFFERARB, "hPbuffer")]), WglFunction(BOOL, "wglQueryPbufferARB", [(HPBUFFERARB, "hPbuffer"), (Int, "iAttribute"), Out(Pointer(Int), "piValue")]), # WGL_ARB_pixel_format - WglFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")]), - WglFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")]), + WglFunction(BOOL, "wglGetPixelFormatAttribivARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), + WglFunction(BOOL, "wglGetPixelFormatAttribfvARB", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), WglFunction(BOOL, "wglChoosePixelFormatARB", [(HDC, "hdc"), (Pointer(Const(Int)), "piAttribIList"), (Pointer(Const(FLOAT)), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "nMaxFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), # WGL_EXT_extensions_string - WglFunction(Const(String), "wglGetExtensionsStringEXT", []), + WglFunction(Const(String), "wglGetExtensionsStringEXT", [], sideeffects=False), # WGL_EXT_pixel_format - WglFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")]), - WglFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")]), + WglFunction(BOOL, "wglGetPixelFormatAttribivEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(Int, "nAttributes"), "piValues")], sideeffects=False), + WglFunction(BOOL, "wglGetPixelFormatAttribfvEXT", [(HDC, "hdc"), (Int, "iPixelFormat"), (Int, "iLayerPlane"), (UINT, "nAttributes"), (Array(attribute, "nAttributes"), "piAttributes"), Out(Array(FLOAT, "nAttributes"), "pfValues")], sideeffects=False), WglFunction(BOOL, "wglChoosePixelFormatEXT", [(HDC, "hdc"), (Pointer(Const(Int)), "piAttribIList"), (Pointer(Const(FLOAT)), "pfAttribFList"), (UINT, "nMaxFormats"), Out(Array(Int, "nMaxFormats"), "piFormats"), Out(Pointer(UINT), "nNumFormats")]), ]