2 * FreeRDP: A Remote Desktop Protocol client.
5 * Copyright 2011 Vic Lee
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 __ARGS_UTILS_H
21 #define __ARGS_UTILS_H
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/settings.h>
28 typedef enum _FREERDP_ARGS_PARSE_RESULT
30 FREERDP_ARGS_PARSE_FAILURE = -1,
31 FREERDP_ARGS_PARSE_HELP = -2,
32 FREERDP_ARGS_PARSE_VERSION = -3,
33 } FREERDP_ARGS_PARSE_RESULT;
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);
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);
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);
48 #endif /* __ARGS_UTILS_H */