From 81757c235ff8e112b4baabdd1ff23409426e9c98 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sun, 8 Jun 2025 22:00:43 +0200 Subject: update --- include/block.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/block.h (limited to 'include/block.h') diff --git a/include/block.h b/include/block.h new file mode 100644 index 0000000..c4f8d54 --- /dev/null +++ b/include/block.h @@ -0,0 +1,29 @@ +#ifndef BLOCK_H +#define BLOCK_H + +#include +#include +#include + +#include "config.h" +#include "util.h" + +typedef struct { + const char *const icon; + const char *const command; + const unsigned int interval; + const int signal; + + int pipe[PIPE_FD_COUNT]; + char output[MAX_BLOCK_OUTPUT_LENGTH * UTF8_MAX_BYTE_COUNT + 1]; + pid_t fork_pid; +} block; + +block block_new(const char *const icon, const char *const command, + const unsigned int interval, const int signal); +int block_init(block *const block); +int block_deinit(block *const block); +int block_execute(block *const block, const uint8_t button); +int block_update(block *const block); + +#endif // BLOCK_H -- cgit v1.2.3