FreeRDP
winpr/libwinpr/utils/cmdline.c File Reference
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/cmdline.h>
#include "../log.h"

Macros

#define TAG   WINPR_TAG("commandline")
 

Functions

static void log_error (DWORD flags, LPCSTR message, int index, LPCSTR argv)
 
int CommandLineParseArgumentsA (int argc, LPSTR *argv, COMMAND_LINE_ARGUMENT_A *options, DWORD flags, void *context, COMMAND_LINE_PRE_FILTER_FN_A preFilter, COMMAND_LINE_POST_FILTER_FN_A postFilter)
 
int CommandLineParseArgumentsW (int argc, LPWSTR *argv, COMMAND_LINE_ARGUMENT_W *options, DWORD flags, void *context, COMMAND_LINE_PRE_FILTER_FN_W preFilter, COMMAND_LINE_POST_FILTER_FN_W postFilter)
 
int CommandLineClearArgumentsA (COMMAND_LINE_ARGUMENT_A *options)
 
int CommandLineClearArgumentsW (COMMAND_LINE_ARGUMENT_W *options)
 
const COMMAND_LINE_ARGUMENT_ACommandLineFindArgumentA (const COMMAND_LINE_ARGUMENT_A *options, LPCSTR Name)
 
const COMMAND_LINE_ARGUMENT_WCommandLineFindArgumentW (const COMMAND_LINE_ARGUMENT_W *options, LPCWSTR Name)
 
const COMMAND_LINE_ARGUMENT_ACommandLineFindNextArgumentA (const COMMAND_LINE_ARGUMENT_A *argument)
 
static int is_quoted (char c)
 
static size_t get_element_count (const char *list, BOOL *failed, BOOL fullquoted)
 
static char * get_next_comma (char *string, BOOL fullquoted)
 
static BOOL is_valid_fullquoted (const char *string)
 
char ** CommandLineParseCommaSeparatedValuesEx (const char *name, const char *list, size_t *count)
 
char ** CommandLineParseCommaSeparatedValues (const char *list, size_t *count)
 
char * CommandLineToCommaSeparatedValues (int argc, char *argv[])
 
static const char * filtered (const char *arg, const char *filters[], size_t number)
 
char * CommandLineToCommaSeparatedValuesEx (int argc, char *argv[], const char *filters[], size_t number)
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("commandline")

WinPR: Windows Portable Runtime Command-Line Utils

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ CommandLineClearArgumentsA()

int CommandLineClearArgumentsA ( COMMAND_LINE_ARGUMENT_A options)
Here is the caller graph for this function:

◆ CommandLineClearArgumentsW()

int CommandLineClearArgumentsW ( COMMAND_LINE_ARGUMENT_W options)

◆ CommandLineFindArgumentA()

const COMMAND_LINE_ARGUMENT_A* CommandLineFindArgumentA ( const COMMAND_LINE_ARGUMENT_A options,
LPCSTR  Name 
)
Here is the caller graph for this function:

◆ CommandLineFindArgumentW()

const COMMAND_LINE_ARGUMENT_W* CommandLineFindArgumentW ( const COMMAND_LINE_ARGUMENT_W options,
LPCWSTR  Name 
)
Here is the call graph for this function:

◆ CommandLineFindNextArgumentA()

const COMMAND_LINE_ARGUMENT_A* CommandLineFindNextArgumentA ( const COMMAND_LINE_ARGUMENT_A argument)
Here is the caller graph for this function:

◆ CommandLineParseArgumentsA()

int CommandLineParseArgumentsA ( int  argc,
LPSTR *  argv,
COMMAND_LINE_ARGUMENT_A options,
DWORD  flags,
void *  context,
COMMAND_LINE_PRE_FILTER_FN_A  preFilter,
COMMAND_LINE_POST_FILTER_FN_A  postFilter 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommandLineParseArgumentsW()

int CommandLineParseArgumentsW ( int  argc,
LPWSTR *  argv,
COMMAND_LINE_ARGUMENT_W options,
DWORD  flags,
void *  context,
COMMAND_LINE_PRE_FILTER_FN_W  preFilter,
COMMAND_LINE_POST_FILTER_FN_W  postFilter 
)

◆ CommandLineParseCommaSeparatedValues()

char** CommandLineParseCommaSeparatedValues ( const char *  list,
size_t *  count 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommandLineParseCommaSeparatedValuesEx()

char** CommandLineParseCommaSeparatedValuesEx ( const char *  name,
const char *  list,
size_t *  count 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommandLineToCommaSeparatedValues()

char* CommandLineToCommaSeparatedValues ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommandLineToCommaSeparatedValuesEx()

char* CommandLineToCommaSeparatedValuesEx ( int  argc,
char *  argv[],
const char *  filters[],
size_t  number 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filtered()

static const char* filtered ( const char *  arg,
const char *  filters[],
size_t  number 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_element_count()

static size_t get_element_count ( const char *  list,
BOOL *  failed,
BOOL  fullquoted 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_comma()

static char* get_next_comma ( char *  string,
BOOL  fullquoted 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_quoted()

static int is_quoted ( char  c)
static
Here is the caller graph for this function:

◆ is_valid_fullquoted()

static BOOL is_valid_fullquoted ( const char *  string)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_error()

static void log_error ( DWORD  flags,
LPCSTR  message,
int  index,
LPCSTR  argv 
)
static

Command-line syntax: some basic concepts: https://pythonconquerstheuniverse.wordpress.com/2010/07/25/command-line-syntax-some-basic-concepts/ Command-Line Syntax:

<sigil><keyword><separator>

<sigil>: '/' or '-' or ('+' | '-')

<keyword>: option, named argument, flag

<separator>: ':' or '='

: argument value

Here is the caller graph for this function: