From e03ec948967225c8162ffecf37b59bbfc338a83a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 27 May 2014 05:48:51 +0200 Subject: Lots and lots of documentation --- src/shell.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/shell.h') diff --git a/src/shell.h b/src/shell.h index 9b66477..9c2b8ab 100644 --- a/src/shell.h +++ b/src/shell.h @@ -23,6 +23,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/** + \file shell.h + + Execution of shell commands and management of environment variables +*/ + #pragma once @@ -32,13 +38,15 @@ #include +/** A shell command */ struct fastd_shell_command { - char *command; - char *dir; - bool sync; + char *command; /**< The command as given to \em /bin/sh */ + char *dir; /**< The working directory for the command */ + bool sync; /**< If false, the command will be executed in the background by default */ }; +/** Frees the resources used by a shell command */ static inline void fastd_shell_command_unset(fastd_shell_command_t *command) { free(command->command); command->command = NULL; @@ -47,6 +55,7 @@ static inline void fastd_shell_command_unset(fastd_shell_command_t *command) { command->dir = NULL; } +/** Sets a shell command */ static inline void fastd_shell_command_set(fastd_shell_command_t *command, const char *val, bool sync) { fastd_shell_command_unset(command); @@ -55,6 +64,7 @@ static inline void fastd_shell_command_set(fastd_shell_command_t *command, const command->sync = sync; } +/** Checks if a shell command is set */ static inline bool fastd_shell_command_isset(const fastd_shell_command_t *command) { return command->command; } -- cgit v1.2.3