diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:52:54 +0100 |
| commit | dcacc00e3750300617ba6e16eb346713f91a783a (patch) | |
| tree | 38e2d4fb5ed9d119711d4295c6eda4b014af73fd /examples/dte/encoding.h | |
| parent | 58dac10aeb8f5a041c46bddbeaf4c7966a99b998 (diff) | |
| download | crep-dcacc00e3750300617ba6e16eb346713f91a783a.tar.gz | |
Remove testing data
Diffstat (limited to 'examples/dte/encoding.h')
| -rw-r--r-- | examples/dte/encoding.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/examples/dte/encoding.h b/examples/dte/encoding.h deleted file mode 100644 index bb4cf67..0000000 --- a/examples/dte/encoding.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ENCODING_ENCODING_H -#define ENCODING_ENCODING_H - -#include <stdbool.h> -#include <stddef.h> -#include "util/macros.h" - -typedef enum { - UTF8, - UTF16BE, - UTF16LE, - UTF32BE, - UTF32LE, - UNKNOWN_ENCODING, - NR_ENCODING_TYPES, - - // This value is used by the "open" command to instruct other - // routines that no specific encoding was requested and that - // it should be detected instead. It is always replaced by - // some other value by the time a file is successfully opened. - ENCODING_AUTODETECT -} EncodingType; - -typedef struct { - EncodingType type; - // An interned encoding name compatible with iconv_open(3) - const char *name; -} Encoding; - -typedef struct { - const unsigned char bytes[4]; - unsigned int len; -} ByteOrderMark; - -static inline bool same_encoding(const Encoding *a, const Encoding *b) -{ - return a->type == b->type && a->name == b->name; -} - -Encoding encoding_from_type(EncodingType type); -Encoding encoding_from_name(const char *name) NONNULL_ARGS; -EncodingType lookup_encoding(const char *name) NONNULL_ARGS; -EncodingType detect_encoding_from_bom(const unsigned char *buf, size_t size); -const ByteOrderMark *get_bom_for_encoding(EncodingType encoding); - -#endif |
