Debian Codegraph @

debian/rust-vendor/codspeed/instrument-hooks/src/fifo/windows.zig

raw
1 //! Windows fifo backend — not yet implemented.
2 //!
3 //! Real implementation would use Win32 named pipes:
4 //! CreateNamedPipeA(\\.\pipe\runner.ctl, ...) for the runner-side endpoints,
5 //! CreateFileA(\\.\pipe\runner.ctl, ...) on the hooks side, plus
6 //! PeekNamedPipe / SetNamedPipeHandleState(PIPE_NOWAIT) for the non-blocking
7 //! semantics that the POSIX impl gets via O_NONBLOCK + fcntl.
8 //!
9 //! For now every entry point returns error.Unsupported so callers (runner_fifo,
10 //! the C FFI exports) propagate a non-zero status and the runtime falls back to
11 //! the "none" instrument backend.
12
13 const std = @import("std");
14 const shared = @import("../shared.zig");
15
16 const Allocator = std.mem.Allocator;
17 pub const Command = shared.Command;
18
19 pub const Pipe = struct {
20 pub const Reader = struct {
21 pub fn read(_: *Reader, _: []u8) !usize {
22 return error.Unsupported;
23 }
24 pub fn readAll(_: *Reader, _: []u8) !usize {
25 return error.Unsupported;
26 }
27 pub fn recvCmd(_: *Reader) !Command {
28 return error.Unsupported;
29 }
30 pub fn waitForResponse(_: *Reader, _: ?u64) !Command {
31 return error.Unsupported;
32 }
33 pub fn waitForAck(_: *Reader, _: ?u64) !void {
34 return error.Unsupported;
35 }
36 pub fn deinit(_: *Reader) void {}
37 };
38
39 pub const Writer = struct {
40 pub fn write(_: *Writer, _: []const u8) !usize {
41 return error.Unsupported;
42 }
43 pub fn writeAll(_: *Writer, _: []const u8) !void {
44 return error.Unsupported;
45 }
46 pub fn sendCmd(_: *Writer, _: Command) !void {
47 return error.Unsupported;
48 }
49 pub fn deinit(_: *Writer) void {}
50 };
51
52 pub fn create(_: [*:0]const u8) !void {
53 return error.Unsupported;
54 }
55
56 pub fn openRead(_: Allocator, _: []const u8) !Reader {
57 return error.Unsupported;
58 }
59
60 pub fn openWrite(_: Allocator, _: []const u8) !Writer {
61 return error.Unsupported;
62 }
63 };
64
65 pub fn sendCmd(_: Allocator, _: Command) !void {
66 return error.Unsupported;
67 }
68
69 pub fn sendVersion(_: Allocator, _: u64) !void {
70 return error.Unsupported;
71 }