aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
AgeCommit message (Collapse)Author
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221
2019-09-10make the std lib support event-based I/OAndrew Kelley
also add -fstack-report
2019-08-20Fix InStream.readNoEofEuan Torano
2019-06-11temporarily simplify test_runner.zigAndrew Kelley
so that this branch can start passing behavior tests. after the tests pass, go back and undo the changes in this commit
2019-06-10altered all instances of readInt* in std.io (and std.debug) to consume the ↵tgschultz
minimum byte size required instead of @sizeOf().
2019-06-01fixed Deserializer.alignToByte() and added test coveragetgschultz
2019-05-26behavior tests passing on LinuxAndrew Kelley
2019-05-26clean up references to osAndrew Kelley
2019-05-26starting to fix the regressionsAndrew Kelley
2019-05-26do Jay's suggestion with posix/os API naming & layoutAndrew Kelley
2019-05-26extract posix functions from std/os.zig to std/os/posix.zigAndrew Kelley
See #2380
2019-05-19ran zig fmt on stdlibemekoi
2019-05-13Mmap debug info on linuxMarc Tiehuis
Closes #907.
2019-05-07Add missing cast to usizeLemonBoy
2019-05-03Address the comments of the first review roundLemonBoy
2019-04-28Make io offsets/sizes u64 instead of usizeLemonBoy
Decouple the concepts of address-space size and file size. Closes #637
2019-04-25add preliminary windows support to std.io.COutStreamAndrew Kelley
2019-04-25translate-c: a little closer to self-hosted implementationAndrew Kelley
2019-04-03Changes as suggested by andrewrktgschultz
2019-04-03(De)serializer now uses enum instead of bool to determine packing mode ↵tgschultz
(byte/bit). Optional is initialized in a more straight-forward way by deserializer.
2019-03-31fixed broken casts in stdemekoi
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-02-17fixupsAndrew Kelley
2019-02-16fix BufferedInStream not reading delayed inputsjdh02
2019-02-15breaking: fix @sizeOf to be alloc size rather than store sizeAndrew Kelley
* Fixes breaches of the guarantee that `@sizeOf(T) >= @alignOf(T)` * Fixes std.mem.secureZero for integers where this guarantee previously was breached * Fixes std.mem.Allocator for integers where this guarantee previously was breached Closes #1851 Closes #1864
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304
2019-02-06Fixed Serializer and BitOutStream when used with streams that have empty ↵tgschultz
error sets.
2019-02-03`std.mem.Allocator.create` replaced with better APIAndrew Kelley
`std.mem.Allocator.createOne` is renamed to `std.mem.Allocator.create`. The problem with the previous API is that even after copy elision, the initalization value passed as a parameter would always be a copy. With the new API, once copy elision is done, initialization functions can directly initialize allocated memory in place. Related: * #1872 * #1873
2019-02-01add compile errror for @bitCast when bit counts mismatchAndrew Kelley
fixes invalid LLVM IR from previous commit
2019-02-01Merge pull request #1775 from tgschultz/stdlib-serializationAndrew Kelley
Added serialization, bitstreams, traits for int sign, TagPayloadType, some fixes to std
2018-12-19std.io: call the idiomatic std.mem.readInt functionsAndrew Kelley
I originally called the Slice variants to work around comptime code not supporting `@ptrCast`, but I fixed that in 757d0665 so now the workaround is no longer needed.
2018-12-13add mem.readVarInt, fix InStream.readVarInt, fix stack tracesAndrew Kelley
fixes a regression from b883bc8
2018-12-13fix mistakes introduced in b883bc8Andrew Kelley
2018-12-12breaking API changes to all readInt/writeInt functions & moreAndrew Kelley
* 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-09Minor doc-comment fix.tgschultz
2018-12-09Minor change to custom (de)serializer to allow them to be defined outside of ↵tgschultz
the struct and aliased inside it. This will enable alternate generic serializers (i.e. one that follows pointers) on a struct-by-struct basis.
2018-12-02introduce std.io.SeekableStreamAndrew Kelley
Relevant #764 dwarf debug info is modified to use this instead of std.os.File directly to make it easier for bare metal projects to take advantage of debug info parsing
2018-11-30Fixed readBits to cast errors to the correct errorset. See #1810 for why ↵tgschultz
this wasn't caught earlier.
2018-11-30Increased range of bitwidths tested by "serialize/deserialize Int" tests. ↵tgschultz
Added tests for float inf and NaN.
2018-11-30Added serialization, bitstreams, traits for integer sign, TagPayloadTypetgschultz
2018-11-29Implemented new more flexible readLineFrom (#1801)Jimmi Holst Christensen
2018-11-15more fixes related to readStruct APIAndrew Kelley
2018-11-15Have readStruct in stream return a value instead of taking a pointerJimmi HC
2018-11-15Added NullOutStream and CountingOutStream (#1722)Jimmi Holst Christensen
2018-11-15zig fmt: add --check flagAndrew Kelley
closes #1558 closes #1555
2018-11-14io read/write int be/le optimizationsJosh Wolfe
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-31Merge branch 'add-test-for-atomic-Queue-dump' of ↵Andrew Kelley
https://github.com/winksaville/zig into winksaville-add-test-for-atomic-Queue-dump
2018-10-16std.io: fix compile error when InStream has empty error setAndrew Kelley
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}