当前位置: 首页>>代码示例>>Python>>正文


Python API.add_api方法代码示例

本文整理汇总了Python中specs.stdapi.API.add_api方法的典型用法代码示例。如果您正苦于以下问题:Python API.add_api方法的具体用法?Python API.add_api怎么用?Python API.add_api使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在specs.stdapi.API的用法示例。


在下文中一共展示了API.add_api方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __unwrap_proc_addr

# 需要导入模块: from specs.stdapi import API [as 别名]
# 或者: from specs.stdapi.API import add_api [as 别名]
    print "#include <dlfcn.h>"
    print
    print '#include "trace_writer_local.hpp"'
    print
    print "// To validate our prototypes"
    print "#define GL_GLEXT_PROTOTYPES"
    print "#define EGL_EGLEXT_PROTOTYPES"
    print
    print '#include "glproc.hpp"'
    print '#include "glsize.hpp"'
    print
    print "static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr);"
    print

    api = API()
    api.add_api(eglapi)
    api.add_api(glapi)
    api.add_api(glesapi)
    tracer = EglTracer()
    tracer.trace_api(api)

    print "static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr) {"
    print "    if (!procPtr) {"
    print "        return procPtr;"
    print "    }"
    for f in api.functions:
        ptype = function_pointer_type(f)
        pvalue = function_pointer_value(f)
        print '    if (!strcmp("%s", procname)) {' % f.name
        print "        %s = (%s)procPtr;" % (pvalue, ptype)
        print "        return (__eglMustCastToProperFunctionPointerType)&%s;" % (f.name,)
开发者ID:kalyankondapally,项目名称:apitrace,代码行数:33,代码来源:egltrace.py

示例2: handle_default

# 需要导入模块: from specs.stdapi import API [as 别名]
# 或者: from specs.stdapi.API import add_api [as 别名]
        
            def handle_default():
                print '    os::log("apitrace: warning: unknown function \\"%s\\"\\n", lpszProc);'

            string_switch('lpszProc', func_dict.keys(), handle_case, handle_default)
            print '    }'


if __name__ == '__main__':
    print
    print '#define _GDI32_'
    print
    print '#include <string.h>'
    print '#include <windows.h>'
    print
    print '#include "trace_writer_local.hpp"'
    print '#include "os.hpp"'
    print
    print '// To validate our prototypes'
    print '#define GL_GLEXT_PROTOTYPES'
    print '#define WGL_GLXEXT_PROTOTYPES'
    print
    print '#include "glproc.hpp"'
    print '#include "glsize.hpp"'
    print
    api = API()
    api.add_api(glapi)
    api.add_api(wglapi)
    tracer = WglTracer()
    tracer.trace_api(api)
开发者ID:kalyankondapally,项目名称:apitrace,代码行数:32,代码来源:wgltrace.py

示例3: API

# 需要导入模块: from specs.stdapi import API [as 别名]
# 或者: from specs.stdapi.API import add_api [as 别名]
    print '#ifndef _GNU_SOURCE'
    print '#define _GNU_SOURCE // for dladdr'
    print '#endif'
    print '#include <dlfcn.h>'
    print
    print '#include "trace_writer.hpp"'
    print
    print '// To validate our prototypes'
    print '#define GL_GLEXT_PROTOTYPES'
    print
    print '#include "glproc.hpp"'
    print '#include "glsize.hpp"'
    print

    api = API()
    api.add_api(cglapi)
    api.add_api(glapi)
    tracer = CglTracer()
    tracer.trace_api(api)

    print r'''


/*
 * Path to the true OpenGL framework
 */
static const char *libgl_filename = "/System/Library/Frameworks/OpenGL.framework/OpenGL";


/*
 * Handle to the true OpenGL framework.
开发者ID:kanru,项目名称:apitrace,代码行数:33,代码来源:cgltrace.py

示例4: __unwrap_proc_addr

# 需要导入模块: from specs.stdapi import API [as 别名]
# 或者: from specs.stdapi.API import add_api [as 别名]
    print '#include <dlfcn.h>'
    print
    print '#include "trace_writer_local.hpp"'
    print
    print '// To validate our prototypes'
    print '#define GL_GLEXT_PROTOTYPES'
    print '#define GLX_GLXEXT_PROTOTYPES'
    print
    print '#include "glproc.hpp"'
    print '#include "glsize.hpp"'
    print
    print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);'
    print

    api = API()
    api.add_api(glxapi)
    api.add_api(glapi)
    tracer = GlxTracer()
    tracer.trace_api(api)

    print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr) {'
    print '    if (!procPtr) {'
    print '        return procPtr;'
    print '    }'
    for f in api.functions:
        ptype = function_pointer_type(f)
        pvalue = function_pointer_value(f)
        print '    if (strcmp("%s", (const char *)procName) == 0) {' % f.name
        print '        %s = (%s)procPtr;' % (pvalue, ptype)
        print '        return (__GLXextFuncPtr)&%s;' % (f.name,)
        print '    }'
开发者ID:kalyankondapally,项目名称:apitrace,代码行数:33,代码来源:glxtrace.py


注:本文中的specs.stdapi.API.add_api方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。