COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance

Remove the old global structs as the parser modifies them. When using
multiple instances in the same process space this could break parsing.
This commit is contained in:
Armin Novak 2019-10-28 10:10:14 +01:00
parent 9e32899347
commit 0c87eaee4d
21 changed files with 193 additions and 188 deletions

View File

@ -346,12 +346,6 @@ static UINT audin_alsa_close(IAudinDevice* device)
return error; return error;
} }
static COMMAND_LINE_ARGUMENT_A audin_alsa_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -364,6 +358,11 @@ static UINT audin_alsa_parse_addin_args(AudinALSADevice* device,
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
AudinALSADevice* alsa = (AudinALSADevice*) device; AudinALSADevice* alsa = (AudinALSADevice*) device;
COMMAND_LINE_ARGUMENT_A audin_alsa_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON |
COMMAND_LINE_IGN_UNKNOWN_KEYWORD; COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,

View File

@ -855,7 +855,13 @@ static UINT audin_set_device_name(AUDIN_PLUGIN* audin, const char* device_name)
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_args[] = BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args)
{
int status;
DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg;
UINT error;
COMMAND_LINE_ARGUMENT_A audin_args[] =
{ {
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" }, { "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" }, { "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
@ -865,13 +871,6 @@ static COMMAND_LINE_ARGUMENT_A audin_args[] =
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
}; };
BOOL audin_process_addin_args(AUDIN_PLUGIN* audin, ADDIN_ARGV* args)
{
int status;
DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg;
UINT error;
if (!args || args->argc == 1) if (!args || args->argc == 1)
return TRUE; return TRUE;

View File

@ -304,12 +304,6 @@ static UINT audin_mac_free(IAudinDevice* device)
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_mac_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args) static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args)
{ {
DWORD errCode; DWORD errCode;
@ -318,6 +312,12 @@ static UINT audin_mac_parse_addin_args(AudinMacDevice* device, ADDIN_ARGV* args)
char* str_num, *eptr; char* str_num, *eptr;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A audin_mac_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
AudinMacDevice* mac = (AudinMacDevice*)device; AudinMacDevice* mac = (AudinMacDevice*)device;
if (args->argc == 1) if (args->argc == 1)

View File

@ -247,15 +247,6 @@ UINT audin_opensles_close(IAudinDevice* device)
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_opensles_args[] =
{
{
"dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
NULL, NULL, -1, NULL, "audio device name"
},
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -268,6 +259,15 @@ static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device,
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device;
COMMAND_LINE_ARGUMENT_A audin_opensles_args[] =
{
{
"dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
NULL, NULL, -1, NULL, "audio device name"
},
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, args=%p", (void*) device, (void*) args); WLog_Print(opensles->log, WLOG_DEBUG, "device=%p, args=%p", (void*) device, (void*) args);
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,

View File

@ -381,12 +381,6 @@ static UINT audin_oss_free(IAudinDevice* device)
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_oss_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -399,6 +393,13 @@ static UINT audin_oss_parse_addin_args(AudinOSSDevice* device, ADDIN_ARGV* args)
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
AudinOSSDevice* oss = (AudinOSSDevice*)device; AudinOSSDevice* oss = (AudinOSSDevice*)device;
COMMAND_LINE_ARGUMENT_A audin_oss_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON |
COMMAND_LINE_IGN_UNKNOWN_KEYWORD; COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,

View File

@ -425,12 +425,6 @@ static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_pulse_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -442,6 +436,12 @@ static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* a
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
AudinPulseDevice* pulse = (AudinPulseDevice*) device; AudinPulseDevice* pulse = (AudinPulseDevice*) device;
COMMAND_LINE_ARGUMENT_A audin_pulse_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, audin_pulse_args, flags, status = CommandLineParseArgumentsA(args->argc, args->argv, audin_pulse_args, flags,
pulse, NULL, NULL); pulse, NULL, NULL);

View File

@ -402,12 +402,6 @@ static UINT audin_winmm_open(IAudinDevice* device, AudinReceive receive, void* u
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
static COMMAND_LINE_ARGUMENT_A audin_winmm_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -419,6 +413,12 @@ static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* a
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; AudinWinmmDevice* winmm = (AudinWinmmDevice*) device;
COMMAND_LINE_ARGUMENT_A audin_winmm_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, audin_winmm_args, flags, status = CommandLineParseArgumentsA(args->argc, args->argv, audin_winmm_args, flags,
winmm, NULL, NULL); winmm, NULL, NULL);

View File

@ -462,12 +462,6 @@ static UINT rdpsnd_alsa_play(rdpsndDevicePlugin* device, const BYTE* data, size_
return latency + alsa->latency; return latency + alsa->latency;
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -479,6 +473,11 @@ static UINT rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV*
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device; rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device;
COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_alsa_args, flags, status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_alsa_args, flags,
alsa, NULL, NULL); alsa, NULL, NULL);

View File

@ -85,11 +85,6 @@ static void rdpsnd_fake_start(rdpsndDevicePlugin* device)
{ {
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_fake_args[] =
{
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -100,6 +95,10 @@ static UINT rdpsnd_fake_parse_addin_args(rdpsndFakePlugin* fake, ADDIN_ARGV* arg
int status; int status;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A rdpsnd_fake_args[] =
{
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,
rdpsnd_fake_args, flags, fake, NULL, NULL); rdpsnd_fake_args, flags, fake, NULL, NULL);

View File

@ -296,7 +296,14 @@ static void rdpsnd_opensles_start(rdpsndDevicePlugin* device)
DEBUG_SND("opensles=%p", (void*) opensles); DEBUG_SND("opensles=%p", (void*) opensles);
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] = static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device,
ADDIN_ARGV* args)
{
int status;
DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg;
rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device;
COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] =
{ {
{ {
"dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>",
@ -305,13 +312,6 @@ static COMMAND_LINE_ARGUMENT_A rdpsnd_opensles_args[] =
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
}; };
static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device,
ADDIN_ARGV* args)
{
int status;
DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg;
rdpsndopenslesPlugin* opensles = (rdpsndopenslesPlugin*) device;
assert(opensles); assert(opensles);
assert(args); assert(args);
DEBUG_SND("opensles=%p, args=%p", (void*) opensles, (void*) args); DEBUG_SND("opensles=%p, args=%p", (void*) opensles, (void*) args);

View File

@ -388,12 +388,6 @@ static UINT rdpsnd_oss_play(rdpsndDevicePlugin* device, const BYTE* data, size_t
return 10; /* TODO: Get real latency in [ms] */ return 10; /* TODO: Get real latency in [ms] */
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_oss_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args)
{ {
int status; int status;
@ -401,6 +395,11 @@ static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* a
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device; rdpsndOssPlugin* oss = (rdpsndOssPlugin*)device;
COMMAND_LINE_ARGUMENT_A rdpsnd_oss_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_oss_args, flags, status = CommandLineParseArgumentsA(args->argc, args->argv, rdpsnd_oss_args, flags,
oss, NULL, NULL); oss, NULL, NULL);

View File

@ -519,12 +519,6 @@ static void rdpsnd_pulse_start(rdpsndDevicePlugin* device)
pa_threaded_mainloop_unlock(pulse->mainloop); pa_threaded_mainloop_unlock(pulse->mainloop);
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_pulse_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -536,6 +530,11 @@ static UINT rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device; rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device;
COMMAND_LINE_ARGUMENT_A rdpsnd_pulse_args[] =
{
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_IGN_UNKNOWN_KEYWORD;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,
rdpsnd_pulse_args, flags, pulse, NULL, NULL); rdpsnd_pulse_args, flags, pulse, NULL, NULL);

View File

@ -686,18 +686,6 @@ BOOL rdpsnd_set_device_name(rdpsndPlugin* rdpsnd, const char* device_name)
return (rdpsnd->device_name != NULL); return (rdpsnd->device_name != NULL);
} }
static COMMAND_LINE_ARGUMENT_A rdpsnd_args[] =
{
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ "format", COMMAND_LINE_VALUE_REQUIRED, "<format>", NULL, NULL, -1, NULL, "format" },
{ "rate", COMMAND_LINE_VALUE_REQUIRED, "<rate>", NULL, NULL, -1, NULL, "rate" },
{ "channel", COMMAND_LINE_VALUE_REQUIRED, "<channel>", NULL, NULL, -1, NULL, "channel" },
{ "latency", COMMAND_LINE_VALUE_REQUIRED, "<latency>", NULL, NULL, -1, NULL, "latency" },
{ "quality", COMMAND_LINE_VALUE_REQUIRED, "<quality mode>", NULL, NULL, -1, NULL, "quality mode" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -708,6 +696,17 @@ static UINT rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args)
int status; int status;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A rdpsnd_args[] =
{
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "device" },
{ "format", COMMAND_LINE_VALUE_REQUIRED, "<format>", NULL, NULL, -1, NULL, "format" },
{ "rate", COMMAND_LINE_VALUE_REQUIRED, "<rate>", NULL, NULL, -1, NULL, "rate" },
{ "channel", COMMAND_LINE_VALUE_REQUIRED, "<channel>", NULL, NULL, -1, NULL, "channel" },
{ "latency", COMMAND_LINE_VALUE_REQUIRED, "<latency>", NULL, NULL, -1, NULL, "latency" },
{ "quality", COMMAND_LINE_VALUE_REQUIRED, "<quality mode>", NULL, NULL, -1, NULL, "quality mode" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
rdpsnd->wQualityMode = HIGH_QUALITY; /* default quality mode */ rdpsnd->wQualityMode = HIGH_QUALITY; /* default quality mode */
if (args->argc > 1) if (args->argc > 1)

View File

@ -489,14 +489,6 @@ static UINT tsmf_plugin_terminated(IWTSPlugin* pPlugin)
return CHANNEL_RC_OK; return CHANNEL_RC_OK;
} }
COMMAND_LINE_ARGUMENT_A tsmf_args[] =
{
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "audio subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ "decoder", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "decoder subsystem" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -508,6 +500,13 @@ static UINT tsmf_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args)
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin;
COMMAND_LINE_ARGUMENT_A tsmf_args[] =
{
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "audio subsystem" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<device>", NULL, NULL, -1, NULL, "audio device name" },
{ "decoder", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "decoder subsystem" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,
tsmf_args, flags, tsmf, NULL, NULL); tsmf_args, flags, tsmf, NULL, NULL);

View File

@ -450,16 +450,6 @@ static void udevman_load_interface(UDEVMAN* udevman)
udevman->iface.wait_urb = udevman_wait_urb; udevman->iface.wait_urb = udevman_wait_urb;
} }
COMMAND_LINE_ARGUMENT_A urbdrc_udevman_args[] =
{
{ "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<devices>", NULL, NULL, -1, NULL, "device list" },
{ "id", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_VID_PID" },
{ "addr", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_ADDR" },
{ "auto", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_AUTO" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
static void urbdrc_udevman_register_devices(UDEVMAN* udevman, char* devices) static void urbdrc_udevman_register_devices(UDEVMAN* udevman, char* devices)
{ {
char* token; char* token;
@ -512,6 +502,15 @@ static void urbdrc_udevman_parse_addin_args(UDEVMAN* udevman, ADDIN_ARGV* args)
int status; int status;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A urbdrc_udevman_args[] =
{
{ "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" },
{ "dev", COMMAND_LINE_VALUE_REQUIRED, "<devices>", NULL, NULL, -1, NULL, "device list" },
{ "id", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_VID_PID" },
{ "addr", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_ADDR" },
{ "auto", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "FLAG_ADD_BY_AUTO" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,
urbdrc_udevman_args, flags, udevman, NULL, NULL); urbdrc_udevman_args, flags, udevman, NULL, NULL);

View File

@ -1504,13 +1504,6 @@ BOOL urbdrc_set_subsystem(URBDRC_PLUGIN* urbdrc, char* subsystem)
return (urbdrc->subsystem != NULL); return (urbdrc->subsystem != NULL);
} }
COMMAND_LINE_ARGUMENT_A urbdrc_args[] =
{
{ "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" },
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
/** /**
* Function description * Function description
* *
@ -1521,6 +1514,12 @@ static UINT urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args)
int status; int status;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A urbdrc_args[] =
{
{ "dbg", COMMAND_LINE_VALUE_FLAG, "", NULL, BoolValueFalse, -1, NULL, "debug" },
{ "sys", COMMAND_LINE_VALUE_REQUIRED, "<subsystem>", NULL, NULL, -1, NULL, "subsystem" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
};
flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON;
status = CommandLineParseArgumentsA(args->argc, args->argv, status = CommandLineParseArgumentsA(args->argc, args->argv,
urbdrc_args, flags, urbdrc, NULL, NULL); urbdrc_args, flags, urbdrc, NULL, NULL);

View File

@ -325,6 +325,8 @@ BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv,
COMMAND_LINE_ARGUMENT_A* custom) COMMAND_LINE_ARGUMENT_A* custom)
{ {
const char* name = "FreeRDP"; const char* name = "FreeRDP";
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)];
memcpy(largs, args, sizeof(args));
if (argc > 0) if (argc > 0)
name = argv[0]; name = argv[0];
@ -341,7 +343,7 @@ BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv,
printf(" +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')\n"); printf(" +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')\n");
printf("\n"); printf("\n");
freerdp_client_print_command_line_args(custom); freerdp_client_print_command_line_args(custom);
freerdp_client_print_command_line_args(args); freerdp_client_print_command_line_args(largs);
printf("\n"); printf("\n");
printf("Examples:\n"); printf("Examples:\n");
printf(" %s connection.rdp /p:Pwd123! /f\n", name); printf(" %s connection.rdp /p:Pwd123! /f\n", name);
@ -1273,6 +1275,9 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg
DWORD flags; DWORD flags;
int detect_status; int detect_status;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)];
memcpy(largs, args, sizeof(args));
flags = COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SILENCE_PARSER; flags = COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SILENCE_PARSER;
flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS; flags |= COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SIGIL_PLUS_MINUS;
@ -1283,14 +1288,14 @@ static int freerdp_detect_windows_style_command_line_syntax(int argc, char** arg
*count = 0; *count = 0;
detect_status = 0; detect_status = 0;
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(largs);
status = CommandLineParseArgumentsA(argc, argv, args, flags, status = CommandLineParseArgumentsA(argc, argv, largs, flags,
NULL, freerdp_detect_command_line_pre_filter, NULL); NULL, freerdp_detect_command_line_pre_filter, NULL);
if (status < 0) if (status < 0)
return status; return status;
arg = args; arg = largs;
do do
{ {
@ -1314,6 +1319,9 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv,
DWORD flags; DWORD flags;
int detect_status; int detect_status;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)];
memcpy(largs, args, sizeof(args));
flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SILENCE_PARSER; flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SILENCE_PARSER;
flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH;
flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE; flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE;
@ -1325,14 +1333,14 @@ int freerdp_detect_posix_style_command_line_syntax(int argc, char** argv,
*count = 0; *count = 0;
detect_status = 0; detect_status = 0;
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(largs);
status = CommandLineParseArgumentsA(argc, argv, args, flags, status = CommandLineParseArgumentsA(argc, argv, largs, flags,
NULL, freerdp_detect_command_line_pre_filter, NULL); NULL, freerdp_detect_command_line_pre_filter, NULL);
if (status < 0) if (status < 0)
return status; return status;
arg = args; arg = largs;
do do
{ {
@ -1411,6 +1419,8 @@ int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings,
int status, int argc, char** argv, COMMAND_LINE_ARGUMENT_A* custom) int status, int argc, char** argv, COMMAND_LINE_ARGUMENT_A* custom)
{ {
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)];
memcpy(largs, args, sizeof(args));
if (status == COMMAND_LINE_STATUS_PRINT_VERSION) if (status == COMMAND_LINE_STATUS_PRINT_VERSION)
{ {
@ -1426,7 +1436,7 @@ int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings,
} }
else if (status == COMMAND_LINE_STATUS_PRINT) else if (status == COMMAND_LINE_STATUS_PRINT)
{ {
arg = CommandLineFindArgumentA(args, "kbd-list"); arg = CommandLineFindArgumentA(largs, "kbd-list");
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT) if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{ {
@ -1459,7 +1469,7 @@ int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings,
printf("\n"); printf("\n");
} }
arg = CommandLineFindArgumentA(args, "monitor-list"); arg = CommandLineFindArgumentA(largs, "monitor-list");
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT) if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{ {
@ -1551,6 +1561,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
BOOL promptForPassword = FALSE; BOOL promptForPassword = FALSE;
BOOL compatibility = FALSE; BOOL compatibility = FALSE;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(args)];
memcpy(largs, args, sizeof(args));
/* Command line detection fails if only a .rdp or .msrcIncident file /* Command line detection fails if only a .rdp or .msrcIncident file
* is supplied. Check this case first, only then try to detect * is supplied. Check this case first, only then try to detect
@ -1593,8 +1605,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
} }
CommandLineClearArgumentsA(args); CommandLineClearArgumentsA(largs);
status = CommandLineParseArgumentsA(argc, argv, args, flags, status = CommandLineParseArgumentsA(argc, argv, largs, flags,
settings, settings,
freerdp_client_command_line_pre_filter, freerdp_client_command_line_pre_filter,
freerdp_client_command_line_post_filter); freerdp_client_command_line_post_filter);
@ -1603,8 +1615,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
return status; return status;
} }
CommandLineFindArgumentA(args, "v"); CommandLineFindArgumentA(largs, "v");
arg = args; arg = largs;
errno = 0; errno = 0;
do do
@ -3127,7 +3139,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
settings->ColorDepth = 32; settings->ColorDepth = 32;
} }
arg = CommandLineFindArgumentA(args, "port"); arg = CommandLineFindArgumentA(largs, "port");
if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)
{ {
@ -3139,14 +3151,14 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
settings->ServerPort = (UINT32)val; settings->ServerPort = (UINT32)val;
} }
arg = CommandLineFindArgumentA(args, "p"); arg = CommandLineFindArgumentA(largs, "p");
if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)
{ {
FillMemory(arg->Value, strlen(arg->Value), '*'); FillMemory(arg->Value, strlen(arg->Value), '*');
} }
arg = CommandLineFindArgumentA(args, "gp"); arg = CommandLineFindArgumentA(largs, "gp");
if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT) if (arg->Flags & COMMAND_LINE_ARGUMENT_PRESENT)
{ {

View File

@ -22,7 +22,8 @@
#include <winpr/cmdline.h> #include <winpr/cmdline.h>
static COMMAND_LINE_ARGUMENT_A args[] = { static const COMMAND_LINE_ARGUMENT_A args[] =
{
{ "a", COMMAND_LINE_VALUE_REQUIRED, "<addin>[,<options>]", NULL, NULL, -1, "addin", "Addin" }, { "a", COMMAND_LINE_VALUE_REQUIRED, "<addin>[,<options>]", NULL, NULL, -1, "addin", "Addin" },
{ "action-script", COMMAND_LINE_VALUE_REQUIRED, "<file-name>", "~/.config/freerdp/action.sh", { "action-script", COMMAND_LINE_VALUE_REQUIRED, "<file-name>", "~/.config/freerdp/action.sh",
NULL, -1, NULL, "Action script" }, NULL, -1, NULL, "Action script" },
@ -327,12 +328,9 @@ static COMMAND_LINE_ARGUMENT_A args[] = {
"Hyper-V console (use port 2179, disable negotiation)" }, "Hyper-V console (use port 2179, disable negotiation)" },
{ "w", COMMAND_LINE_VALUE_REQUIRED, "<width>", "1024", NULL, -1, NULL, "Width" }, { "w", COMMAND_LINE_VALUE_REQUIRED, "<width>", "1024", NULL, -1, NULL, "Width" },
{ "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" }, { "wallpaper", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "wallpaper" },
{ "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, { "window-drag", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "full window drag" },
"full window drag" }, { "window-position", COMMAND_LINE_VALUE_REQUIRED, "<xpos>x<ypos>", NULL, NULL, -1, NULL, "window position" },
{ "window-position", COMMAND_LINE_VALUE_REQUIRED, "<xpos>x<ypos>", NULL, NULL, -1, NULL, { "wm-class", COMMAND_LINE_VALUE_REQUIRED, "<class-name>", NULL, NULL, -1, NULL, "Set the WM_CLASS hint for the window instance" },
"window position" },
{ "wm-class", COMMAND_LINE_VALUE_REQUIRED, "<class-name>", NULL, NULL, -1, NULL,
"Set the WM_CLASS hint for the window instance" },
{ "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Use available work area" }, { "workarea", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Use available work area" },
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
}; };

View File

@ -41,7 +41,7 @@
#define TAG CLIENT_TAG("common.compatibility") #define TAG CLIENT_TAG("common.compatibility")
static COMMAND_LINE_ARGUMENT_A old_args[] = static const COMMAND_LINE_ARGUMENT_A old_args[] =
{ {
{ "0", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "connect to console session" }, { "0", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "connect to console session" },
{ "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set color depth in bits, default is 16" }, { "a", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "set color depth in bits, default is 16" },
@ -414,6 +414,9 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count)
int detect_status; int detect_status;
rdpSettings* settings; rdpSettings* settings;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(old_args)];
memcpy(largs, old_args, sizeof(old_args));
*count = 0; *count = 0;
detect_status = 0; detect_status = 0;
flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SILENCE_PARSER; flags = COMMAND_LINE_SEPARATOR_SPACE | COMMAND_LINE_SILENCE_PARSER;
@ -424,8 +427,8 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count)
if (!settings) if (!settings)
return -1; return -1;
CommandLineClearArgumentsA(old_args); CommandLineClearArgumentsA(largs);
status = CommandLineParseArgumentsA(argc, argv, old_args, flags, settings, status = CommandLineParseArgumentsA(argc, argv, largs, flags, settings,
freerdp_client_old_command_line_pre_filter, NULL); freerdp_client_old_command_line_pre_filter, NULL);
if (status < 0) if (status < 0)
@ -434,7 +437,7 @@ int freerdp_detect_old_command_line_syntax(int argc, char** argv, size_t* count)
return status; return status;
} }
arg = old_args; arg = largs;
do do
{ {
@ -479,12 +482,15 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
int status; int status;
DWORD flags; DWORD flags;
COMMAND_LINE_ARGUMENT_A* arg; COMMAND_LINE_ARGUMENT_A* arg;
COMMAND_LINE_ARGUMENT_A largs[ARRAYSIZE(old_args)];
memcpy(largs, old_args, sizeof(old_args));
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0); freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
flags = COMMAND_LINE_SEPARATOR_SPACE; flags = COMMAND_LINE_SEPARATOR_SPACE;
flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH; flags |= COMMAND_LINE_SIGIL_DASH | COMMAND_LINE_SIGIL_DOUBLE_DASH;
flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE; flags |= COMMAND_LINE_SIGIL_ENABLE_DISABLE;
flags |= COMMAND_LINE_SIGIL_NOT_ESCAPED; flags |= COMMAND_LINE_SIGIL_NOT_ESCAPED;
status = CommandLineParseArgumentsA(argc, argv, old_args, flags, settings, status = CommandLineParseArgumentsA(argc, argv, largs, flags, settings,
freerdp_client_old_command_line_pre_filter, freerdp_client_old_command_line_post_filter); freerdp_client_old_command_line_pre_filter, freerdp_client_old_command_line_post_filter);
if (status == COMMAND_LINE_STATUS_PRINT_VERSION) if (status == COMMAND_LINE_STATUS_PRINT_VERSION)
@ -506,7 +512,7 @@ int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSe
return COMMAND_LINE_STATUS_PRINT_HELP; return COMMAND_LINE_STATUS_PRINT_HELP;
} }
arg = old_args; arg = largs;
errno = 0; errno = 0;
settings->BitmapCacheEnabled = TRUE; settings->BitmapCacheEnabled = TRUE;
settings->OffscreenSupportLevel = TRUE; settings->OffscreenSupportLevel = TRUE;

View File

@ -45,7 +45,7 @@
#define TAG SERVER_TAG("shadow") #define TAG SERVER_TAG("shadow")
static COMMAND_LINE_ARGUMENT_A shadow_args[] = static const COMMAND_LINE_ARGUMENT_A shadow_args[] =
{ {
{ "port", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "Server port" }, { "port", COMMAND_LINE_VALUE_REQUIRED, "<number>", NULL, NULL, -1, NULL, "Server port" },
{ "ipc-socket", COMMAND_LINE_VALUE_REQUIRED, "<ipc-socket>", NULL, NULL, -1, NULL, "Server IPC socket" }, { "ipc-socket", COMMAND_LINE_VALUE_REQUIRED, "<ipc-socket>", NULL, NULL, -1, NULL, "Server IPC socket" },

View File

@ -19,7 +19,17 @@ static const char* testArgv[] =
0 0
}; };
static COMMAND_LINE_ARGUMENT_A args[] = int TestCmdLine(int argc, char* argv[])
{
int status;
int ret = -1;
DWORD flags;
long width = 0;
long height = 0;
COMMAND_LINE_ARGUMENT_A* arg;
int testArgc;
char** command_line;
COMMAND_LINE_ARGUMENT_A args[] =
{ {
{ "v", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "destination server" }, { "v", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "destination server" },
{ "port", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "server port" }, { "port", COMMAND_LINE_VALUE_REQUIRED, NULL, NULL, NULL, -1, NULL, "server port" },
@ -56,18 +66,6 @@ static COMMAND_LINE_ARGUMENT_A args[] =
{ NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL }
}; };
int TestCmdLine(int argc, char* argv[])
{
int status;
int ret = -1;
DWORD flags;
long width = 0;
long height = 0;
COMMAND_LINE_ARGUMENT_A* arg;
int testArgc;
char** command_line;
flags = COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SIGIL_PLUS_MINUS; flags = COMMAND_LINE_SIGIL_SLASH | COMMAND_LINE_SEPARATOR_COLON | COMMAND_LINE_SIGIL_PLUS_MINUS;
testArgc = string_list_length(testArgv); testArgc = string_list_length(testArgv);
command_line = string_list_copy(testArgv); command_line = string_list_copy(testArgv);