aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* windows: Use WINAPI call convention for Windows API callbacksMartin Willi2014-06-061-1/+1
| | | | | For x86_64 it does not actually matter, but for i686 builds the call convention is different with WINAPI.
* utils: Add a wait_sigint() function to wait for SIGINT or equivalentMartin Willi2014-06-041-0/+83
|
* utils: Provide a path_absolute() function to check path for non-relativenessMartin Willi2014-06-041-0/+27
| | | | The usually used trivial '/' check won't work on Windows platforms.
* utils: Return plain drive letter as base/pathname for drive letters on WindowsMartin Willi2014-06-041-0/+9
|
* utils: Support Windows path separators in path_basename/dirnameMartin Willi2014-06-041-9/+9
|
* windows: Provide a time_monotonic() based on GetTickCount64()Martin Willi2014-06-041-0/+21
|
* utils: Don't directly depend on pthreadMartin Willi2014-06-041-40/+53
|
* strerror: Don't directly depend on pthreadMartin Willi2014-06-041-0/+2
|
* windows: Add utils_init/deinit functions to initialize Winsock2Martin Willi2014-06-041-0/+20
|
* utils: Printf() defined time output should gmtime/localtime_r() failMartin Willi2014-06-041-10/+13
|
* printf-hook-builtin: Support Windows console colors using TTY escape codesMartin Willi2014-06-041-1/+4
|
* windows: Use _getmaxstdio as replacement for syscall(_SC_OPEN_MAX)Martin Willi2014-06-031-0/+4
|
* windows: replace mkdir() with Windows _mkdir() variantMartin Willi2014-06-031-0/+4
|
* utils: Use GCC's __atomic built-ins if availableTobias Brunner2014-04-241-2/+2
| | | | | | | | These are available since GCC 4.7 and will eventually replace the __sync operations. They support the memory model defined by C++11. For instance, by using __ATOMIC_RELAXED for some operations on the reference counters we can avoid memory barriers, which are required by __sync operations (whose memory model essentially is __ATOMIC_SEQ_CST).
* utils: Add ref_cur() to retrieve the current value of a reference counterTobias Brunner2014-04-241-1/+13
| | | | | | | | | | On many architectures it is safe to read the value directly (those using cache coherency protocols, and with atomic loads for 32-bit values) but it is not if that's not the case or if we ever decide to make refcount_t 64-bit (load not atomic on x86). So make sure the operation is actually atomic and that users do not have to care about the size of refcount_t.
* utils: Add memrchr(3) replacement for platforms that don't support itTobias Brunner2014-02-261-1/+23
| | | | For instance, on Mac OS X memrchr(3) is not provided by the C library.
* utils: Add thread-safe variants of dirname(3) and basename(3)Tobias Brunner2014-02-241-3/+61
|
* utils: Move thread-safe strerror replacement to a separate fileTobias Brunner2014-02-241-78/+0
| | | | | For some utils _GNU_SOURCE might be needed but that conflicts with the signature of strerror_r(3).
* utils: Add strreplace functionTobias Brunner2014-01-231-1/+53
|
* utils: Fix %T printf hook on big-endian systemsTobias Brunner2014-01-061-1/+1
| | | | | | | | The cast to a bool* cut of the actual value on big-endian systems if bool was shorter than int because the bool argument to printf gets promoted to an int. Fixes #479.
* utils: Fix check for fmemopen() fallback implementationMartin Willi2013-10-241-1/+1
|
* utils: Provide a fmemopen(3) fallback using BSD funopen()Martin Willi2013-10-241-0/+46
|
* utils: ref_get() returns the new value of the reference counterMartin Willi2013-06-111-2/+6
| | | | This allows us to use ref_get() for getting unique values.
* Allow memstr() to be called with NULL argumentsTobias Brunner2013-06-111-1/+6
|
* Removed unused clalloc() functionTobias Brunner2013-06-111-13/+0
|
* Add a utility function to resolve TTY color escape codes dynamicallyMartin Willi2013-03-041-0/+63
|
* Add a global return_success() method implementationMartin Willi2013-02-141-0/+8
|
* time is a time_t pointerAndreas Steffen2013-02-041-1/+1
|
* Moved utils.[ch] to utils folderTobias Brunner2012-10-241-0/+570