mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Tweak WUFFS_BASE__RENDER_NUMBER_ETC bit values
This commit is contained in:
1 parent
6b7ce30e32
commit
6365fa30f4
3 files changed
+113
-15
No files matched your search
@@ -34,11 +34,11 @@
|
||||
// (higher indexes) of the destination slice, leaving any untouched bytes on
|
||||
// the left side (lower indexes). The default is vice versa: rendering on the
|
||||
// left with slack on the right.
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000001)
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000010)
|
||||
|
||||
// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN means to render the leading
|
||||
// "+" for non-negative numbers: "+0" and "+12.3" instead of "0" and "12.3".
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000002)
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000020)
|
||||
|
||||
// WUFFS_BASE__RENDER_NUMBER_FXX__DECIMAL_SEPARATOR_IS_A_COMMA means to render
|
||||
// one-and-a-half as "1,5" instead of "1.5".
|
||||
@@ -150,6 +150,10 @@ wuffs_base__ieee_754_bit_representation__to_f64(uint64_t u) {
|
||||
//
|
||||
// It is similar to wuffs_base__parse_number_u64 but it returns a signed
|
||||
// integer, not an unsigned integer. It also allows a leading '+' or '-'.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__result_i64 //
|
||||
wuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
|
||||
@@ -177,6 +181,10 @@ wuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
// - It does allow arbitrary underscores, except inside the optional 2-byte
|
||||
// opening "0d" or "0X" that denotes base-10 or base-16. For example,
|
||||
// "__0D_1_002" would successfully parse as "one thousand and two".
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__result_u64 //
|
||||
wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
|
||||
@@ -211,6 +219,10 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
//
|
||||
// Extreme values of x will be rendered as "NaN", "Inf" (or "+Inf" if the
|
||||
// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN option is set) or "-Inf".
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__F64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_f64(wuffs_base__slice_u8 dst,
|
||||
double x,
|
||||
@@ -223,6 +235,10 @@ wuffs_base__render_number_f64(wuffs_base__slice_u8 dst,
|
||||
//
|
||||
// dst will never be too short if its length is at least 20, also known as
|
||||
// WUFFS_BASE__I64__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_i64(wuffs_base__slice_u8 dst,
|
||||
int64_t x,
|
||||
@@ -234,6 +250,10 @@ wuffs_base__render_number_i64(wuffs_base__slice_u8 dst,
|
||||
//
|
||||
// dst will never be too short if its length is at least 21, also known as
|
||||
// WUFFS_BASE__U64__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_u64(wuffs_base__slice_u8 dst,
|
||||
uint64_t x,
|
||||
@@ -250,6 +270,10 @@ wuffs_base__render_number_u64(wuffs_base__slice_u8 dst,
|
||||
// It assumes that the src bytes are two hexadecimal digits (0-9, A-F, a-f),
|
||||
// repeated. It may write nonsense bytes if not, although it will not read or
|
||||
// write out of bounds.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,
|
||||
wuffs_base__slice_u8 src);
|
||||
@@ -263,6 +287,10 @@ wuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,
|
||||
// It assumes that the src bytes are two ignored bytes and then two hexadecimal
|
||||
// digits (0-9, A-F, a-f), repeated. It may write nonsense bytes if not,
|
||||
// although it will not read or write out of bounds.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__hexadecimal__decode4(wuffs_base__slice_u8 dst,
|
||||
wuffs_base__slice_u8 src);
|
||||
@@ -353,6 +381,10 @@ wuffs_base__utf_8__next__output::is_valid() const {
|
||||
//
|
||||
// s will never be too short if its length is at least 4, also known as
|
||||
// WUFFS_BASE__UTF_8__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);
|
||||
|
||||
@@ -376,11 +408,19 @@ wuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);
|
||||
// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single
|
||||
// code point, then this function may return something invalid. It is the
|
||||
// caller's responsibility to split on or otherwise manage UTF-8 boundaries.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //
|
||||
wuffs_base__utf_8__next(wuffs_base__slice_u8 s);
|
||||
|
||||
// wuffs_base__utf_8__next_from_end is like wuffs_base__utf_8__next except that
|
||||
// it looks at the end of s instead of the start.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //
|
||||
wuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);
|
||||
|
||||
@@ -393,6 +433,10 @@ wuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);
|
||||
// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single
|
||||
// code point, then this function will return less than s.len. It is the
|
||||
// caller's responsibility to split on or otherwise manage UTF-8 boundaries.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
|
||||
@@ -401,5 +445,9 @@ wuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
//
|
||||
// In particular, it returns s.len if and only if all of s is valid ASCII.
|
||||
// Equivalently, when none of the bytes in s have the 0x80 high bit set.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__ascii__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
+13
-11
@@ -486,7 +486,7 @@ const BaseStrConvPrivateH = "" +
|
||||
const BaseStrConvPublicH = "" +
|
||||
"// ---------------- String Conversions\n\n// Options (bitwise or'ed together) for wuffs_base__parse_number_xxx\n// functions. The XXX options apply to both integer and floating point. The FXX\n// options apply only to floating point.\n\n#define WUFFS_BASE__PARSE_NUMBER_XXX__DEFAULT_OPTIONS ((uint32_t)0x00000000)\n\n" +
|
||||
"" +
|
||||
"// --------\n\n// Options (bitwise or'ed together) for wuffs_base__render_number_xxx\n// functions. The XXX options apply to both integer and floating point. The FXX\n// options apply only to floating point.\n\n#define WUFFS_BASE__RENDER_NUMBER_XXX__DEFAULT_OPTIONS ((uint32_t)0x00000000)\n\n// WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT means to render to the right side\n// (higher indexes) of the destination slice, leaving any untouched bytes on\n// the left side (lower indexes). The default is vice versa: rendering on the\n// left with slack on the right.\n#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000001)\n\n// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN means to render the leading\n// \"+\" for non-negative numbers: \"+0\" and \"+12.3\" instead of \"0\" and \"12.3\".\n#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000002)\n\n// WUFFS_BASE__RENDER_NUMBER_FXX__DECIMAL_SEPARATOR_IS_A_COMMA means to render\n// one-and-a-half as \"1,5\" instead of \"1.5\".\n#define WUFFS_BASE__RENDER_NUMBER_F" +
|
||||
"// --------\n\n// Options (bitwise or'ed together) for wuffs_base__render_number_xxx\n// functions. The XXX options apply to both integer and floating point. The FXX\n// options apply only to floating point.\n\n#define WUFFS_BASE__RENDER_NUMBER_XXX__DEFAULT_OPTIONS ((uint32_t)0x00000000)\n\n// WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT means to render to the right side\n// (higher indexes) of the destination slice, leaving any untouched bytes on\n// the left side (lower indexes). The default is vice versa: rendering on the\n// left with slack on the right.\n#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000010)\n\n// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN means to render the leading\n// \"+\" for non-negative numbers: \"+0\" and \"+12.3\" instead of \"0\" and \"12.3\".\n#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000020)\n\n// WUFFS_BASE__RENDER_NUMBER_FXX__DECIMAL_SEPARATOR_IS_A_COMMA means to render\n// one-and-a-half as \"1,5\" instead of \"1.5\".\n#define WUFFS_BASE__RENDER_NUMBER_F" +
|
||||
"XX__DECIMAL_SEPARATOR_IS_A_COMMA \\\n ((uint32_t)0x00000100)\n\n// WUFFS_BASE__RENDER_NUMBER_FXX__EXPONENT_ETC means whether to never\n// (EXPONENT_ABSENT, equivalent to printf's \"%f\") or to always\n// (EXPONENT_PRESENT, equivalent to printf's \"%e\") render a floating point\n// number as \"1.23e+05\" instead of \"123000\".\n//\n// Having both bits set is the same has having neither bit set, where the\n// notation used depends on whether the exponent is sufficiently large: \"0.5\"\n// is preferred over \"5e-01\" but \"5e-09\" is preferred over \"0.000000005\".\n#define WUFFS_BASE__RENDER_NUMBER_FXX__EXPONENT_ABSENT ((uint32_t)0x00000200)\n#define WUFFS_BASE__RENDER_NUMBER_FXX__EXPONENT_PRESENT ((uint32_t)0x00000400)\n\n// WUFFS_BASE__RENDER_NUMBER_FXX__JUST_ENOUGH_PRECISION means to render the\n// smallest number of digits so that parsing the resultant string will recover\n// the same double-precision floating point number.\n//\n// For example, double-precision cannot distinguish between 0.3 and\n// 0.2999999999999999888977697537484345957636" +
|
||||
"83319091796875, so when this bit\n// is set, rendering the latter will produce \"0.3\" but rendering\n// 0.3000000000000000444089209850062616169452667236328125 will produce\n// \"0.30000000000000004\".\n#define WUFFS_BASE__RENDER_NUMBER_FXX__JUST_ENOUGH_PRECISION \\\n ((uint32_t)0x00000800)\n\n" +
|
||||
"" +
|
||||
@@ -496,16 +496,17 @@ const BaseStrConvPublicH = "" +
|
||||
"" +
|
||||
"// --------\n\n// wuffs_base__ieee_754_bit_representation__etc converts between a double\n// precision numerical value and its IEEE 754 64-bit representation (1 sign\n// bit, 11 exponent bits, 52 explicit significand bits).\n//\n// For example, it converts between:\n// - +1.0 and 0x3FF0_0000_0000_0000.\n// - +5.5 and 0x4016_0000_0000_0000.\n// - -inf and 0xFFF0_0000_0000_0000.\n//\n// See https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n\nstatic inline uint64_t //\nwuffs_base__ieee_754_bit_representation__from_f64(double f) {\n uint64_t u = 0;\n if (sizeof(uint64_t) == sizeof(double)) {\n memcpy(&u, &f, sizeof(uint64_t));\n }\n return u;\n}\n\nstatic inline double //\nwuffs_base__ieee_754_bit_representation__to_f64(uint64_t u) {\n double f = 0;\n if (sizeof(uint64_t) == sizeof(double)) {\n memcpy(&f, &u, sizeof(uint64_t));\n }\n return f;\n}\n\n" +
|
||||
"" +
|
||||
"// ---------------- Integer\n\n// wuffs_base__parse_number_i64 parses the ASCII integer in s. For example, if\n// s contains the bytes \"-123\" then it will return the int64_t -123.\n//\n// It returns an error if s does not contain an integer or if the integer\n// within would overflow an int64_t.\n//\n// It is similar to wuffs_base__parse_number_u64 but it returns a signed\n// integer, not an unsigned integer. It also allows a leading '+' or '-'.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__result_i64 //\nwuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);\n\n// wuffs_base__parse_number_u64 parses the ASCII integer in s. For example, if\n// s contains the bytes \"123\" then it will return the uint64_t 123.\n//\n// It returns an error if s does not contain an integer or if the integer\n// within would overflow a uint64_t.\n//\n// It is similar to the C standard library's strtoull function, but:\n// - Errors are returned in-band (in a result type), not out-of-band (errno).\n// - It takes a slice (a pointer and length)," +
|
||||
" not a NUL-terminated C string.\n// - It does not take an optional endptr argument. It does not allow a partial\n// parse: it returns an error unless all of s is consumed.\n// - It does not allow whitespace, leading or otherwise.\n// - It does not allow a leading '+' or '-'.\n// - It does not allow unnecessary leading zeroes (\"0\" is valid and its sole\n// zero is necessary). All of \"00\", \"0644\" and \"007\" are invalid.\n// - It does not take a base argument (e.g. base 10 vs base 16). Instead, it\n// always accepts both decimal (e.g \"1234\", \"0d5678\") and hexadecimal (e.g.\n// \"0x9aBC\"). The caller is responsible for prior filtering of e.g. hex\n// numbers if they are unwanted. For example, Wuffs' JSON decoder will only\n// produce a wuffs_base__token for decimal numbers, not hexadecimal.\n// - It is not affected by i18n / l10n settings such as environment variables.\n// - It does allow arbitrary underscores, except inside the optional 2-byte\n// opening \"0d\" or \"0X\" that denotes base-10 or base-16." +
|
||||
" For example,\n// \"__0D_1_002\" would successfully parse as \"one thousand and two\".\nWUFFS_BASE__MAYBE_STATIC wuffs_base__result_u64 //\nwuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);\n\n" +
|
||||
"// ---------------- Integer\n\n// wuffs_base__parse_number_i64 parses the ASCII integer in s. For example, if\n// s contains the bytes \"-123\" then it will return the int64_t -123.\n//\n// It returns an error if s does not contain an integer or if the integer\n// within would overflow an int64_t.\n//\n// It is similar to wuffs_base__parse_number_u64 but it returns a signed\n// integer, not an unsigned integer. It also allows a leading '+' or '-'.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__result_i64 //\nwuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);\n\n// wuffs_base__parse_number_u64 parses the ASCII integer in s. For example, if\n// s contains the bytes \"123\" then it will return the uint64_t 123.\n//\n// It returns an error if s does not contain an integer or if the integer\n// within would overflow a uint64" +
|
||||
"_t.\n//\n// It is similar to the C standard library's strtoull function, but:\n// - Errors are returned in-band (in a result type), not out-of-band (errno).\n// - It takes a slice (a pointer and length), not a NUL-terminated C string.\n// - It does not take an optional endptr argument. It does not allow a partial\n// parse: it returns an error unless all of s is consumed.\n// - It does not allow whitespace, leading or otherwise.\n// - It does not allow a leading '+' or '-'.\n// - It does not allow unnecessary leading zeroes (\"0\" is valid and its sole\n// zero is necessary). All of \"00\", \"0644\" and \"007\" are invalid.\n// - It does not take a base argument (e.g. base 10 vs base 16). Instead, it\n// always accepts both decimal (e.g \"1234\", \"0d5678\") and hexadecimal (e.g.\n// \"0x9aBC\"). The caller is responsible for prior filtering of e.g. hex\n// numbers if they are unwanted. For example, Wuffs' JSON decoder will only\n// produce a wuffs_base__token for decimal numbers, not hexadecimal.\n// - It is not" +
|
||||
" affected by i18n / l10n settings such as environment variables.\n// - It does allow arbitrary underscores, except inside the optional 2-byte\n// opening \"0d\" or \"0X\" that denotes base-10 or base-16. For example,\n// \"__0D_1_002\" would successfully parse as \"one thousand and two\".\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__result_u64 //\nwuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);\n\n" +
|
||||
"" +
|
||||
"// --------\n\n#define WUFFS_BASE__I64__BYTE_LENGTH__MAX_INCL 20\n#define WUFFS_BASE__U64__BYTE_LENGTH__MAX_INCL 21\n\n// wuffs_base__render_number_f64 writes the decimal encoding of x to dst and\n// returns the number of bytes written. If dst is shorter than the entire\n// encoding, it returns 0 (and no bytes are written).\n//\n// For those familiar with C's printf or Go's fmt.Printf functions:\n// - \"%e\" means the WUFFS_BASE__RENDER_NUMBER_FXX__EXPONENT_PRESENT option.\n// - \"%f\" means the WUFFS_BASE__RENDER_NUMBER_FXX__EXPONENT_ABSENT option.\n// - \"%g\" means neither or both bits are set.\n//\n// The precision argument controls the number of digits rendered, excluding the\n// exponent (the \"e+05\" in \"1.23e+05\"):\n// - for \"%e\" and \"%f\" it is the number of digits after the decimal separator,\n// - for \"%g\" it is the number of significant digits (and trailing zeroes are\n// removed).\n//\n// A precision of 6 gives similar output to printf's defaults.\n//\n// A precision greater than 4095 is equivalent to 4095.\n//\n// The " +
|
||||
"precision argument is ignored when the\n// WUFFS_BASE__RENDER_NUMBER_FXX__JUST_ENOUGH_PRECISION option is set. This is\n// similar to Go's strconv.FormatFloat with a negative (i.e. non-sensical)\n// precision, but there is no corresponding feature in C's printf.\n//\n// Extreme values of x will be rendered as \"NaN\", \"Inf\" (or \"+Inf\" if the\n// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN option is set) or \"-Inf\".\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__render_number_f64(wuffs_base__slice_u8 dst,\n double x,\n uint32_t precision,\n uint32_t options);\n\n// wuffs_base__render_number_i64 writes the decimal encoding of x to dst and\n// returns the number of bytes written. If dst is shorter than the entire\n// encoding, it returns 0 (and no bytes are written).\n//\n// dst will never be too short if its length is at least 20, also known as\n// WUFFS_BASE__I64__BYTE_LENGTH__MAX_INCL.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__ren" +
|
||||
"der_number_i64(wuffs_base__slice_u8 dst,\n int64_t x,\n uint32_t options);\n\n// wuffs_base__render_number_u64 writes the decimal encoding of x to dst and\n// returns the number of bytes written. If dst is shorter than the entire\n// encoding, it returns 0 (and no bytes are written).\n//\n// dst will never be too short if its length is at least 21, also known as\n// WUFFS_BASE__U64__BYTE_LENGTH__MAX_INCL.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__render_number_u64(wuffs_base__slice_u8 dst,\n uint64_t x,\n uint32_t options);\n\n" +
|
||||
"precision argument is ignored when the\n// WUFFS_BASE__RENDER_NUMBER_FXX__JUST_ENOUGH_PRECISION option is set. This is\n// similar to Go's strconv.FormatFloat with a negative (i.e. non-sensical)\n// precision, but there is no corresponding feature in C's printf.\n//\n// Extreme values of x will be rendered as \"NaN\", \"Inf\" (or \"+Inf\" if the\n// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN option is set) or \"-Inf\".\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__F64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__render_number_f64(wuffs_base__slice_u8 dst,\n double x,\n uint32_t precision,\n uint32_t options);\n\n// wuffs_base__render_number_i64 writes the decimal encoding of x to dst and\n// returns the number of bytes written. If dst is shorter than the entire\n// encoding, it returns 0" +
|
||||
" (and no bytes are written).\n//\n// dst will never be too short if its length is at least 20, also known as\n// WUFFS_BASE__I64__BYTE_LENGTH__MAX_INCL.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__render_number_i64(wuffs_base__slice_u8 dst,\n int64_t x,\n uint32_t options);\n\n// wuffs_base__render_number_u64 writes the decimal encoding of x to dst and\n// returns the number of bytes written. If dst is shorter than the entire\n// encoding, it returns 0 (and no bytes are written).\n//\n// dst will never be too short if its length is at least 21, also known as\n// WUFFS_BASE__U64__BYTE_LENGTH__MAX_INCL.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// ju" +
|
||||
"st WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__render_number_u64(wuffs_base__slice_u8 dst,\n uint64_t x,\n uint32_t options);\n\n" +
|
||||
"" +
|
||||
"// ---------------- Hexadecimal\n\n// wuffs_base__hexadecimal__decode2 converts \"6A6b\" to \"jk\", where e.g. 'j' is\n// U+006A. There are 2 source bytes for every destination byte.\n//\n// It returns the number of dst bytes written: the minimum of dst.len and\n// (src.len / 2). Excess source bytes are ignored.\n//\n// It assumes that the src bytes are two hexadecimal digits (0-9, A-F, a-f),\n// repeated. It may write nonsense bytes if not, although it will not read or\n// write out of bounds.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,\n wuffs_base__slice_u8 src);\n\n// wuffs_base__hexadecimal__decode4 converts \"\\\\x6A\\\\x6b\" to \"jk\", where e.g.\n// 'j' is U+006A. There are 4 source bytes for every destination byte.\n//\n// It returns the number of dst bytes written: the minimum of dst.len and\n// (src.len / 4). Excess source bytes are ignored.\n//\n// It assumes that the src bytes are two ignored bytes and then two hexadecimal\n// digits (0-9, A-F, a" +
|
||||
"-f), repeated. It may write nonsense bytes if not,\n// although it will not read or write out of bounds.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__hexadecimal__decode4(wuffs_base__slice_u8 dst,\n wuffs_base__slice_u8 src);\n\n" +
|
||||
"// ---------------- Hexadecimal\n\n// wuffs_base__hexadecimal__decode2 converts \"6A6b\" to \"jk\", where e.g. 'j' is\n// U+006A. There are 2 source bytes for every destination byte.\n//\n// It returns the number of dst bytes written: the minimum of dst.len and\n// (src.len / 2). Excess source bytes are ignored.\n//\n// It assumes that the src bytes are two hexadecimal digits (0-9, A-F, a-f),\n// repeated. It may write nonsense bytes if not, although it will not read or\n// write out of bounds.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,\n wuffs_base__slice_u8 src);\n\n// wuffs_base__hexadecimal__decode4 converts \"\\\\x6A\\\\x6b\" to \"jk\", where e.g.\n// 'j' is U+006A. There are 4 source bytes for every destination byte.\n//\n// It returns the number of d" +
|
||||
"st bytes written: the minimum of dst.len and\n// (src.len / 4). Excess source bytes are ignored.\n//\n// It assumes that the src bytes are two ignored bytes and then two hexadecimal\n// digits (0-9, A-F, a-f), repeated. It may write nonsense bytes if not,\n// although it will not read or write out of bounds.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not\n// just WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__hexadecimal__decode4(wuffs_base__slice_u8 dst,\n wuffs_base__slice_u8 src);\n\n" +
|
||||
"" +
|
||||
"// ---------------- Unicode and UTF-8\n\n#define WUFFS_BASE__UNICODE_CODE_POINT__MIN_INCL 0x00000000\n#define WUFFS_BASE__UNICODE_CODE_POINT__MAX_INCL 0x0010FFFF\n\n#define WUFFS_BASE__UNICODE_REPLACEMENT_CHARACTER 0x0000FFFD\n\n#define WUFFS_BASE__UNICODE_SURROGATE__MIN_INCL 0x0000D800\n#define WUFFS_BASE__UNICODE_SURROGATE__MAX_INCL 0x0000DFFF\n\n#define WUFFS_BASE__ASCII__MIN_INCL 0x00\n#define WUFFS_BASE__ASCII__MAX_INCL 0x7F\n\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH__MIN_INCL 1\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH__MAX_INCL 4\n\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_1__CODE_POINT__MIN_INCL 0x00000000\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_1__CODE_POINT__MAX_INCL 0x0000007F\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_2__CODE_POINT__MIN_INCL 0x00000080\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_2__CODE_POINT__MAX_INCL 0x000007FF\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_3__CODE_POINT__MIN_INCL 0x00000800\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_3__CODE_POINT__MAX_INCL 0x0000FFFF\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_4__CODE_POINT_" +
|
||||
"_MIN_INCL 0x00010000\n#define WUFFS_BASE__UTF_8__BYTE_LENGTH_4__CODE_POINT__MAX_INCL 0x0010FFFF\n\n" +
|
||||
@@ -513,9 +514,10 @@ const BaseStrConvPublicH = "" +
|
||||
"// --------\n\n// wuffs_base__utf_8__next__output is the type returned by\n// wuffs_base__utf_8__next.\ntypedef struct {\n uint32_t code_point;\n uint32_t byte_length;\n\n#ifdef __cplusplus\n inline bool is_valid() const;\n#endif // __cplusplus\n\n} wuffs_base__utf_8__next__output;\n\nstatic inline wuffs_base__utf_8__next__output //\nwuffs_base__make_utf_8__next__output(uint32_t code_point,\n uint32_t byte_length) {\n wuffs_base__utf_8__next__output ret;\n ret.code_point = code_point;\n ret.byte_length = byte_length;\n return ret;\n}\n\nstatic inline bool //\nwuffs_base__utf_8__next__output__is_valid(\n const wuffs_base__utf_8__next__output* o) {\n if (o) {\n uint32_t cp = o->code_point;\n switch (o->byte_length) {\n case 1:\n return (cp <= 0x7F);\n case 2:\n return (0x080 <= cp) && (cp <= 0x7FF);\n case 3:\n // Avoid the 0xD800 ..= 0xDFFF surrogate range.\n return ((0x0800 <= cp) && (cp <= 0xD7FF)) ||\n ((0xE000 <= cp) && (cp <= 0xF" +
|
||||
"FFF));\n case 4:\n return (0x00010000 <= cp) && (cp <= 0x0010FFFF);\n }\n }\n return false;\n}\n\n#ifdef __cplusplus\n\ninline bool //\nwuffs_base__utf_8__next__output::is_valid() const {\n return wuffs_base__utf_8__next__output__is_valid(this);\n}\n\n#endif // __cplusplus\n\n" +
|
||||
"" +
|
||||
"// --------\n\n// wuffs_base__utf_8__encode writes the UTF-8 encoding of code_point to s and\n// returns the number of bytes written. If code_point is invalid, or if s is\n// shorter than the entire encoding, it returns 0 (and no bytes are written).\n//\n// s will never be too short if its length is at least 4, also known as\n// WUFFS_BASE__UTF_8__BYTE_LENGTH__MAX_INCL.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);\n\n// wuffs_base__utf_8__next returns the next UTF-8 code point (and that code\n// point's byte length) at the start of s.\n//\n// There are exactly two cases in which this function returns something where\n// wuffs_base__utf_8__next__output__is_valid is false:\n// - If s is empty then it returns {.code_point=0, .byte_length=0}.\n// - If s is non-empty and starts with invalid UTF-8 then it returns\n// {.code_point=WUFFS_BASE__UNICODE_REPLACEMENT_CHARACTER, .byte_length=1}.\n//\n// Otherwise, it returns something where\n// wuffs_base__utf_8__next__ou" +
|
||||
"tput__is_valid is true.\n//\n// In any case, it always returns an output that satisfies both of:\n// - (output.code_point <= WUFFS_BASE__UNICODE_CODE_POINT__MAX_INCL).\n// - (output.byte_length <= s.len).\n//\n// If s is a sub-slice of a larger slice of valid UTF-8, but that sub-slice\n// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single\n// code point, then this function may return something invalid. It is the\n// caller's responsibility to split on or otherwise manage UTF-8 boundaries.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //\nwuffs_base__utf_8__next(wuffs_base__slice_u8 s);\n\n// wuffs_base__utf_8__next_from_end is like wuffs_base__utf_8__next except that\n// it looks at the end of s instead of the start.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //\nwuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);\n\n// wuffs_base__utf_8__longest_valid_prefix returns the largest n such that the\n// sub-slice s[..n] is valid UTF-8.\n//\n// In particular, it returns s.len " +
|
||||
"if and only if all of s is valid UTF-8.\n//\n// If s is a sub-slice of a larger slice of valid UTF-8, but that sub-slice\n// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single\n// code point, then this function will return less than s.len. It is the\n// caller's responsibility to split on or otherwise manage UTF-8 boundaries.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);\n\n// wuffs_base__ascii__longest_valid_prefix returns the largest n such that the\n// sub-slice s[..n] is valid ASCII.\n//\n// In particular, it returns s.len if and only if all of s is valid ASCII.\n// Equivalently, when none of the bytes in s have the 0x80 high bit set.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__ascii__longest_valid_prefix(wuffs_base__slice_u8 s);\n" +
|
||||
"// --------\n\n// wuffs_base__utf_8__encode writes the UTF-8 encoding of code_point to s and\n// returns the number of bytes written. If code_point is invalid, or if s is\n// shorter than the entire encoding, it returns 0 (and no bytes are written).\n//\n// s will never be too short if its length is at least 4, also known as\n// WUFFS_BASE__UTF_8__BYTE_LENGTH__MAX_INCL.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just\n// WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);\n\n// wuffs_base__utf_8__next returns the next UTF-8 code point (and that code\n// point's byte length) at the start of s.\n//\n// There are exactly two cases in which this function returns something where\n// wuffs_base__utf_8__next__output__is_valid is false:\n// - If s is empty then it returns {.code_point=0, .byte_length=0}.\n// - If s is non-empty a" +
|
||||
"nd starts with invalid UTF-8 then it returns\n// {.code_point=WUFFS_BASE__UNICODE_REPLACEMENT_CHARACTER, .byte_length=1}.\n//\n// Otherwise, it returns something where\n// wuffs_base__utf_8__next__output__is_valid is true.\n//\n// In any case, it always returns an output that satisfies both of:\n// - (output.code_point <= WUFFS_BASE__UNICODE_CODE_POINT__MAX_INCL).\n// - (output.byte_length <= s.len).\n//\n// If s is a sub-slice of a larger slice of valid UTF-8, but that sub-slice\n// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single\n// code point, then this function may return something invalid. It is the\n// caller's responsibility to split on or otherwise manage UTF-8 boundaries.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just\n// WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //\nwuffs_base__utf_8__next(wuffs_base__slice_u8 s);\n\n// wuff" +
|
||||
"s_base__utf_8__next_from_end is like wuffs_base__utf_8__next except that\n// it looks at the end of s instead of the start.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just\n// WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //\nwuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);\n\n// wuffs_base__utf_8__longest_valid_prefix returns the largest n such that the\n// sub-slice s[..n] is valid UTF-8.\n//\n// In particular, it returns s.len if and only if all of s is valid UTF-8.\n//\n// If s is a sub-slice of a larger slice of valid UTF-8, but that sub-slice\n// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single\n// code point, then this function will return less than s.len. It is the\n// caller's responsibility to split on or otherwise manage UTF-8 boundaries.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// " +
|
||||
"function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just\n// WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);\n\n// wuffs_base__ascii__longest_valid_prefix returns the largest n such that the\n// sub-slice s[..n] is valid ASCII.\n//\n// In particular, it returns s.len if and only if all of s is valid ASCII.\n// Equivalently, when none of the bytes in s have the 0x80 high bit set.\n//\n// For modular builds that divide the base module into sub-modules, using this\n// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just\n// WUFFS_CONFIG__MODULE__BASE__CORE.\nWUFFS_BASE__MAYBE_STATIC size_t //\nwuffs_base__ascii__longest_valid_prefix(wuffs_base__slice_u8 s);\n" +
|
||||
""
|
||||
|
||||
const BaseTokenPrivateH = "" +
|
||||
|
||||
@@ -3940,11 +3940,11 @@ wuffs_base__pixel_swizzler::swizzle_interleaved_from_slice(
|
||||
// (higher indexes) of the destination slice, leaving any untouched bytes on
|
||||
// the left side (lower indexes). The default is vice versa: rendering on the
|
||||
// left with slack on the right.
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000001)
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__ALIGN_RIGHT ((uint32_t)0x00000010)
|
||||
|
||||
// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN means to render the leading
|
||||
// "+" for non-negative numbers: "+0" and "+12.3" instead of "0" and "12.3".
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000002)
|
||||
#define WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN ((uint32_t)0x00000020)
|
||||
|
||||
// WUFFS_BASE__RENDER_NUMBER_FXX__DECIMAL_SEPARATOR_IS_A_COMMA means to render
|
||||
// one-and-a-half as "1,5" instead of "1.5".
|
||||
@@ -4056,6 +4056,10 @@ wuffs_base__ieee_754_bit_representation__to_f64(uint64_t u) {
|
||||
//
|
||||
// It is similar to wuffs_base__parse_number_u64 but it returns a signed
|
||||
// integer, not an unsigned integer. It also allows a leading '+' or '-'.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__result_i64 //
|
||||
wuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
|
||||
@@ -4083,6 +4087,10 @@ wuffs_base__parse_number_i64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
// - It does allow arbitrary underscores, except inside the optional 2-byte
|
||||
// opening "0d" or "0X" that denotes base-10 or base-16. For example,
|
||||
// "__0D_1_002" would successfully parse as "one thousand and two".
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__result_u64 //
|
||||
wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
|
||||
@@ -4117,6 +4125,10 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options);
|
||||
//
|
||||
// Extreme values of x will be rendered as "NaN", "Inf" (or "+Inf" if the
|
||||
// WUFFS_BASE__RENDER_NUMBER_XXX__LEADING_PLUS_SIGN option is set) or "-Inf".
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__F64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_f64(wuffs_base__slice_u8 dst,
|
||||
double x,
|
||||
@@ -4129,6 +4141,10 @@ wuffs_base__render_number_f64(wuffs_base__slice_u8 dst,
|
||||
//
|
||||
// dst will never be too short if its length is at least 20, also known as
|
||||
// WUFFS_BASE__I64__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_i64(wuffs_base__slice_u8 dst,
|
||||
int64_t x,
|
||||
@@ -4140,6 +4156,10 @@ wuffs_base__render_number_i64(wuffs_base__slice_u8 dst,
|
||||
//
|
||||
// dst will never be too short if its length is at least 21, also known as
|
||||
// WUFFS_BASE__U64__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__render_number_u64(wuffs_base__slice_u8 dst,
|
||||
uint64_t x,
|
||||
@@ -4156,6 +4176,10 @@ wuffs_base__render_number_u64(wuffs_base__slice_u8 dst,
|
||||
// It assumes that the src bytes are two hexadecimal digits (0-9, A-F, a-f),
|
||||
// repeated. It may write nonsense bytes if not, although it will not read or
|
||||
// write out of bounds.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,
|
||||
wuffs_base__slice_u8 src);
|
||||
@@ -4169,6 +4193,10 @@ wuffs_base__hexadecimal__decode2(wuffs_base__slice_u8 dst,
|
||||
// It assumes that the src bytes are two ignored bytes and then two hexadecimal
|
||||
// digits (0-9, A-F, a-f), repeated. It may write nonsense bytes if not,
|
||||
// although it will not read or write out of bounds.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__I64CONV sub-module, not
|
||||
// just WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__hexadecimal__decode4(wuffs_base__slice_u8 dst,
|
||||
wuffs_base__slice_u8 src);
|
||||
@@ -4259,6 +4287,10 @@ wuffs_base__utf_8__next__output::is_valid() const {
|
||||
//
|
||||
// s will never be too short if its length is at least 4, also known as
|
||||
// WUFFS_BASE__UTF_8__BYTE_LENGTH__MAX_INCL.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);
|
||||
|
||||
@@ -4282,11 +4314,19 @@ wuffs_base__utf_8__encode(wuffs_base__slice_u8 dst, uint32_t code_point);
|
||||
// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single
|
||||
// code point, then this function may return something invalid. It is the
|
||||
// caller's responsibility to split on or otherwise manage UTF-8 boundaries.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //
|
||||
wuffs_base__utf_8__next(wuffs_base__slice_u8 s);
|
||||
|
||||
// wuffs_base__utf_8__next_from_end is like wuffs_base__utf_8__next except that
|
||||
// it looks at the end of s instead of the start.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC wuffs_base__utf_8__next__output //
|
||||
wuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);
|
||||
|
||||
@@ -4299,6 +4339,10 @@ wuffs_base__utf_8__next_from_end(wuffs_base__slice_u8 s);
|
||||
// boundary occurs in the middle of a multi-byte UTF-8 encoding of a single
|
||||
// code point, then this function will return less than s.len. It is the
|
||||
// caller's responsibility to split on or otherwise manage UTF-8 boundaries.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
|
||||
@@ -4307,6 +4351,10 @@ wuffs_base__utf_8__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
//
|
||||
// In particular, it returns s.len if and only if all of s is valid ASCII.
|
||||
// Equivalently, when none of the bytes in s have the 0x80 high bit set.
|
||||
//
|
||||
// For modular builds that divide the base module into sub-modules, using this
|
||||
// function requires the WUFFS_CONFIG__MODULE__BASE__UTF8 sub-module, not just
|
||||
// WUFFS_CONFIG__MODULE__BASE__CORE.
|
||||
WUFFS_BASE__MAYBE_STATIC size_t //
|
||||
wuffs_base__ascii__longest_valid_prefix(wuffs_base__slice_u8 s);
|
||||
|
||||
|
||||
Reference in new issue
Block a user