construct_argc_argv

Creates an argument vector from a command line.

Library:LibC
Service:Library

Syntax

  #include <library.h> 
   
  int construct_argc_argv (
     const char   *command_line,
     const char   *argv0,
     int          *argc,
     char         *argv[] );
  

Parameters

command_line

(IN) Points to the command line to parse into an argument vector.

argv0

(IN) Points to the first argument. If the first argument is in the command line, this parameter is optional and can be set to NULL.

argc

(OUT) Points to the number of arguments found in the command line.

argv

(OUT) Points to a vector of arguments. If set to NULL, only the count (argc) is returned.

Return Values

Returns 0.

Remarks

You can call this function twice, once to discover how many arguments are in the command line so you can have size argv appropriately, and the second time so that argv can be filled out. If argv is too small for the number of arguments, it is overwritten.

See Also

detect_redirection