dwmblocks-custom/include/signal-handler.h

31 lines
1.0 KiB
C
Raw Normal View History

#pragma once
#include <bits/types/sigset_t.h>
2023-10-25 16:30:08 +02:00
#include "block.h"
#include "timer.h"
typedef sigset_t signal_set;
2023-10-25 16:30:08 +02:00
typedef int (*signal_refresh_callback)(block* const blocks,
const unsigned short block_count);
typedef int (*signal_timer_callback)(block* const blocks,
const unsigned short block_code,
timer* const timer);
typedef struct {
int fd;
const signal_refresh_callback refresh_callback;
const signal_timer_callback timer_callback;
2023-10-25 16:30:08 +02:00
block* const blocks;
const unsigned short block_count;
} signal_handler;
signal_handler signal_handler_new(
2023-10-25 16:30:08 +02:00
block* const blocks, const unsigned short block_count,
const signal_refresh_callback refresh_callback,
const signal_timer_callback timer_callback);
int signal_handler_init(signal_handler* const handler);
int signal_handler_deinit(signal_handler* const handler);
int signal_handler_process(signal_handler* const handler, timer* const timer);