Пример #1
0
def MakeNormalCall(return_type, func_name, params, counter_init=0):
    counter = counter_init
    copy_of_params = params[:]

    for i in range(0, len(params)):
        (name, type, vecSize) = params[i]
        if apiutil.IsPointer(copy_of_params[i][1]):
            params[i] = ('NULL', type, vecSize)
            copy_of_params[i] = (copy_of_params[i][0], 'void', 0)
            if not "get" in apiutil.Properties(func_name):
                print('\tcrError( "%s needs to be special cased!" );' %
                      func_name)
        else:
            print("\t%s %s = %s;" % (copy_of_params[i][1], name,
                                     ReadData(counter, copy_of_params[i][1])))
        counter += apiutil.sizeof(copy_of_params[i][1])

    if ("get" in apiutil.Properties(func_name)):
        FindReturnPointer(return_type, params)
        FindWritebackPointer(return_type, params)

    if return_type != "void":
        print("\t(void)", end=" ")
    else:
        print("\t", end="")
    print("pState->pDispatchTbl->%s(%s);" %
          (func_name, apiutil.MakeCallStringForDispatcher(params)))
Пример #2
0
""")

for func_name in apiutil.AllSpecials(sys.argv[1] + "/../state_tracker/state"):
    params = apiutil.Parameters(func_name)
    if (apiutil.FindSpecial("server", func_name)
            or "get" in apiutil.Properties(func_name)):
        continue

    wrap = apiutil.GetCategoryWrapper(func_name)
    if wrap:
        print('#if defined(CR_%s)' % wrap)
    print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' %
          (func_name, apiutil.MakeDeclarationStringForDispatcher(params)))
    print('{')
    print('\tcrState%s(%s);' %
          (func_name, apiutil.MakeCallStringForDispatcher(params)))
    print('\tcr_server.head_spu->dispatch_table.%s(%s);' %
          (func_name, apiutil.MakeCallStringForDispatcher(params)))
    print('}')
    if wrap:
        print('#endif')

keys = apiutil.GetDispatchedFunctions(sys.argv[1] + "/APIspec.txt")
for func_name in keys:
    current = 0
    array = ""
    condition = ""
    m = re.search(r"^(Color|Normal)([1234])(ub|b|us|s|ui|i|f|d)$", func_name)
    if m:
        current = 1
        name = m.group(1)[:1].lower() + m.group(1)[1:]
Пример #3
0
for func_name in apiutil.AllSpecials( sys.argv[1]+"/../state_tracker/state" ):
    params = apiutil.Parameters(func_name)
    if (apiutil.FindSpecial( "server", func_name ) or
        "get" in apiutil.Properties(func_name)):
        continue

    wrap = apiutil.GetCategoryWrapper(func_name)
    if wrap:
        print('#if defined(CR_%s)' % wrap)
    print('void SERVER_DISPATCH_APIENTRY crServerDispatch%s(%s)' % ( func_name, apiutil.MakeDeclarationStringForDispatcher( params ) ))
    print('{')
    if len(params) == 0:
        print('\tcrState%s(&cr_server.StateTracker);' % (func_name))
    else:
        print('\tcrState%s(&cr_server.StateTracker, %s);' % (func_name, apiutil.MakeCallStringForDispatcher( params ) ))
    print('\tcr_server.head_spu->dispatch_table.%s(%s);' % (func_name, apiutil.MakeCallStringForDispatcher( params ) ))
    print('}')
    if wrap:
        print('#endif')


keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
for func_name in keys:
    current = 0
    array = ""
    condition = ""
    m = re.search( r"^(Color|Normal)([1234])(ub|b|us|s|ui|i|f|d)$", func_name )
    if m :
        current = 1
        name = m.group(1)[:1].lower() + m.group(1)[1:]