libgrapheme

unicode string library
git clone git://git.suckless.org/libgrapheme
Log | Files | Refs | README | LICENSE

util.h (954B)


      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 #include "types.h"
      9 
     10 #define LEN(x) (sizeof (x) / sizeof *(x))
     11 
     12 struct property_spec {
     13 	const char *enumname;
     14 	const char *file;
     15 	const char *ucdname;
     16 };
     17 
     18 struct properties {
     19 	uint_least8_t break_property;
     20 };
     21 
     22 void parse_file_with_callback(const char *, int (*callback)(const char *,
     23                               char **, size_t, char *, void *), void *payload);
     24 
     25 void properties_generate_break_property(const struct property_spec *,
     26                                         uint_least8_t, const char *,
     27                                         const char *);
     28 
     29 void break_test_list_parse(char *, struct break_test **, size_t *);
     30 void break_test_list_print(const struct break_test *, size_t,
     31                              const char *, const char *);
     32 void break_test_list_free(struct break_test *, size_t);
     33 
     34 #endif /* UTIL_H */