diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-12 12:40:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-12 12:40:16 -0400 |
| commit | 0cfd019377c4e91924d8f57a4c7400a2d62f8751 (patch) | |
| tree | 9c62a0569648d505233743409fade82e0f36b172 /src/util.hpp | |
| parent | 7bd8a2695b5fe0b1993003c0c6e02cb99de5ab33 (diff) | |
| parent | 3a49d115cf38154f0094d9615334529890059006 (diff) | |
| download | zig-0cfd019377c4e91924d8f57a4c7400a2d62f8751.tar.gz zig-0cfd019377c4e91924d8f57a4c7400a2d62f8751.zip | |
Merge pull request #1494 from ziglang/stage1-caching
stage1 caching
Diffstat (limited to 'src/util.hpp')
| -rw-r--r-- | src/util.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.hpp b/src/util.hpp index 1e02e3043c..f18c369fb5 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -254,4 +254,16 @@ static inline void memCopy(Slice<T> dest, Slice<T> src) { memcpy(dest.ptr, src.ptr, src.len * sizeof(T)); } +// Ported from std/mem.zig. +// Coordinate struct fields with memSplit function +struct SplitIterator { + size_t index; + Slice<uint8_t> buffer; + Slice<uint8_t> split_bytes; +}; + +bool SplitIterator_isSplitByte(SplitIterator *self, uint8_t byte); +Optional<Slice<uint8_t>> SplitIterator_next(SplitIterator *self); +SplitIterator memSplit(Slice<uint8_t> buffer, Slice<uint8_t> split_bytes); + #endif |
