FreeRDP
stream.c File Reference
#include <winpr/config.h>
#include <winpr/assert.h>
#include <winpr/crt.h>
#include <winpr/stream.h>
#include "stream.h"
#include "../log.h"

Macros

#define STREAM_TAG   WINPR_TAG("wStream")
 
#define STREAM_ASSERT(cond)
 

Functions

BOOL Stream_EnsureCapacity (wStream *s, size_t size)
 
BOOL Stream_EnsureRemainingCapacity (wStream *s, size_t size)
 
wStreamStream_New (BYTE *buffer, size_t size)
 
wStreamStream_StaticConstInit (wStream *s, const BYTE *buffer, size_t size)
 
wStreamStream_StaticInit (wStream *s, BYTE *buffer, size_t size)
 
void Stream_EnsureValidity (wStream *s)
 
void Stream_Free (wStream *s, BOOL bFreeBuffer)
 
BOOL Stream_SetLength (wStream *_s, size_t _l)
 
BOOL Stream_SetPosition (wStream *_s, size_t _p)
 
void Stream_SealLength (wStream *_s)
 
size_t Stream_GetRemainingCapacity (const wStream *_s)
 
size_t Stream_GetRemainingLength (const wStream *_s)
 
BOOL Stream_Write_UTF16_String (wStream *s, const WCHAR *src, size_t length)
 
BOOL Stream_Read_UTF16_String (wStream *s, WCHAR *dst, size_t length)
 
BOOL Stream_CheckAndLogRequiredLengthEx (const char *tag, DWORD level, wStream *s, UINT64 len, const char *fmt,...)
 
BOOL Stream_CheckAndLogRequiredLengthExVa (const char *tag, DWORD level, wStream *s, UINT64 len, const char *fmt, va_list args)
 
BOOL Stream_CheckAndLogRequiredLengthWLogEx (wLog *log, DWORD level, wStream *s, UINT64 len, const char *fmt,...)
 
BOOL Stream_CheckAndLogRequiredLengthWLogExVa (wLog *log, DWORD level, wStream *s, UINT64 len, const char *fmt, va_list args)
 

Macro Definition Documentation

◆ STREAM_ASSERT

#define STREAM_ASSERT (   cond)
Value:
do \
{ \
if (!(cond)) \
{ \
WLog_FATAL(STREAM_TAG, "%s [%s:%s:%" PRIuz "]", #cond, __FILE__, __FUNCTION__, \
__LINE__); \
winpr_log_backtrace(STREAM_TAG, WLOG_FATAL, 20); \
abort(); \
} \
} while (0)

◆ STREAM_TAG

#define STREAM_TAG   WINPR_TAG("wStream")

Function Documentation

◆ Stream_CheckAndLogRequiredLengthEx()

BOOL Stream_CheckAndLogRequiredLengthEx ( const char *  tag,
DWORD  level,
wStream s,
UINT64  len,
const char *  fmt,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_CheckAndLogRequiredLengthExVa()

BOOL Stream_CheckAndLogRequiredLengthExVa ( const char *  tag,
DWORD  level,
wStream s,
UINT64  len,
const char *  fmt,
va_list  args 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_CheckAndLogRequiredLengthWLogEx()

BOOL Stream_CheckAndLogRequiredLengthWLogEx ( wLog *  log,
DWORD  level,
wStream s,
UINT64  len,
const char *  fmt,
  ... 
)
Here is the call graph for this function:

◆ Stream_CheckAndLogRequiredLengthWLogExVa()

BOOL Stream_CheckAndLogRequiredLengthWLogExVa ( wLog *  log,
DWORD  level,
wStream s,
UINT64  len,
const char *  fmt,
va_list  args 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_EnsureCapacity()

BOOL Stream_EnsureCapacity ( wStream s,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_EnsureRemainingCapacity()

BOOL Stream_EnsureRemainingCapacity ( wStream s,
size_t  size 
)
Here is the call graph for this function:

◆ Stream_EnsureValidity()

void Stream_EnsureValidity ( wStream s)
Here is the caller graph for this function:

◆ Stream_Free()

void Stream_Free ( wStream s,
BOOL  bFreeBuffer 
)
Here is the call graph for this function:

◆ Stream_GetRemainingCapacity()

size_t Stream_GetRemainingCapacity ( const wStream _s)
Here is the call graph for this function:

◆ Stream_GetRemainingLength()

size_t Stream_GetRemainingLength ( const wStream _s)
Here is the call graph for this function:

◆ Stream_New()

wStream* Stream_New ( BYTE buffer,
size_t  size 
)

◆ Stream_Read_UTF16_String()

BOOL Stream_Read_UTF16_String ( wStream s,
WCHAR *  dst,
size_t  length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_SealLength()

void Stream_SealLength ( wStream _s)
Here is the call graph for this function:

◆ Stream_SetLength()

BOOL Stream_SetLength ( wStream _s,
size_t  _l 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_SetPosition()

BOOL Stream_SetPosition ( wStream _s,
size_t  _p 
)
Here is the call graph for this function:

◆ Stream_StaticConstInit()

wStream* Stream_StaticConstInit ( wStream s,
const BYTE buffer,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Stream_StaticInit()

wStream* Stream_StaticInit ( wStream s,
BYTE buffer,
size_t  size 
)
Here is the caller graph for this function:

◆ Stream_Write_UTF16_String()

BOOL Stream_Write_UTF16_String ( wStream s,
const WCHAR *  src,
size_t  length 
)
Here is the call graph for this function:
Here is the caller graph for this function:
STREAM_TAG
#define STREAM_TAG
Definition: stream.c:30
WLOG_FATAL
#define WLOG_FATAL
Definition: include/winpr/wlog.h:44