freerdp: fix offset padding for 64-bit architectures
[platform/upstream/freerdp.git] / include / freerdp / freerdp.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * FreeRDP Interface
4  *
5  * Copyright 2009-2011 Jay Sorg
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __FREERDP_H
21 #define __FREERDP_H
22
23 typedef struct rdp_rdp rdpRdp;
24 typedef struct rdp_gdi rdpGdi;
25 typedef struct rdp_rail rdpRail;
26 typedef struct rdp_cache rdpCache;
27 typedef struct rdp_channels rdpChannels;
28 typedef struct rdp_graphics rdpGraphics;
29
30 typedef struct rdp_freerdp freerdp;
31 typedef struct rdp_context rdpContext;
32 typedef struct rdp_freerdp_peer freerdp_peer;
33
34 #include <freerdp/api.h>
35 #include <freerdp/types.h>
36 #include <freerdp/settings.h>
37 #include <freerdp/extension.h>
38
39 #include <freerdp/input.h>
40 #include <freerdp/update.h>
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 typedef void (*pContextNew)(freerdp* instance, rdpContext* context);
47 typedef void (*pContextFree)(freerdp* instance, rdpContext* context);
48
49 typedef boolean (*pPreConnect)(freerdp* instance);
50 typedef boolean (*pPostConnect)(freerdp* instance);
51 typedef boolean (*pAuthenticate)(freerdp* instance, char** username, char** password, char** domain);
52 typedef boolean (*pVerifyCertificate)(freerdp* instance, char* subject, char* issuer, char* fingerprint);
53
54 typedef int (*pSendChannelData)(freerdp* instance, int channelId, uint8* data, int size);
55 typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size);
56
57 struct rdp_context
58 {
59         freerdp* instance;
60         freerdp_peer* peer;
61         uint32 paddingA[16 - 4]; /* offset 64 */
62
63         int argc;
64         char** argv;
65         uint32 paddingB[16 - 3]; /* offset 128 */
66
67         rdpRdp* rdp;
68         rdpGdi* gdi;
69         rdpRail* rail;
70         rdpCache* cache;
71         rdpChannels* channels;
72         rdpGraphics* graphics;
73         uint32 paddingC[32 - 12]; /* offset 256 */
74 };
75
76 struct rdp_freerdp
77 {
78         rdpContext* context;
79         uint32 paddingA[16 - 2]; /* offset 64 */
80
81         rdpInput* input;
82         rdpUpdate* update;
83         rdpSettings* settings;
84         uint32 paddingB[16 - 6]; /* offset 128 */
85
86         size_t context_size;
87         pContextNew ContextNew;
88         pContextFree ContextFree;
89         uint32 paddingC[16 - 6]; /* offset 192 */
90
91         pPreConnect PreConnect;
92         pPostConnect PostConnect;
93         pAuthenticate Authenticate;
94         pVerifyCertificate VerifyCertificate;
95         uint32 paddingD[16 - 8]; /* offset 256 */
96
97         pSendChannelData SendChannelData;
98         pReceiveChannelData ReceiveChannelData;
99         uint32 paddingE[16 - 4]; /* offset 320 */
100 };
101
102 FREERDP_API void freerdp_context_new(freerdp* instance);
103 FREERDP_API void freerdp_context_free(freerdp* instance);
104
105 FREERDP_API boolean freerdp_connect(freerdp* instance);
106 FREERDP_API boolean freerdp_disconnect(freerdp* instance);
107
108 FREERDP_API boolean freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount);
109 FREERDP_API boolean freerdp_check_fds(freerdp* instance);
110
111 FREERDP_API uint32 freerdp_error_info(freerdp* instance);
112
113 FREERDP_API freerdp* freerdp_new();
114 FREERDP_API void freerdp_free(freerdp* instance);
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif