BSB Developer Docs
Loading...
Searching...
No Matches
pipe_util.h File Reference

Pipe utilities. More...

#include "pipe.h"

Go to the source code of this file.

Data Structures

struct  PipeDiscardUntilResult
 

Typedefs

typedef struct PipeDiscardUntilResult PipeDiscardUntilResult
 

Functions

bool pipe_copy_until (PipeSide *source, PipeSide *dest, const char *terminator)
 Copies data from one pipe to another until a specific sequence is met.
 
PipeDiscardUntilResult pipe_discard_until_either (PipeSide *source, const char *const *terminators, size_t num_terminators)
 Discards data from a pipe until (including) any of specific sequences is met.
 

Detailed Description

Pipe utilities.

Function Documentation

◆ pipe_copy_until()

bool pipe_copy_until ( PipeSide * source,
PipeSide * dest,
const char * terminator )

Copies data from one pipe to another until a specific sequence is met.

Parameters
[in]sourcePipe to copy data from
[in]destPipe to copy data into. May be NULL
[in]terminatorTerminator sequence
Returns
true if terminator sequence found, false if one of the pipes was closed prematurely.

◆ pipe_discard_until_either()

PipeDiscardUntilResult pipe_discard_until_either ( PipeSide * source,
const char *const * terminators,
size_t num_terminators )

Discards data from a pipe until (including) any of specific sequences is met.

Parameters
[in]sourcePipe to read data from
[in]terminatorsTerminator sequences
[in]num_terminatorsNumber of terminator sequences