2 * FreeRDP: A Remote Desktop Protocol Implementation
5 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef FREERDP_CLIENT_H
21 #define FREERDP_CLIENT_H
23 #include <freerdp/api.h>
24 #include <freerdp/freerdp.h>
34 typedef BOOL (*pRdpGlobalInit)(void);
35 typedef void (*pRdpGlobalUninit)(void);
37 typedef int (*pRdpClientNew)(freerdp* instance, rdpContext* context);
38 typedef void (*pRdpClientFree)(freerdp* instance, rdpContext* context);
40 typedef int (*pRdpClientStart)(rdpContext* context);
41 typedef int (*pRdpClientStop)(rdpContext* context);
43 struct rdp_client_entry_points_v1
48 rdpSettings* settings;
50 pRdpGlobalInit GlobalInit;
51 pRdpGlobalUninit GlobalUninit;
54 pRdpClientNew ClientNew;
55 pRdpClientFree ClientFree;
57 pRdpClientStart ClientStart;
58 pRdpClientStop ClientStop;
61 #define RDP_CLIENT_INTERFACE_VERSION 1
62 #define RDP_CLIENT_ENTRY_POINT_NAME "RdpClientEntry"
64 typedef int (*pRdpClientEntry)(RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
66 /* Common Client Interface */
68 #define DEFINE_RDP_CLIENT_COMMON() \
71 struct rdp_client_context
74 DEFINE_RDP_CLIENT_COMMON();
77 /* Common client functions */
79 FREERDP_API rdpContext* freerdp_client_context_new(RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
80 FREERDP_API void freerdp_client_context_free(rdpContext* context);
82 FREERDP_API int freerdp_client_start(rdpContext* context);
83 FREERDP_API int freerdp_client_stop(rdpContext* context);
85 FREERDP_API freerdp* freerdp_client_get_instance(rdpContext* context);
86 FREERDP_API HANDLE freerdp_client_get_thread(rdpContext* context);
88 FREERDP_API int freerdp_client_settings_parse_command_line(rdpSettings* settings,
89 int argc, char** argv, BOOL allowUnknown);
91 FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const char* filename);
92 FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings, const BYTE* buffer, size_t size);
93 FREERDP_API int freerdp_client_settings_write_connection_file(const rdpSettings* settings, const char* filename, BOOL unicode);
95 FREERDP_API int freerdp_client_settings_parse_assistance_file(rdpSettings* settings, const char* filename);
101 #endif /* FREERDP_CLIENT_H */