File: openvr_capi.cpp.py

package info (click to toggle)
openvr 2.12.1~ds1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 9,860 kB
  • sloc: cpp: 15,143; cs: 8,136; ansic: 3,100; python: 1,742; makefile: 8
file content (93 lines) | stat: -rwxr-xr-x 2,088 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
print ("""//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: This is a flattened version of the OpenVR_API interfaces.
// This file is auto-generated, do not edit it.
//
//=============================================================================
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <ShellAPI.h>
#endif

#if defined(OSX)
#include <sys/syslimits.h>
#include <signal.h>
#define MAX_PATH PATH_MAX
#elif defined(LINUX)
#include <linux/limits.h>
#include <signal.h>
#define MAX_PATH PATH_MAX
#elif defined(WIN32)
#else
#error
#endif

#ifdef POSIX
#include <fcntl.h>
#include <dlfcn.h> // dlopen,dlclose, et al
#include <unistd.h>
#include <stdarg.h>
#define HMODULE void *
#define GetProcAddress dlsym
#define OutputDebugString( pchMsg ) fputs( pchMsg, stderr )
#define _strnicmp strncasecmp
//#include "../../common/linuxhelpers_nodeps.h"
#endif

#ifdef OSX
#include <sys/sysctl.h>
#endif

#include <stdlib.h>
#include <assert.h>

#include "openvr.h"
#include "ivrsystem.h"
#include "ivrchaperone.h"
#include "ivrchaperonesetup.h"
#include "ivrcompositor.h"
#include "ivroverlay.h"
#include "ivrrendermodels.h"
#include "ivrnotifications.h"
#include "ivrblockqueue.h"

#include "../vrclient/interface_adapters_client.h"
#include "_dynamic_openvr_api_flat.h"

class FnTableRegistration
{
public:
	FnTableRegistration( const char *pchInterfaceName, void *pInterface )
	{
		char buffer[255];
		sprintf(buffer, "FnTable:%s", pchInterfaceName);
		m_pInterfaceRegistration = new GenericInterfaceRegistration( buffer, pInterface );
	}
	~FnTableRegistration()
	{
		delete m_pInterfaceRegistration;
	}
private:
	GenericInterfaceRegistration *m_pInterfaceRegistration;
};

""")


import json
import sys

if len(sys.argv) != 2:
	sys.exit(-1);
json_path = sys.argv[1]

with open(json_path) as data_file:
	data = json.load(data_file)

import api_shared
api_shared.outputfntablefuncs('vr', data)
api_shared.outputfntabledecls('vr', data)
api_shared.outputfntableinit('vr', data)
api_shared.outputfntableaccess('vr', data)