From 4020ee614cfe248010764028902d80b4a9091f7d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Apr 2014 20:30:05 +0200 Subject: Revise shell command API --- src/shell.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/shell.h') diff --git a/src/shell.h b/src/shell.h index 30de630..9b66477 100644 --- a/src/shell.h +++ b/src/shell.h @@ -38,6 +38,7 @@ struct fastd_shell_command { bool sync; }; + static inline void fastd_shell_command_unset(fastd_shell_command_t *command) { free(command->command); command->command = NULL; @@ -58,5 +59,9 @@ static inline bool fastd_shell_command_isset(const fastd_shell_command_t *comman return command->command; } -bool fastd_shell_command_exec_sync(const fastd_shell_command_t *command, const fastd_peer_t *peer, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *peer_addr, int *ret); -void fastd_shell_command_exec(const fastd_shell_command_t *command, const fastd_peer_t *peer, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *peer_addr); +fastd_shell_env_t * fastd_shell_env_alloc(void); +void fastd_shell_env_set(fastd_shell_env_t *env, const char *key, const char *value); +void fastd_shell_env_free(fastd_shell_env_t *env); + +bool fastd_shell_command_exec_sync(const fastd_shell_command_t *command, const fastd_shell_env_t *env, int *ret); +void fastd_shell_command_exec(const fastd_shell_command_t *command, const fastd_shell_env_t *env); -- cgit v1.2.3