X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fsubscribe.h;h=42caeb900a3fcaef9b4ce2977384c0c7a33e7730;hb=b0b8f8655b6837b9a8fe67d27388e1712568a328;hp=26771be0e38a2deff670a4ef243453fadcc114a8;hpb=c744b74bc9a946488983e7ea337d7fd3d96fb965;p=bspwm.git diff --git a/src/subscribe.h b/src/subscribe.h index 26771be..42caeb9 100644 --- a/src/subscribe.h +++ b/src/subscribe.h @@ -25,6 +25,8 @@ #ifndef BSPWM_SUBSCRIBE_H #define BSPWM_SUBSCRIBE_H +#define FIFO_TEMPLATE "bspwm_fifo.XXXXXX" + typedef enum { SBSC_MASK_REPORT = 1 << 0, SBSC_MASK_MONITOR_ADD = 1 << 1, @@ -41,8 +43,8 @@ typedef enum { SBSC_MASK_DESKTOP_FOCUS = 1 << 12, SBSC_MASK_DESKTOP_ACTIVATE = 1 << 13, SBSC_MASK_DESKTOP_LAYOUT = 1 << 14, - SBSC_MASK_NODE_MANAGE = 1 << 15, - SBSC_MASK_NODE_UNMANAGE = 1 << 16, + SBSC_MASK_NODE_ADD = 1 << 15, + SBSC_MASK_NODE_REMOVE = 1 << 16, SBSC_MASK_NODE_SWAP = 1 << 17, SBSC_MASK_NODE_TRANSFER = 1 << 18, SBSC_MASK_NODE_FOCUS = 1 << 19, @@ -56,14 +58,18 @@ typedef enum { SBSC_MASK_POINTER_ACTION = 1 << 27, SBSC_MASK_MONITOR = (1 << 7) - (1 << 1), SBSC_MASK_DESKTOP = (1 << 15) - (1 << 7), - SBSC_MASK_NODE = (1 << 28) - (1 << 15), + SBSC_MASK_NODE = (1 << 27) - (1 << 15), SBSC_MASK_ALL = (1 << 28) - 1 } subscriber_mask_t; -subscriber_list_t *make_subscriber_list(FILE *stream, int field, int count); +subscriber_list_t *make_subscriber(FILE *stream, char *fifo_path, int field, int count); void remove_subscriber(subscriber_list_t *sb); -void add_subscriber(FILE *stream, int field, int count); +void add_subscriber(subscriber_list_t *sb); int print_report(FILE *stream); void put_status(subscriber_mask_t mask, ...); +/* Remove any subscriber for which the stream has been closed and is no longer + * writable. */ +void prune_dead_subscribers(void); + #endif