FS2_Open
Open source remastering of the Freespace 2 engine
safe_strings.h File Reference
#include <errno.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define __safe_strings_error_handler(val)   Error(file, line,"%s: String error. Please Report.\nTrying to put into " SIZE_T_ARG " byte buffer:\n%s", #val, sizeInBytes,strSource)
 
#define strcpy_s(...)   scp_strcpy_s( __FILE__, __LINE__, __VA_ARGS__ )
 
#define strcat_s(...)   scp_strcat_s( __FILE__, __LINE__, __VA_ARGS__ )
 

Typedefs

typedef int errno_t
 

Functions

errno_t scp_strcpy_s (const char *file, int line, char *strDest, size_t sizeInBytes, const char *strSource)
 
errno_t scp_strcat_s (const char *file, int line, char *strDest, size_t sizeInBytes, const char *strSource)
 
template<size_t size>
errno_t scp_strcpy_s (const char *file, int line, char(&strDest)[size], const char *strSource)
 
template<size_t size>
errno_t scp_strcat_s (const char *file, int line, char(&strDest)[size], const char *strSource)
 

Macro Definition Documentation

#define __safe_strings_error_handler (   val)    Error(file, line,"%s: String error. Please Report.\nTrying to put into " SIZE_T_ARG " byte buffer:\n%s", #val, sizeInBytes,strSource)

Definition at line 40 of file safe_strings.h.

#define strcat_s (   ...)    scp_strcat_s( __FILE__, __LINE__, __VA_ARGS__ )

Definition at line 68 of file safe_strings.h.

#define strcpy_s (   ...)    scp_strcpy_s( __FILE__, __LINE__, __VA_ARGS__ )

Definition at line 67 of file safe_strings.h.

Typedef Documentation

typedef int errno_t

Definition at line 27 of file safe_strings.h.

Function Documentation

errno_t scp_strcat_s ( const char *  file,
int  line,
char *  strDest,
size_t  sizeInBytes,
const char *  strSource 
)

Definition at line 64 of file safe_strings.cpp.

template<size_t size>
errno_t scp_strcat_s ( const char *  file,
int  line,
char(&)  strDest[size],
const char *  strSource 
)
inline

Definition at line 62 of file safe_strings.h.

errno_t scp_strcpy_s ( const char *  file,
int  line,
char *  strDest,
size_t  sizeInBytes,
const char *  strSource 
)

Definition at line 28 of file safe_strings.cpp.

template<size_t size>
errno_t scp_strcpy_s ( const char *  file,
int  line,
char(&)  strDest[size],
const char *  strSource 
)
inline

Definition at line 55 of file safe_strings.h.