diff options
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/client.h b/src/client.h index f64da2c..2e5cf9d 100644 --- a/src/client.h +++ b/src/client.h @@ -22,22 +22,43 @@ #include <stddef.h> +/** + * Commands for `send_command`. + */ +enum command + { + /** + * Queue a job. + */ + SAT_QUEUE = 0, + + /** + * Remove jobs. + */ + SAT_REMOVE = 1, + + /** + * Print job queue. + */ + SAT_PRINT = 2, + + /** + * Run jobs + */ + SAT_RUN = 3 + }; + /** * Send a command to satd. Start satd if it is not running. * - * If `n` is 0 but `msg` is not `NULL`, `msg` is a - * NUL-terminated string with the ID of the job to - * remove for the queue. `msg` should otherwise, - * unless it is `NULL` be the command the run, followed - * by its environment. - * - * @param n The length of the message, or a number - * number to send if `msg` is `NULL`. + * @param cmd Command type. + * @param n The length of the message, 0 if `msg` is + * `NULL` or NUL-terminated. * @param msg The message to send. * @return Zero on success. * * @throws 0 Error at the daemon-side. */ -int send_command(size_t n, const char *restrict msg); +int send_command(enum command cmd, size_t n, const char *restrict msg); |