diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-27 05:48:51 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-27 05:48:51 +0200 |
commit | e03ec948967225c8162ffecf37b59bbfc338a83a (patch) | |
tree | 6c53c822063d32edb1f387fbf8879155626aafd8 /src/shell.h | |
parent | 9b5e5f7883ef59201d17343680d109c1f9d5ae9b (diff) | |
download | fastd-e03ec948967225c8162ffecf37b59bbfc338a83a.tar fastd-e03ec948967225c8162ffecf37b59bbfc338a83a.zip |
Lots and lots of documentation
Diffstat (limited to 'src/shell.h')
-rw-r--r-- | src/shell.h | 16 |
1 files changed, 13 insertions, 3 deletions
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 <string.h> +/** 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; } |