diff options
Diffstat (limited to 'vendor/librune/include')
| -rw-r--r-- | vendor/librune/include/builder.h | 31 | ||||
| -rw-r--r-- | vendor/librune/include/internal/common.h | 2 | ||||
| -rw-r--r-- | vendor/librune/include/internal/gbrk_lookup.h | 1 | ||||
| -rw-r--r-- | vendor/librune/include/internal/types.h | 8 | ||||
| -rw-r--r-- | vendor/librune/include/utf8.h | 2 | 
5 files changed, 39 insertions, 5 deletions
| diff --git a/vendor/librune/include/builder.h b/vendor/librune/include/builder.h new file mode 100644 index 0000000..b711f97 --- /dev/null +++ b/vendor/librune/include/builder.h @@ -0,0 +1,31 @@ +#ifndef RUNE_BUILDER_H +#define RUNE_BUILDER_H + +#define _RUNE_NEEDS_U8VIEW 1 +#include "internal/types.h" /* IWYU pragma: export */ + +struct u8buf { +	char8_t *p; +	size_t len, cap; +}; + +struct u8buf *u8strinit(struct u8buf *, size_t); +struct u8buf *u8strgrow(struct u8buf *, size_t); +struct u8buf *u8strfit(struct u8buf *); +void u8strfree(struct u8buf); + +struct u8buf *u8strpushr(struct u8buf *, rune); +struct u8buf *u8strpushstr(struct u8buf *, const char *); +struct u8buf *u8strpushu8(struct u8buf *, struct u8view); + +#if __STDC_VERSION__ >= 201112L +#	define u8strpush(b, x) \ +		_Generic((x), \ +		    char: u8strpushr, \ +		    int: u8strpushr, \ +		    rune: u8strpushr, \ +		    char *: u8strpushstr, \ +		    struct u8view: u8strpushu8)((b), (x)) +#endif + +#endif /* !RUNE_BUILDER_H */ diff --git a/vendor/librune/include/internal/common.h b/vendor/librune/include/internal/common.h index 7107528..af490d3 100644 --- a/vendor/librune/include/internal/common.h +++ b/vendor/librune/include/internal/common.h @@ -1,6 +1,8 @@  #ifndef RUNE_INTERNAL_COMMON_H  #define RUNE_INTERNAL_COMMON_H +/* IWYU pragma: private */ +  #if __STDC_VERSION__ >= 202311L  #	define RUNE_IS_23 1  #endif diff --git a/vendor/librune/include/internal/gbrk_lookup.h b/vendor/librune/include/internal/gbrk_lookup.h index 39dfa8e..043be97 100644 --- a/vendor/librune/include/internal/gbrk_lookup.h +++ b/vendor/librune/include/internal/gbrk_lookup.h @@ -5,6 +5,7 @@  #ifndef RUNE_INTERNAL_GBRK_LOOKUP_H  #define RUNE_INTERNAL_GBRK_LOOKUP_H +/* IWYU pragma: private */  /* clang-format off */  #include "types.h" diff --git a/vendor/librune/include/internal/types.h b/vendor/librune/include/internal/types.h index b2fa34c..b7ce6f1 100644 --- a/vendor/librune/include/internal/types.h +++ b/vendor/librune/include/internal/types.h @@ -1,5 +1,4 @@ -#ifndef RUNE_INTERNAL_TYPES_H -#define RUNE_INTERNAL_TYPES_H +/* IWYU pragma: private */  #include <stddef.h> /* IWYU pragma: export */  #include <stdint.h> @@ -8,10 +7,11 @@ typedef unsigned char char8_t;  typedef uint_least32_t rune;  #if _RUNE_NEEDS_U8VIEW +#	if !_RUNE_HAS_U8VIEW  struct u8view {  	const char8_t *p;  	size_t len;  }; +#		define _RUNE_HAS_U8VIEW 1 +#	endif  #endif - -#endif /* !RUNE_INTERNAL_TYPES_H */ diff --git a/vendor/librune/include/utf8.h b/vendor/librune/include/utf8.h index 0ebd745..1a91c24 100644 --- a/vendor/librune/include/utf8.h +++ b/vendor/librune/include/utf8.h @@ -18,7 +18,7 @@ int u8tor(rune *, const char8_t *);  int u8tor_uc(rune *, const char8_t *);  const char8_t *u8chk(const char8_t *, size_t); -bool u8chkr(rune); +_RUNE_UNSEQUENCED bool u8chkr(rune);  _RUNE_UNSEQUENCED int u8wdth(rune); |