block.h (720B)
1 #ifndef BLOCK_H 2 #define BLOCK_H 3 4 #include <stdbool.h> 5 #include <stdint.h> 6 #include <sys/types.h> 7 8 #include "config.h" 9 #include "util.h" 10 11 typedef struct { 12 const char *const icon; 13 const char *const command; 14 const unsigned int interval; 15 const int signal; 16 17 int pipe[PIPE_FD_COUNT]; 18 char output[MAX_BLOCK_OUTPUT_LENGTH * UTF8_MAX_BYTE_COUNT + 1]; 19 pid_t fork_pid; 20 } block; 21 22 block block_new(const char *const icon, const char *const command, 23 const unsigned int interval, const int signal); 24 int block_init(block *const block); 25 int block_deinit(block *const block); 26 int block_execute(block *const block, const uint8_t button); 27 int block_update(block *const block); 28 29 #endif // BLOCK_H