0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/unicode.zig

948 lines
33 KiB

2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2018-01-31 22:48:40 -05:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2019-12-28 14:45:52 +11:00
2018-02-23 21:20:15 +13:00
2021-04-11 16:26:29 +02:00
2018-02-23 21:20:15 +13:00
2021-06-19 21:10:22 -04:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-12-01 02:14:17 -05:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-05-30 16:09:11 -04:00
2018-02-23 21:20:15 +13:00
2019-12-28 14:45:52 +11:00
2018-02-23 21:20:15 +13:00
2020-06-17 06:04:08 -05:00
2018-02-23 21:20:15 +13:00
2019-12-28 14:45:52 +11:00
2018-08-21 16:07:28 -04:00
2021-07-01 22:23:10 -06:00
2019-12-28 14:45:52 +11:00
2019-12-28 14:45:52 +11:00
2018-08-21 16:07:28 -04:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2019-12-28 14:45:52 +11:00
2021-05-04 20:47:26 +03:00
Full response file (*.rsp) support I hit the "quotes in an RSP file" issue when trying to compile gRPC using "zig cc". As a fun exercise, I decided to see if I could fix it myself. I'm fully open to this code being flat-out rejected. Or I can take feedback to fix it up. This modifies (and renames) _ArgIteratorWindows_ in process.zig such that it works with arbitrary strings (or the contents of an RSP file). In main.zig, this new _ArgIteratorGeneral_ is used to address the "TODO" listed in _ClangArgIterator_. This change closes #4833. **Pros:** - It has the nice attribute of handling "RSP file" arguments in the same way it handles "cmd_line" arguments. - High Performance, minimal allocations - Fixed bug in previous _ArgIteratorWindows_, where final trailing backslashes in a command line were entirely dropped - Added a test case for the above bug - Harmonized the _ArgIteratorXxxx._initWithAllocator()_ and _next()_ interface across Windows/Posix/Wasi (Moved Windows errors to _initWithAllocator()_ rather than _next()_) - Likely perf benefit on Windows by doing _utf16leToUtf8AllocZ()_ only once for the entire cmd_line **Cons:** - Breaking Change in std library on Windows: Call _ArgIterator.initWithAllocator()_ instead of _ArgIterator.init()_ - PhaseMage is new with contributions to Zig, might need a lot of hand-holding - PhaseMage is a Windows person, non-Windows stuff will need to be double-checked **Testing Done:** - Wrote a few new test cases in process.zig - zig.exe build test -Dskip-release (no new failures seen) - zig cc now builds gRPC without error
2022-01-30 11:27:52 -08:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
breaking API changes to all readInt/writeInt functions & more * add `@bswap` builtin function. See #767 * comptime evaluation facilities are improved to be able to handle a `@ptrCast` with a backing array. * `@truncate` allows "truncating" a u0 value to any integer type, and the result is always comptime known to be `0`. * when specifying pointer alignment in a type expression, the alignment value of pointers which do not have addresses at runtime is ignored, and always has the default/ABI alignment * threw in a fix to freebsd/x86_64.zig to update syntax from language changes * some improvements are pending #863 closes #638 closes #1733 std lib API changes * io.InStream().readIntNe renamed to readIntNative * io.InStream().readIntLe renamed to readIntLittle * io.InStream().readIntBe renamed to readIntBig * introduced io.InStream().readIntForeign * io.InStream().readInt has parameter order changed * io.InStream().readVarInt has parameter order changed * io.InStream().writeIntNe renamed to writeIntNative * introduced io.InStream().writeIntForeign * io.InStream().writeIntLe renamed to writeIntLittle * io.InStream().writeIntBe renamed to writeIntBig * io.InStream().writeInt has parameter order changed * mem.readInt has different parameters and semantics * introduced mem.readIntNative * introduced mem.readIntForeign * mem.readIntBE renamed to mem.readIntBig and different API * mem.readIntLE renamed to mem.readIntLittle and different API * introduced mem.readIntSliceNative * introduced mem.readIntSliceForeign * introduced mem.readIntSliceLittle * introduced mem.readIntSliceBig * introduced mem.readIntSlice * mem.writeInt has different parameters and semantics * introduced mem.writeIntNative * introduced mem.writeIntForeign * mem.writeIntBE renamed to mem.readIntBig and different semantics * mem.writeIntLE renamed to mem.readIntLittle and different semantics * introduced mem.writeIntSliceForeign * introduced mem.writeIntSliceNative * introduced mem.writeIntSliceBig * introduced mem.writeIntSliceLittle * introduced mem.writeIntSlice * removed mem.endianSwapIfLe * removed mem.endianSwapIfBe * removed mem.endianSwapIf * added mem.littleToNative * added mem.bigToNative * added mem.toNative * added mem.nativeTo * added mem.nativeToLittle * added mem.nativeToBig
2018-12-12 20:19:46 -05:00
2021-05-04 20:47:26 +03:00
2019-12-17 02:27:26 +05:00
2019-12-17 02:27:26 +05:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2019-12-17 02:27:26 +05:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2019-12-17 02:27:26 +05:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2019-12-17 02:27:26 +05:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00