From a2ec37e465adc15cf440907582dd4822feafc01c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 29 Dec 2015 02:00:31 +0100 Subject: the missing bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/daemon.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/daemon.h') diff --git a/src/daemon.h b/src/daemon.h index f6ebaf0..773be85 100644 --- a/src/daemon.h +++ b/src/daemon.h @@ -168,3 +168,31 @@ char **sublist(char *const *list, size_t n); */ int reopen(int fd, int oflag); +/** + * Send a string to a client. + * + * @param sockfd The file descriptor of the socket. + * @param outfd The file descriptor to which the client shall output the message. + * @param ... `NULL`-terminated list of string to concatenate. + * @return 0 on success, -1 on error. + */ +int send_string(int sockfd, int outfd, ...); + +/** + * Removes (and optionally runs) a job. + * + * @param jobno The job number, `NULL` for any job. + * @param runjob Shall we run the job too? + * @return 0 on success, -1 on error. + * + * @throws 0 The job is not in the queue. + */ +int remove_job(const char *jobno, int runjob); + +/** + * Get a `NULL` terminated list of all queued jobs. + * + * @return A `NULL` terminated list of all queued jobs. `NULL` on error. + */ +struct job **get_jobs(void); + -- cgit v1.2.3-70-g09d2