summaryrefslogtreecommitdiff
path: root/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py
blob: 9ac9895a6299259d6273068b595ff50d89ea361c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.

import sys

import apiutil

apiutil.CopyrightC()

print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_dispatch_header.py SCRIPT */
#ifndef SERVER_DISPATCH_HEADER
#define SERVER_DISPATCH_HEADER

#ifdef WINDOWS
#define SERVER_DISPATCH_APIENTRY __stdcall
#else
#define SERVER_DISPATCH_APIENTRY
#endif

#include "chromium.h"
#include "state/cr_statetypes.h"

#if defined(__cplusplus)
extern "C" {
#endif

"""

keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")

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

        params = apiutil.Parameters(func_name)
        return_type = apiutil.ReturnType(func_name)
        
        print '%s SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString( params ))

print """
#if defined(__cplusplus)
}
#endif

#endif /* SERVER_DISPATCH_HEADER */
"""