dpkg 1.22.7-3-g89f48
|
Data Structures | |
struct | command |
Describe a command to execute. More... | |
Functions | |
void | command_init (struct command *cmd, const char *filename, const char *name) |
Initialize a command structure. | |
void | command_destroy (struct command *cmd) |
Destroy a command structure. | |
void | command_add_arg (struct command *cmd, const char *arg) |
Append an argument to the command's argv. | |
void | command_add_argl (struct command *cmd, const char **argv) |
Append an argument array to the command's argv. | |
void | command_add_argv (struct command *cmd, va_list args) |
Append a va_list of argument to the command's argv. | |
void | command_add_args (struct command *cmd,...) DPKG_ATTR_SENTINEL |
Append a variable list of argument to the command's argv. | |
void | command_exec (struct command *cmd) DPKG_ATTR_NORET |
Execute the command specified. | |
void | command_shell (const char *cmd, const char *name) DPKG_ATTR_NORET |
Execute a shell with a possible command. | |
bool | command_in_path (const char *cmd) |
Check whether a command can be found in PATH. | |
void command_add_arg | ( | struct command * | cmd, |
const char * | arg | ||
) |
Append an argument to the command's argv.
cmd | The command structure to act on. |
arg | The argument to append to argv. |
Referenced by execbackend(), extracthalf(), and maintscript_new().
void command_add_argl | ( | struct command * | cmd, |
const char ** | argv | ||
) |
Append an argument array to the command's argv.
cmd | The command structure to act on. |
argv | The NULL terminated argument array to append to argv. |
Referenced by execbackend().
void command_add_args | ( | struct command * | cmd, |
... | |||
) |
Append a variable list of argument to the command's argv.
cmd | The command structure to act on. |
... | The NULL terminated variable list of argument to append to argv. |
References args, and command_add_argv().
Referenced by maintscript_fallback().
void command_add_argv | ( | struct command * | cmd, |
va_list | args | ||
) |
Append a va_list of argument to the command's argv.
cmd | The command structure to act on. |
args | The NULL terminated va_list of argument array to append to argv. |
References argc, args, and argv.
Referenced by command_add_args(), and maintscript_new().
void command_destroy | ( | struct command * | cmd | ) |
Destroy a command structure.
Free the members managed by the command functions (i.e. the argv pointer array), and zero all members of a command structure.
cmd | The command structure to free. |
References argc, argv, argv_size, filename, and name.
Referenced by maintscript_fallback(), and maintscript_new().
void command_exec | ( | struct command * | cmd | ) |
Execute the command specified.
The command is executed searching the PATH if the filename does not contain any slashes, or using the full path if it's either a relative or absolute pathname. This functions does not return.
cmd | The command structure to act on. |
References _, argv, filename, name, and ohshite().
Referenced by execbackend(), and extracthalf().
bool command_in_path | ( | const char * | cmd | ) |
Check whether a command can be found in PATH.
cmd | The command name to check. This is a relative pathname. |
References _, varbuf::buf, file_is_exec(), ohshit(), varbuf_add_char(), varbuf_add_str, varbuf_destroy(), VARBUF_INIT, and varbuf_set_buf().
Referenced by checkpath().
void command_init | ( | struct command * | cmd, |
const char * | filename, | ||
const char * | name | ||
) |
Initialize a command structure.
If name is NULL, then the last component of the filename path will be used to initialize the name member.
cmd | The command structure to initialize. |
filename | The filename of the command to execute. |
name | The description of the command to execute. |
References argc, argv, argv_size, filename, m_malloc(), name, and path_basename().
Referenced by execbackend(), extracthalf(), maintscript_fallback(), and maintscript_new().
void command_shell | ( | const char * | cmd, |
const char * | name | ||
) |
Execute a shell with a possible command.
cmd | The command string to execute, if it's NULL an interactive shell will be executed instead. |
name | The description of the command to execute. |
Referenced by pager_spawn().