mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 02:38:55 -06:00
started an official API to the C runtime
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include <gu/exn.h>
|
||||
#include <gu/assert.h>
|
||||
|
||||
|
||||
#if defined(__STDC_ISO_10646__) && WCHAR_MAX >= 0x10FFFF
|
||||
#include <wchar.h>
|
||||
#define GU_UCS_WCHAR
|
||||
@@ -25,19 +24,8 @@ gu_ucs_valid(GuUCS ucs)
|
||||
return ucs >= 0 && ucs <= GU_UCS_MAX;
|
||||
}
|
||||
|
||||
inline GuUCS
|
||||
gu_char_ucs(char c)
|
||||
{
|
||||
gu_require(gu_char_is_valid(c));
|
||||
#ifdef CHAR_ASCII
|
||||
GuUCS u = (GuUCS) c;
|
||||
#else
|
||||
extern const uint8_t gu_ucs_ascii_reverse_[CHAR_MAX];
|
||||
GuUCS u = gu_ucs_ascii_reverse_[(unsigned char) c];
|
||||
#endif
|
||||
gu_ensure(u < 0x80);
|
||||
return u;
|
||||
}
|
||||
GuUCS
|
||||
gu_char_ucs(char c);
|
||||
|
||||
char
|
||||
gu_ucs_char(GuUCS uc, GuExn* err);
|
||||
|
||||
Reference in New Issue
Block a user