Pyrogenesis  trunk
Macros | Functions | Variables
secure_crt.cpp File Reference
#include "precompiled.h"
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
#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

#define ENFORCE (   condition,
  err_to_warn,
  retval 
)
Value:
if(!(condition)) \
{ \
DEBUG_WARN_ERR(err_to_warn); \
return retval; \
} \
)
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
Definition: debug.h:336
#define STMT(STMT_code__)
package code into a single statement.
Definition: code_generation.h:41
#define T (   string_literal)    string_literal
#define tcat_s   strcat_s
#define tchar   char
#define tcmp   strcmp
#define tcpy   strcpy
#define tcpy_s   strcpy_s
#define tncat_s   strncat_s
#define tncpy_s   strncpy_s
#define tnlen   strnlen
#define tsprintf_s   sprintf_s
#define tstring   std::string
#define tvsnprintf   vsnprintf
#define tvsprintf_s   vsprintf_s
#define WARN_IF_PTR_LEN (   len)
Value:
/*
ENSURE(len != sizeof(char*));
*/

Function Documentation

STATUS_ADD_DEFINITIONS ( secureCrtStatusDefinitions  )
int tcat_s ( tchar dst,
size_t  max_dst_chars,
const tchar src 
)
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 tncpy_s ( tchar dst,
size_t  max_dst_chars,
const tchar src,
size_t  max_src_chars 
)
size_t tnlen ( const tchar str,
size_t  max_len 
)
int tsprintf_s ( tchar buf,
size_t  max_chars,
const tchar fmt,
  ... 
)
int tvsprintf_s ( tchar dst,
size_t  max_dst_chars,
const tchar fmt,
va_list  ap 
)

Variable Documentation

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