libgrapheme

grapheme cluster utility library
git clone git://git.suckless.org/libgrapheme
Log | Files | Refs | LICENSE

util.h (544B)


      1 /* See LICENSE file for copyright and license details. */
      2 #ifndef UTIL_H
      3 #define UTIL_H
      4 
      5 #include <stddef.h>
      6 #include <stdint.h>
      7 
      8 #define LEN(x) (sizeof (x) / sizeof *(x))
      9 
     10 struct range {
     11 	uint32_t lower;
     12 	uint32_t upper;
     13 };
     14 
     15 struct range_list {
     16 	struct range *data;
     17 	size_t len;
     18 };
     19 
     20 /* 16-slot (0,...,15) optionally undetermined binary state */
     21 struct heisenstate {
     22 	uint_least16_t determined;
     23 	uint_least16_t state;
     24 };
     25 
     26 int heisenstate_get(struct heisenstate *, int);
     27 int heisenstate_set(struct heisenstate *, int, int);
     28 
     29 #endif /* UTIL_H */