From b26ab2f069c0fee0caeb6fc7e9eff24874c91945 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 5 Sep 2024 16:08:38 +0200 Subject: [PATCH] [client,common] extended parser --- client/common/client.c | 14 ++++++++++++-- include/freerdp/client.h | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/client/common/client.c b/client/common/client.c index 4742ab30f..55a6d9a34 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -278,6 +278,16 @@ out_error: int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, char** argv, BOOL allowUnknown) + +{ + return freerdp_client_settings_parse_command_line_ex(settings, argc, argv, allowUnknown, NULL, + 0, NULL, NULL); +} + +int freerdp_client_settings_parse_command_line_ex( + rdpSettings* settings, int argc, char** argv, BOOL allowUnknown, COMMAND_LINE_ARGUMENT_A* args, + size_t count, int (*handle_option)(const COMMAND_LINE_ARGUMENT* arg, void* custom), + void* handle_userdata) { int status = 0; @@ -287,8 +297,8 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, if (!argv) return -1; - status = - freerdp_client_settings_parse_command_line_arguments(settings, argc, argv, allowUnknown); + status = freerdp_client_settings_parse_command_line_arguments_ex( + settings, argc, argv, allowUnknown, args, count, handle_option, handle_userdata); if (status < 0) return status; diff --git a/include/freerdp/client.h b/include/freerdp/client.h index d30c417ba..0cc8e1ab9 100644 --- a/include/freerdp/client.h +++ b/include/freerdp/client.h @@ -20,6 +20,8 @@ #ifndef FREERDP_CLIENT_H #define FREERDP_CLIENT_H +#include + #include #include #include @@ -152,6 +154,12 @@ extern "C" FREERDP_API int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc, char** argv, BOOL allowUnknown); + FREERDP_API int freerdp_client_settings_parse_command_line_ex( + rdpSettings* settings, int argc, char** argv, BOOL allowUnknown, + COMMAND_LINE_ARGUMENT_A* args, size_t count, + int (*handle_option)(const COMMAND_LINE_ARGUMENT* arg, void* custom), + void* handle_userdata); + FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings, const char* filename); FREERDP_API int freerdp_client_settings_parse_connection_file_buffer(rdpSettings* settings,