forked from PaulStoffregen/X-Plane_Plugin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
linktest.c
131 lines (113 loc) · 3.76 KB
/
linktest.c
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include "TeensyControls.h"
#if IBM
int main(int argc, char **argv) { return 0; }
#else
extern int XPluginStart(char *name, char *sig, char *desc);
extern void XPluginStop(void);
extern void XPluginDisable(void);
extern int XPluginEnable(void);
extern void XPluginReceiveMessage(XPLMPluginID from, long msg, void *param);
int main(int argc, char **argv)
{
char buf[256];
XPLMPluginID id=0;
printf("This program exists only to test if TeensyControls links properly\n");
printf("because missing internal symbols are not errors when linking a\n");
printf("dynamic object. This program is never meant to actually run!\n");
XPluginStart(buf, buf, buf);
XPluginEnable();
XPluginReceiveMessage(id, 0, NULL);
XPluginDisable();
XPluginStop();
return 0;
}
// Unfortunately, this does require creating a dummy version of every XPLM
// function we will call. The initial hassle is worthwhile, since genuinely
// missing symbols at link time would go unreported without linktest.
XPLMWindowID XPLMCreateWindow(int inLeft, int inTop, int inRight, int inBottom,
int inIsVisible, XPLMDrawWindow_f inDrawCallback, XPLMHandleKey_f inKeyCallback,
XPLMHandleMouseClick_f inMouseCallback, void * inRefcon) {
return 0;
}
void XPLMDestroyWindow(XPLMWindowID inWindowID) {
}
void XPLMGetWindowGeometry(XPLMWindowID inWindowID,
int * outLeft, int * outTop, int * outRight, int * outBottom) {
}
void XPLMDrawTranslucentDarkBox(int inLeft, int inTop, int inRight, int inBottom) {
}
void XPLMDrawString(float *inColorRGB, int inXOffset, int inYOffset, char *inChar,
int *inWordWrapWidth, XPLMFontID inFontID) {
}
void XPLMRegisterFlightLoopCallback(XPLMFlightLoop_f inFlightLoop, float inInterval,
void *inRefcon) {
}
float XPLMGetElapsedTime(void) {
return 0.0;
}
XPLMCommandRef XPLMFindCommand(const char *inName) {
return NULL;
}
void XPLMCommandBegin(XPLMCommandRef inCommand) {
}
void XPLMCommandEnd(XPLMCommandRef inCommand) {
}
void XPLMCommandOnce(XPLMCommandRef inCommand) {
}
XPLMDataRef XPLMFindDataRef(const char *inDataRefName) {
return NULL;
}
int XPLMCanWriteDataRef(XPLMDataRef inDataRef) {
return 0;
}
XPLMDataTypeID XPLMGetDataRefTypes(XPLMDataRef inDataRef) {
return 0;
}
int XPLMGetDatai(XPLMDataRef inDataRef) {
return 0;
}
void XPLMSetDatai(XPLMDataRef inDataRef, int inValue) {
}
float XPLMGetDataf(XPLMDataRef inDataRef) {
return 0;
}
void XPLMSetDataf(XPLMDataRef inDataRef, float inValue) {
}
double XPLMGetDatad(XPLMDataRef inDataRef) {
return 0;
}
void XPLMSetDatad(XPLMDataRef inDataRef, double inValue) {
}
int XPLMGetDatavi(XPLMDataRef inDataRef, int *outValues, int inOffset, int inMax) {
return 0;
}
void XPLMSetDatavi(XPLMDataRef inDataRef, int *inValues, int inoffset, int inCount) {
}
int XPLMGetDatavf(XPLMDataRef inDataRef, float *outValues, int inOffset, int inMax) {
return 0;
}
void XPLMSetDatavf(XPLMDataRef inDataRef, float *inValues, int inoffset, int inCount) {
}
int XPLMGetDatab(XPLMDataRef inDataRef, void *outValue /* Can be NULL */, int inOffset, int inMaxBytes) {
return 0;
}
void XPLMSetDatab(XPLMDataRef inDataRef, void *inValue /* Can be NULL */, int inOffset, int inLength) {
}
XPLMMenuID XPLMFindPluginsMenu(void) {
return 0;
}
int XPLMAppendMenuItem(XPLMMenuID inMenu, const char *inItemName,
void *inItemRef, int inForceEnglish) {
return 0;
}
void XPLMCheckMenuItem(XPLMMenuID inMenu, int index, XPLMMenuCheck inCheck) {
}
XPLMMenuID XPLMCreateMenu(const char * inName, XPLMMenuID inParentMenu, int inParentItem, XPLMMenuHandler_f inHandler, void * inMenuRef) {
return 0;
}
void XPLMSetMenuItemName(XPLMMenuID inMenu, int inIndex, const char *inItemName, int inForceEnglish) {
}
float XPLMMeasureString(XPLMFontID inFontID, const char *inChar, int inNumChars) {
return 0.0;
}
#endif