icedb
version 0.5.1
Snow particle scattering database API
|
Go to the source code of this file.
Macros | |
#define | ICEDB_H_UTIL |
#define | ICEDB_COMPAT_fprintf_s fprintf |
#define | ICEDB_COMPAT_fwprintf_s fwprintf |
#define | ICEDB_COMPAT_fputs_s fputs |
#define | ICEDB_COMPAT_fputws_s fputws |
#define | ICEDB_COMPAT_wcsnlen_s wcsnlen_s |
#define | ICEDB_COMPAT_strnlen_s strnlen |
Functions | |
ICEDB_BEGIN_DECL_C DL_ICEDB size_t | ICEDB_COMPAT_strncpy_s (char *dest, size_t destSz, const char *src, size_t srcSz) |
DL_ICEDB char * | ICEDB_COMPAT_strdup_s (const char *src, size_t srcSz) |
DL_ICEDB size_t | ICEDB_COMPAT_wcsncpy_s (wchar_t *dest, size_t destSz, const wchar_t *src, size_t srcSz) |
DL_ICEDB wchar_t * | ICEDB_COMPAT_wcsdup_s (const wchar_t *src, size_t srcSz) |
DL_ICEDB void * | ICEDB_malloc (size_t numBytes) |
Allocate memory in bytes. Generally this is just malloced, but a custom allocator may be substituted. More... | |
DL_ICEDB void | ICEDB_free (void *obj) |
Free memory region. Should not be double-freed. More... | |
#define ICEDB_COMPAT_fprintf_s fprintf |
Safe file stream printf
Definition at line 26 of file util.h.
Referenced by error_context_to_stream(), ICEDB_DEBUG_RAISE_EXCEPTION_HANDLER_A(), and ICEDB_writeDebugString().
#define ICEDB_COMPAT_fputs_s fputs |
Save file stream fputs
Definition at line 35 of file util.h.
Referenced by error_code_to_stream(), and error_context_to_stream().
#define ICEDB_COMPAT_fwprintf_s fwprintf |
Definition at line 27 of file util.h.
Referenced by ICEDB_DEBUG_RAISE_EXCEPTION_HANDLER_WC().
#define ICEDB_COMPAT_strnlen_s strnlen |
Definition at line 44 of file util.h.
Referenced by error_code_to_message(), error_code_to_message_size(), error_context_append(), and error_context_create_impl().
DL_ICEDB char* ICEDB_COMPAT_strdup_s | ( | const char * | src, |
size_t | srcSz | ||
) |
Safe char array initialization and copy. Null appended at end (added to srcSz).
Definition at line 42 of file util.cpp.
References ICEDB_COMPAT_strncpy_s(), ICEDB_DEBUG_RAISE_EXCEPTION, and ICEDB_malloc().
Referenced by error_context_add_string(), and ICEDB_enumModules().
ICEDB_BEGIN_DECL_C DL_ICEDB size_t ICEDB_COMPAT_strncpy_s | ( | char * | dest, |
size_t | destSz, | ||
const char * | src, | ||
size_t | srcSz | ||
) |
Safe char array copy.
dest | is the pointer to the destination. Always null terminated. |
destSz | is the size of the destination buller, including the trailing null character. |
src | is the pointer to the source. Characters from src are copied either until the first null character or until srcSz. Note that null termination comes later. |
srcSz | is the max size of the source buffer. |
Definition at line 14 of file util.cpp.
References ICEDB_DEBUG_RAISE_EXCEPTION.
Referenced by error_code_to_message(), error_context_append(), error_context_copy(), error_context_create_impl(), error_context_to_message(), error_context_to_message_size(), error_context_widen(), icedb::versioning::genVersionInfo(), ICEDB_COMPAT_strdup_s(), ICEDB_findModuleByFunc(), ICEDB_getAppDir(), ICEDB_getAppPath(), ICEDB_getCWD(), ICEDB_getLibDir(), ICEDB_getLibPath(), ICEDB_getPluginDir(), and ICEDB_WriteLibVersionInfoC().
DL_ICEDB wchar_t* ICEDB_COMPAT_wcsdup_s | ( | const wchar_t * | src, |
size_t | srcSz | ||
) |
Safe char array initialization and copy. Null appended at end (added to srcSz).
Definition at line 80 of file util.cpp.
References ICEDB_COMPAT_wcsncpy_s(), ICEDB_DEBUG_RAISE_EXCEPTION, and ICEDB_malloc().
DL_ICEDB size_t ICEDB_COMPAT_wcsncpy_s | ( | wchar_t * | dest, |
size_t | destSz, | ||
const wchar_t * | src, | ||
size_t | srcSz | ||
) |
Safe char array copy.
dest | is the pointer to the destination. Always null terminated. |
destSz | is the size of the destination buller, including the trailing null character. |
src | is the pointer to the source. Characters from src are copied either until the first null character or until srcSz. Note that null termination comes later. |
srcSz | is the max size of the source buffer. |
Definition at line 52 of file util.cpp.
References ICEDB_DEBUG_RAISE_EXCEPTION.
Referenced by ICEDB_COMPAT_wcsdup_s().
DL_ICEDB void ICEDB_free | ( | void * | obj | ) |
Free memory region. Should not be double-freed.
Definition at line 97 of file util.cpp.
References icedb::free(), and ICEDB_DEBUG_RAISE_EXCEPTION.
Referenced by icedb::_free(), error_context_append(), error_context_create_impl(), error_context_deallocate(), error_context_to_message(), error_context_to_message_size(), error_context_widen(), ICEDB_free_enumModulesRes(), and icedb::os_functions::populateOSstrings().
DL_ICEDB void* ICEDB_malloc | ( | size_t | numBytes | ) |
Allocate memory in bytes. Generally this is just malloced, but a custom allocator may be substituted.
Definition at line 90 of file util.cpp.
References ICEDB_DEBUG_RAISE_EXCEPTION, and icedb::malloc().
Referenced by icedb::_malloc(), error_context_append(), error_context_copy(), error_context_create_impl(), error_context_to_message(), error_context_to_message_size(), error_context_widen(), ICEDB_COMPAT_strdup_s(), ICEDB_COMPAT_wcsdup_s(), ICEDB_enumModules(), and icedb::os_functions::populateOSstrings().