ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
pipe.h
Go to the documentation of this file.
1#pragma once
2
26
27#include <stdbool.h>
28#include <stddef.h>
29#include <sys/types.h> // For ssize_t on all platforms
30#include "../common.h"
31
32#ifdef _WIN32
33#include <windows.h>
35typedef HANDLE pipe_t;
37#define INVALID_PIPE_VALUE INVALID_HANDLE_VALUE
38#else
40typedef int pipe_t;
42#define INVALID_PIPE_VALUE (-1)
43#endif
44
45// ============================================================================
46// Pipe/Agent Connection Functions
47// ============================================================================
48
64pipe_t platform_pipe_connect(const char *path);
65
78
95ssize_t platform_pipe_read(pipe_t pipe, void *buf, size_t len);
96
113ssize_t platform_pipe_write(pipe_t pipe, const void *buf, size_t len);
114
123
⚙️ Common definitions, error codes, macros, and types shared throughout the application
ssize_t platform_pipe_read(pipe_t pipe, void *buf, size_t len)
Read data from a pipe.
pipe_t platform_pipe_connect(const char *path)
Connect to an agent via named pipe (Windows) or Unix socket (POSIX).
int pipe_t
Pipe handle type (POSIX: int file descriptor).
Definition pipe.h:40
ssize_t platform_pipe_write(pipe_t pipe, const void *buf, size_t len)
Write data to a pipe.
int platform_pipe_close(pipe_t pipe)
Close a pipe connection.
bool platform_pipe_is_valid(pipe_t pipe)
Check if a pipe handle is valid.