ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
![]() ![]() |
Go to the source code of this file.
Functions | |
__EXPORT void | cpr_runtime_error (const char *text) |
__EXPORT void * | cpr_newp (void **handle, size_t size) |
__EXPORT void | cpr_freep (void **handle) |
__EXPORT void * | cpr_memalloc (size_t size) __MALLOC |
__EXPORT void * | cpr_memassign (size_t size, caddr_t address, size_t known) __MALLOC |
__EXPORT void | cpr_memswap (void *mem1, void *mem2, size_t size) |
__EXPORT int | stricmp (const char *s1, const char *s2) |
__EXPORT int | strnicmp (const char *s1, const char *s2, size_t size) |
__EXPORT uint16_t | lsb_getshort (uint8_t *b) |
__EXPORT uint32_t | lsb_getlong (uint8_t *b) |
__EXPORT uint16_t | msb_getshort (uint8_t *b) |
__EXPORT uint32_t | msb_getlong (uint8_t *b) |
__EXPORT void | lsb_setshort (uint8_t *b, uint16_t v) |
__EXPORT void | lsb_setlong (uint8_t *b, uint32_t v) |
__EXPORT void | msb_setshort (uint8_t *b, uint16_t v) |
__EXPORT void | msb_setlong (uint8_t *b, uint32_t v) |
__EXPORT long | tzoffset (struct timezone *tz=NULL) |
template<typename T > | |
T * | newp (T **handle) |
template<typename T > | |
void | freep (T **handle) |
Runtime functions. This includes common runtime library functions we may need portably.
Definition in file cpr.h.
__EXPORT void cpr_freep | ( | void ** | handle | ) |
__EXPORT void* cpr_memalloc | ( | size_t | size | ) |
Portable memory placement helper function. This is used to process "placement" new operators where a new object is constructed over a pre-allocated area of memory. This handles invalid values through runtime error.
size | of object being constructed. |
address | where the object is being placed. |
known | size of the location we are constructing the object in. |
Definition at line 221 of file cpr.cpp.
References ucommon::addr(), and ucommon::max().
__EXPORT void cpr_memswap | ( | void * | mem1, |
void * | mem2, | ||
size_t | size | ||
) |
Portable swap code.
mem1 | to swap. |
mem2 | to swap. |
size | of swap area. |
Definition at line 193 of file cpr.cpp.
Referenced by ucommon::swap().
__EXPORT void* cpr_newp | ( | void ** | handle, |
size_t | size | ||
) |
__EXPORT void cpr_runtime_error | ( | const char * | text | ) |
Function to handle runtime errors. When using the standard C library, runtime errors are handled by a simple abort. When using the stdc++ library with stdexcept, then std::runtime_error will be thrown.
text | of runtime error. |
Definition at line 83 of file cpr.cpp.
References ucommon::str().
Referenced by ucommon::shell::log(), and ucommon::shell::security().
void freep | ( | T ** | handle | ) |
Definition at line 181 of file cpr.h.
References cpr_freep().
__EXPORT uint32_t lsb_getlong | ( | uint8_t * | b | ) |
__EXPORT void lsb_setlong | ( | uint8_t * | b, |
uint32_t | v | ||
) |
Definition at line 157 of file cpr.cpp.
Referenced by encodefile().
T* newp | ( | T ** | handle | ) |
Definition at line 176 of file cpr.h.
References cpr_newp().
__EXPORT int stricmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 95 of file cpr.cpp.
References stricmp().
Referenced by ucommon::String::eq_case(), ost::MapTable::getObject(), ost::DSO::getObject(), ost::Assoc::getPointer(), ost::Slog::open(), ost::IPV4Address::setAddress(), and stricmp().
__EXPORT int strnicmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | size | ||
) |
Definition at line 104 of file cpr.cpp.
References strnicmp().
Referenced by ucommon::String::eq_case(), ucommon::String::ifind(), ucommon::fsys::is_device(), ost::XMLParser::parseTag(), and strnicmp().
__EXPORT long tzoffset | ( | struct timezone * | tz = NULL | ) |