int tsmGetArgString ( int argc, char **argv, char *arg, char **value )

Get the string after an option on the command line

Documentation

Get the string after an option on the command line.

This function will take the argc and argv variables that were passed to an application's main() function and will then test to see if a specific option string was supplied in the command line. If it is found, then the string directly after that option is returned. N.B. the string is not copied - it is a pointer to the actual argv string, so don't free it. You should take a copy of the string with strdup() if you want to alter it.

The string comparison is case sensitive.

Returns:
TRUE if the option was found and it's value placed in the value variable, FALSE otherwise.
Parameters:
argc - the number of arguments passed to main()
argv - the array of command line strings passed to main()
arg - an argument to test for in the argv array
value - a pointer to an string to be filled with the option's text
Author:
Martin Reddy
Version:
10 March 1998
See Also:
tsmGetArg, tsmGetArgInt, tsmGetArgFloat


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page