NAME
unparse_prog_args - Process command-line arguments stored in conventional argc,argv format.
SYNOPSIS
#include "l/l_arg.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
char *unparse_prog_args
(
int argc,
char **argv
);
DESCRIPTION
Input argc is expected to be positive, and argv is expected not to equal
NULL; otherwise, this is treated as a bug. All strings from argv[1] up to,
but not including, argv[argc], will be concatenated with space separators
to produce the output string. We skip argv[0] because conventionally it is
just the name of the program being invoked. The contents of argv are not
modified by this function.
For example, suppose argc is 3 and argv is the array
argv = [ "it" "cluster" "display" NULL ].
Then the output will be a pointer to the string "cluster display "; this
string uses heap memory which must be released using kjb_free().
RETURNS
If successful, this function returns a pointer to a string allocated on
the heap. The caller is obliged to free this string using kjb_free().
If the allocation fails, the return value is NULL.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Andrew Predoehl
SEE ALSO
kjb_getopts