50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
/*
|
||
* arguments.c
|
||
*
|
||
* Created on: 6 июл. 2022 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#include <stdlib.h>
|
||
#include "arguments.h"
|
||
|
||
void settingsLoad()
|
||
{
|
||
settingsAddKey(PARAMETER_XFREERDP, "xfreerdp", false, true);
|
||
settingsAddKey(PARAMETER_SERVER, "/v:", true, true);
|
||
settingsAddKey(PARAMETER_USERNAME, "/u:", true, true);
|
||
settingsAddKey(PARAMETER_PASSWORD, "/p:", true, true);
|
||
settingsAddKey(PARAMETER_MULTIMONITOR, "/multimon", false, true);
|
||
settingsAddKey(PARAMETER_FULLSCREEN, "/f", false, true);
|
||
}
|
||
|
||
Arguments *buildArguments()
|
||
{
|
||
Arguments *args = (Arguments *)malloc(sizeof(Arguments));
|
||
args->argc = settings.countEnable;
|
||
args->argv = (char **)malloc(sizeof(char *) * settings.countEnable);
|
||
Node *head = settings.next;
|
||
|
||
for (size_t i = 0; i < settings.countEnable; head = head->next)
|
||
{
|
||
if (head->enable)
|
||
{
|
||
if (head->data->isValue)
|
||
{
|
||
args->argv[i++] = head->data->fullArgument;
|
||
}
|
||
else
|
||
{
|
||
args->argv[i++] = head->data->key;
|
||
}
|
||
}
|
||
}
|
||
|
||
return args;
|
||
}
|
||
|
||
void freeArguments()
|
||
{
|
||
|
||
}
|