utf32 support

John Howard echosoft.llc at gmail.com
Sat Apr 6 05:44:19 UTC 2024


---

testsuites/samples/utf32/utf32.h | 45 +-

1 file changed, 45 insertions(+), 0 deletion(-)

create mode 100644 testsuites/samples/utf32/utf32.h



diff --git a/testsuites/samples/utf32/utf32.h b/testsuites/samples/utf32/utf32.h

index 83f6342ab3..5ebcdc9ef2 100644

--- /dev/null

+++ b/testsuites/samples/utf32/utf32.h

@@ -0,0 +1,45 @@

+/*

+ Copyright 2024 John Howard

+ All Rights Reserved.

+ CUBITS is a trademark of John Howard.

+ CUBITS means Capital, Underline, Bold, Italic, Texture, and Strike.

+

+ This file is part of the RTEMS.org test suites samples.

+

+ Permission to use, copy, modify, and/or distribute this software for any

+ purpose with or without fee is hereby granted, provided that the above

+ copyright notice and this permission notice appear in all copies.

+

+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF

+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR

+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES

+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN

+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+*/

+

+/* Unicode & ISO 10646-2012 character ranges 0..\UFFFFFFFF. */

+typedef int utf32;

+

+/* Convert UTF32 Big Endian and Little Endian v ranges 0..0xFFFFFFFF. */

+#define CONVERT_(v) ((((v) & 255) << 24) | ((((v) >> 8) & 255) << 16) | \

+                   ((((v) >> 16) & 255) << 8) | (((v) >> 24) & 255))

+

+/* Set zero-based nth bit of v ranges 0..0xFFFFFFFF. n ranges 0..31. */

+#define SETBIT_(v,n) ((v) |= (1 << (n)))

+

+/* Unset zero-based nth bit of v ranges 0..0xFFFFFFFF. n ranges 0..31. */

+#define UNSETBIT_(v,n) ((v) &= ~(1 << (n)))

+

+/* Test zero-based nth bit of v ranges 0..0xFFFFFFFF. n ranges 0..31. */

+#define TESTBIT_(v,n) (((v) & (1 << (n))) != 0)

+

+/* Unicode & ISO 10646-2012 codepoint v ranges 0..0x10FFFF. */

+#define CODEPOINT_(v) ((v) &= 0x1FFFFF; (((v) > 0x10FFFF) ? ((v) & 0xFFFF) : (v))

+

+/* CUBITS model: VGA, CGA, Custom, Texture, Cloudy, Glory, Shiny, Fiery. */

+#define SETMODEL_(v,m) ((v) |= ((m) << 21))

+

+/* CUBITS Texture ranges 0..255: VGA color index, CGA text attributes. */

+#define SETTEXTURE_(v,m) ((v) |= ((m) << 24))

-- 

2.42.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240406/0e0f98dc/attachment.htm>


More information about the devel mailing list