Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / utils / args.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol client.
3  * Arguments Parsing
4  *
5  * Copyright 2011 Vic Lee
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 __ARGS_UTILS_H
21 #define __ARGS_UTILS_H
22
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/settings.h>
26
27
28 typedef enum _FREERDP_ARGS_PARSE_RESULT
29 {
30         FREERDP_ARGS_PARSE_FAILURE = -1,
31         FREERDP_ARGS_PARSE_HELP = -2,
32         FREERDP_ARGS_PARSE_VERSION = -3,
33 } FREERDP_ARGS_PARSE_RESULT;
34
35
36 /* Returns 1 if succeed, otherwise returns zero */
37 typedef int (*ProcessPluginArgs) (rdpSettings* settings, const char* name,
38         RDP_PLUGIN_DATA* plugin_data, void* user_data);
39
40 /* Returns number of arguments processed (1 or 2), otherwise returns zero */
41 typedef int (*ProcessUIArgs) (rdpSettings* settings, const char* opt,
42         const char* val, void* user_data);
43
44 FREERDP_API int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
45         ProcessPluginArgs plugin_callback, void* plugin_user_data,
46         ProcessUIArgs ui_callback, void* ui_user_data);
47
48 #endif /* __ARGS_UTILS_H */