mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[client,cmdling] use a typedef for callback function
typedef freerdp_command_line_handle_option_t to have a common type for callback functions
This commit is contained in:
@@ -295,8 +295,7 @@ int freerdp_client_settings_parse_command_line(rdpSettings* settings, int argc,
|
||||
|
||||
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_A* arg, void* custom),
|
||||
void* handle_userdata)
|
||||
size_t count, freerdp_command_line_handle_option_t handle_option, void* handle_userdata)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
|
||||
@@ -72,9 +72,6 @@
|
||||
#include <freerdp/log.h>
|
||||
#define TAG CLIENT_TAG("common.cmdline")
|
||||
|
||||
typedef int (*freerdp_command_line_handle_option_t)(const COMMAND_LINE_ARGUMENT_A* arg,
|
||||
void* custom);
|
||||
|
||||
static const char str_force[] = "force";
|
||||
|
||||
static const char* option_starts_with(const char* what, const char* val);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define FREERDP_CLIENT_H
|
||||
|
||||
#include <winpr/cmdline.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
|
||||
#include <freerdp/config.h>
|
||||
#include <freerdp/api.h>
|
||||
@@ -170,8 +171,7 @@ extern "C"
|
||||
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_A* arg, void* custom),
|
||||
void* handle_userdata);
|
||||
freerdp_command_line_handle_option_t handle_option, void* handle_userdata);
|
||||
|
||||
FREERDP_API int freerdp_client_settings_parse_connection_file(rdpSettings* settings,
|
||||
const char* filename);
|
||||
|
||||
@@ -31,6 +31,18 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/** @brief Callback function type definition for command line handling
|
||||
*
|
||||
* @param arg A pointer to the argument to handle
|
||||
* @param void* A pointer to user defined data
|
||||
*
|
||||
* @return \b 0 for success or a \b COMMAND_LINE_ERROR code
|
||||
*
|
||||
* @since version 3.12.0
|
||||
*/
|
||||
typedef int (*freerdp_command_line_handle_option_t)(const COMMAND_LINE_ARGUMENT_A* arg,
|
||||
void* custom);
|
||||
|
||||
/** \brief parses command line arguments to appropriate settings values.
|
||||
*
|
||||
* \param settings The settings instance to store the parsed values to
|
||||
@@ -63,8 +75,7 @@ extern "C"
|
||||
FREERDP_API int freerdp_client_settings_parse_command_line_arguments_ex(
|
||||
rdpSettings* settings, int argc, char** argv, BOOL allowUnknown,
|
||||
COMMAND_LINE_ARGUMENT_A* args, size_t count,
|
||||
int (*handle_option)(const COMMAND_LINE_ARGUMENT_A* arg, void* custom),
|
||||
void* handle_userdata);
|
||||
freerdp_command_line_handle_option_t handle_option, void* handle_userdata);
|
||||
|
||||
FREERDP_API int freerdp_client_settings_command_line_status_print(rdpSettings* settings,
|
||||
int status, int argc,
|
||||
|
||||
@@ -748,7 +748,7 @@ owned by rdpRdp */
|
||||
* state, ...)
|
||||
* \since version 3.12.0
|
||||
*/
|
||||
FREERDP_API BOOL freerdp_presist_credentials(rdpContext* context);
|
||||
FREERDP_API BOOL freerdp_persist_credentials(rdpContext* context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1460,7 +1460,7 @@ BOOL freerdp_is_valid_mcs_create_response(const BYTE* data, size_t size)
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL freerdp_presist_credentials(rdpContext* context)
|
||||
BOOL freerdp_persist_credentials(rdpContext* context)
|
||||
{
|
||||
if (!context)
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user