mirror of
https://github.com/labwc/labwc.git
synced 2026-04-11 08:21:13 -04:00
key-state.c: generalize set operations
This commit is contained in:
parent
be18050479
commit
55e12f53fa
4 changed files with 84 additions and 62 deletions
19
include/common/set.h
Normal file
19
include/common/set.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_SET_H
|
||||
#define LABWC_SET_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define LAB_SET_MAX_SIZE 16
|
||||
|
||||
struct lab_set {
|
||||
uint32_t values[LAB_SET_MAX_SIZE];
|
||||
int size;
|
||||
};
|
||||
|
||||
bool lab_set_contains(struct lab_set *set, uint32_t value);
|
||||
void lab_set_add(struct lab_set *set, uint32_t value);
|
||||
void lab_set_remove(struct lab_set *set, uint32_t value);
|
||||
|
||||
#endif /* LABWC_SET_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue