Beispiel #1
0
#else
#define STATE_APIENTRY
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define STATE_UNUSED(x) ((void)x)""")

for func_name in apiutil.AllSpecials("state"):
    return_type = apiutil.ReturnType(func_name)
    params = apiutil.Parameters(func_name)
    print('DECLEXPORT(%s) STATE_APIENTRY crState%s(%s);' %
          (return_type, func_name,
           apiutil.MakeDeclarationStringForDispatcher(params)))

for func_name in apiutil.AllSpecials("state_feedback"):
    return_type = apiutil.ReturnType(func_name)
    params = apiutil.Parameters(func_name)
    print('DECLEXPORT(%s) STATE_APIENTRY crStateFeedback%s(%s);' %
          (return_type, func_name,
           apiutil.MakeDeclarationStringForDispatcher(params)))

for func_name in apiutil.AllSpecials("state_select"):
    return_type = apiutil.ReturnType(func_name)
    params = apiutil.Parameters(func_name)
    print('DECLEXPORT(%s) STATE_APIENTRY crStateSelect%s(%s);' %
          (return_type, func_name,
           apiutil.MakeDeclarationStringForDispatcher(params)))
Beispiel #2
0
#include "cr_unpack.h"

CRCurrentStatePointers crServerCurrent;
""")

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)
Beispiel #3
0
#include "cr_unpack.h"

CRCurrentStatePointers crServerCurrent;
""")


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 = ""