[*] Initial commit

This commit is contained in:
Lorenzo Cogotti
2021-06-07 16:55:13 +02:00
commit b0ef4dd774
117 changed files with 29737 additions and 0 deletions

27
lonetix/include/df/utf/utfdef.h Executable file
View File

@@ -0,0 +1,27 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
/**
* \file utf/utfdef.h
*
* UTF-8 types and macro constants definitions.
*
* \copyright The DoubleFourteen Code Forge (C) All Rights Reserved
* \author Lorenzo Cogotti
*/
#ifndef DF_UTFDEF_H_
#define DF_UTFDEF_H_
#include "xpt.h"
/// 32-bits unsigned type capable of holding any UTF-8 character.
typedef Uint32 Rune;
#define MAXUTF 4u ///< Maximum bytes per `Rune`
#define RUNE_SYNC 0x80 ///< Cannot represent part of a UTF sequence (<)
#define RUNE_SELF 0x80 ///< `Rune` and UTF sequences are the same (<)
#define RUNE_ERR 0xfffdu ///< Decoding error in UTF
#define MAXRUNE 0x10ffffu ///< Maximum `Rune` value
#define BOM 0xefbbbfu ///< UTF-8 BOM marker
#endif