GATE
|
Pipe channel communication utilities. More...
#include "gate/io/gate_io_api.h"
#include "gate/gatetypes.h"
#include "gate/strings.h"
#include "gate/streams.h"
Macros | |
#define | GATE_PIPE_FLAG_CREATE 0x0001 |
#define | GATE_PIPE_FLAG_READ 0x0002 |
#define | GATE_PIPE_FLAG_WRITE 0x0004 |
Typedefs | |
typedef void * | gate_pipe_t |
Functions | |
GATE_IO_API gate_result_t | gate_pipe_create (gate_pipe_t *readpipe, gate_pipe_t *writepipe) |
Creates a new anonymous pipe and returns and read and write handles to it. | |
GATE_IO_API gate_result_t | gate_pipe_open (gate_string_t *name, gate_enumint_t flags, gate_pipe_t *readpipe, gate_pipe_t *writepipe) |
Creates or opens a named pipe and returns. | |
GATE_IO_API gate_result_t | gate_pipe_close (gate_pipe_t pipe) |
Closes a pipe handle. | |
GATE_IO_API gate_result_t | gate_pipe_read (gate_pipe_t pipe, char *buffer, gate_size_t bufferlen, gate_size_t *returned) |
Reads data from a pipe handle into a buffer. | |
GATE_IO_API gate_result_t | gate_pipe_write (gate_pipe_t pipe, char const *buffer, gate_size_t bufferlen, gate_size_t *written) |
Writes data from a buffer into a pipe. | |
GATE_IO_API gate_result_t | gate_pipe_duplicate (gate_pipe_t src, gate_pipe_t *dst) |
Creates a duplicate of the pipe handle. | |
GATE_IO_API gate_result_t | gate_pipe_export (gate_pipe_t pipe, gate_string_t *pipeid) |
Exports a pipe handle as a string to be used for process-inheritance. | |
GATE_IO_API gate_result_t | gate_pipe_import (gate_string_t const *pipeid, gate_pipe_t *pipe) |
Imports a pipe handle from a string-id from process-inheritance. | |
GATE_IO_API gate_result_t | gate_pipe_open_stream (gate_string_t *name, gate_enumint_t flags, gate_stream_t **ptr_stream) |
Opens a pipe as a gate-stream object. | |
Variables | |
GATE_IO_API gate_pipe_t const | gate_pipe_invalid |
Pipe channel communication utilities.
#define GATE_PIPE_FLAG_CREATE 0x0001 |
Create a new pipe (with read and write access)
#define GATE_PIPE_FLAG_READ 0x0002 |
Open an existing pipe for read access
#define GATE_PIPE_FLAG_WRITE 0x0004 |
Open an existing pipe for write access
typedef void* gate_pipe_t |
native pipe handle
GATE_IO_API gate_result_t gate_pipe_create | ( | gate_pipe_t * | readpipe, |
gate_pipe_t * | writepipe ) |
Creates a new anonymous pipe and returns and read and write handles to it.
[out] | readpipe | pointer to pipe-handle of read-side |
[out] | writepipe | pointer to pipe-handle of write-side |
GATE_IO_API gate_result_t gate_pipe_open | ( | gate_string_t * | name, |
gate_enumint_t | flags, | ||
gate_pipe_t * | readpipe, | ||
gate_pipe_t * | writepipe ) |
Creates or opens a named pipe and returns.
[in,out] | name | pointer to string to be filled with generated pipe name for creation OR name of pipe to be opened |
[in] | flags | GATE_PIPE_FLAG_* identifier |
[out] | readpipe | pointer to pipe-handle of read-side |
[out] | writepipe | pointer to pipe-handle of write-side |
GATE_IO_API gate_result_t gate_pipe_close | ( | gate_pipe_t | pipe | ) |
Closes a pipe handle.
[in] | pipe | handle to pipe to be closed |
GATE_IO_API gate_result_t gate_pipe_read | ( | gate_pipe_t | pipe, |
char * | buffer, | ||
gate_size_t | bufferlen, | ||
gate_size_t * | returned ) |
Reads data from a pipe handle into a buffer.
[in] | pipe | handle to pipe to be accessed |
[out] | buffer | pointer to buffer to be filled with retrieved bytes |
[in] | bufferlen | maximum capacity of buffer in bytes |
[out] | returned | pointer to field that receives retrieved amount of bytes |
GATE_IO_API gate_result_t gate_pipe_write | ( | gate_pipe_t | pipe, |
char const * | buffer, | ||
gate_size_t | bufferlen, | ||
gate_size_t * | written ) |
Writes data from a buffer into a pipe.
[in] | pipe | handle to pipe to be accessed |
[in] | buffer | pointer to buffer with data to be written to pipe |
[in] | bufferlen | amount of bytes in buffer to be written |
[out] | returned | pointer to field that receives actual written amount of bytes |
GATE_IO_API gate_result_t gate_pipe_duplicate | ( | gate_pipe_t | src, |
gate_pipe_t * | dst ) |
Creates a duplicate of the pipe handle.
[in] | src | handle to pipe to be accessed |
[out] | dst | pointer to new pipe-handle to be filled |
GATE_IO_API gate_result_t gate_pipe_export | ( | gate_pipe_t | pipe, |
gate_string_t * | pipeid ) |
Exports a pipe handle as a string to be used for process-inheritance.
[in] | pipe | handle to pipe to be accessed |
[out] | pipeid | pointer to string to be created with serialized pipe-ID |
GATE_IO_API gate_result_t gate_pipe_import | ( | gate_string_t const * | pipeid, |
gate_pipe_t * | pipe ) |
Imports a pipe handle from a string-id from process-inheritance.
[in] | pipeid | pointer to string with serialized pipe-ID |
[out] | pipe | pointer to output pipe-handle to be filled |
GATE_IO_API gate_result_t gate_pipe_open_stream | ( | gate_string_t * | name, |
gate_enumint_t | flags, | ||
gate_stream_t ** | ptr_stream ) |
Opens a pipe as a gate-stream object.
[in] | name | pointer to string to be created with new pipe-name OR string with pipe-name to be opened |
[in] | flags | GATE_PIPE_FLAG_* option |
[out] | ptr_stream | pointer to stream-pointer which gets new created object |
|
extern |
special ID identifying an invalid pipe