YASH 0.1
CLI written in C
Loading...
Searching...
No Matches
Command Struct Reference

Represents one command with arguments and redirections. More...

#include <yash.h>

Public Attributes

char * argv [MAX_ARGS]
 Null-terminated array of arguments.
 
char * in_file
 Filename for input redirection.
 
char * out_file
 Filename for output redirection.
 
char * err_file
 Filename for error redirection.
 
int background
 Background execution flag.
 

Detailed Description

Represents one command with arguments and redirections.

Invariants:

  • argv is always NULL-terminated.
  • argv[0] must exist for a valid command (cannot be empty).
  • At most one of each redirection (in_file, out_file, err_file) may be set.
  • Redirection fields are either a filename string or NULL.
  • background == 1 is only valid if the containing Line.is_pipeline == 0.
  • argv pointers reference the tokenized input buffer, which must outlive parsing and execution.

The documentation for this struct was generated from the following file: