Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
secure_crt.cpp File Reference
#include "precompiled.h"
#include <cstdio>
#include <cstring>
#include <cerrno>
#include <cstdarg>
#include "lib/secure_crt.h"
Include dependency graph for secure_crt.cpp:
This graph shows which files directly or indirectly include this file:

Macros

#define tchar   char
 
#define tstring   std::string
 
#define T(string_literal)   string_literal
 
#define tnlen   strnlen
 
#define tncpy_s   strncpy_s
 
#define tcpy_s   strcpy_s
 
#define tncat_s   strncat_s
 
#define tcat_s   strcat_s
 
#define tcmp   strcmp
 
#define tcpy   strcpy
 
#define tvsnprintf   vsnprintf
 
#define tvsprintf_s   vsprintf_s
 
#define tsprintf_s   sprintf_s
 
#define ENFORCE(condition, err_to_warn, retval)
 
#define WARN_IF_PTR_LEN(len)
 

Functions

 STATUS_ADD_DEFINITIONS (secureCrtStatusDefinitions)
 
size_t tnlen (const tchar *str, size_t max_len)
 
int tncpy_s (tchar *dst, size_t max_dst_chars, const tchar *src, size_t max_src_chars)
 
int tcpy_s (tchar *dst, size_t max_dst_chars, const tchar *src)
 
int tncat_s (tchar *dst, size_t max_dst_chars, const tchar *src, size_t max_src_chars)
 
int tcat_s (tchar *dst, size_t max_dst_chars, const tchar *src)
 
int tvsprintf_s (tchar *dst, size_t max_dst_chars, const tchar *fmt, va_list ap)
 
int tsprintf_s (tchar *buf, size_t max_chars, const tchar *fmt,...)
 

Variables

static const StatusDefinition secureCrtStatusDefinitions []
 

Macro Definition Documentation

◆ ENFORCE

#define ENFORCE (   condition,
  err_to_warn,
  retval 
)
Value:
STMT(\
if(!(condition)) \
{ \
DEBUG_WARN_ERR(err_to_warn); \
return retval; \
} \
)
#define STMT(STMT_code__)
package code into a single statement.
Definition: code_generation.h:41

◆ T

#define T (   string_literal)    string_literal

◆ tcat_s

#define tcat_s   strcat_s

◆ tchar

#define tchar   char

◆ tcmp

#define tcmp   strcmp

◆ tcpy

#define tcpy   strcpy

◆ tcpy_s

#define tcpy_s   strcpy_s

◆ tncat_s

#define tncat_s   strncat_s

◆ tncpy_s

#define tncpy_s   strncpy_s

◆ tnlen

#define tnlen   strnlen

◆ tsprintf_s

#define tsprintf_s   sprintf_s

◆ tstring

#define tstring   std::string

◆ tvsnprintf

#define tvsnprintf   vsnprintf

◆ tvsprintf_s

#define tvsprintf_s   vsprintf_s

◆ WARN_IF_PTR_LEN

#define WARN_IF_PTR_LEN (   len)
Value:
/*
ENSURE(len != sizeof(char*));
*/

Function Documentation

◆ STATUS_ADD_DEFINITIONS()

STATUS_ADD_DEFINITIONS ( secureCrtStatusDefinitions  )

◆ tcat_s()

int tcat_s ( tchar dst,
size_t  max_dst_chars,
const tchar src 
)

◆ tcpy_s()

int tcpy_s ( tchar dst,
size_t  max_dst_chars,
const tchar src 
)

◆ tncat_s()

int tncat_s ( tchar dst,
size_t  max_dst_chars,
const tchar src,
size_t  max_src_chars 
)

◆ tncpy_s()

int tncpy_s ( tchar dst,
size_t  max_dst_chars,
const tchar src,
size_t  max_src_chars 
)

◆ tnlen()

size_t tnlen ( const tchar str,
size_t  max_len 
)

◆ tsprintf_s()

int tsprintf_s ( tchar buf,
size_t  max_chars,
const tchar fmt,
  ... 
)

◆ tvsprintf_s()

int tvsprintf_s ( tchar dst,
size_t  max_dst_chars,
const tchar fmt,
va_list  ap 
)

Variable Documentation

◆ secureCrtStatusDefinitions

const StatusDefinition secureCrtStatusDefinitions[]
static
Initial value:
= {
{ ERR::STRING_NOT_TERMINATED, L"Invalid string (no 0 terminator found in buffer)" }
}
const Status STRING_NOT_TERMINATED
Definition: secure_crt.h:36