ddnet/src/base
Robert Müller c7fb013607 Add io_read_all, io_read_all_str and mem_has_null:
- `io_read_all` reads all bytes from a file handle into a new buffer. It should only need one allocation per file in cases where the actual file size matches the expected file size. Otherwise it falls back to doubling the buffer size if the actual file size is larger than expected to avoid TOCTOU problems.
- `io_read_all_str` reads all bytes from a file handle into a new buffer and also ensures that the buffer is null-terminated and contains no other null-characters.
- `mem_has_null` is a utility used by `io_read_all_str` to ensure that no null-characters exist in the bytes read from the file.
2022-06-16 10:19:36 +02:00
..
tl Add CLockScope 2022-06-03 12:21:23 +02:00
unicode Changed file names to match classic source.c include header.h 2022-05-07 00:54:29 +02:00
color.h clang-format 2022-05-28 02:22:43 +02:00
detect.h Emscripten support 2022-03-25 12:42:18 +01:00
dynamic.h Run clang-format 2020-09-26 21:50:15 +02:00
hash.cpp Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
hash.h Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
hash_bundled.cpp Use cpp 2021-06-24 17:19:17 +02:00
hash_ctxt.h uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
hash_libtomcrypt.cpp Remove unused includes from base 2022-05-29 19:49:38 +02:00
hash_openssl.cpp Use cpp 2021-06-24 17:19:17 +02:00
lock_scope.h Add CLockScope 2022-06-03 12:21:23 +02:00
log.cpp More vector naming format 2022-06-15 19:37:37 +02:00
log.h Add logging macros log_{error,warn,info,debug,trace} 2022-04-29 15:32:42 +02:00
logger.h More vector naming format 2022-06-15 19:37:37 +02:00
math.h Work around Windows's definition of min/max 2022-05-31 17:26:35 +02:00
system.cpp Add io_read_all, io_read_all_str and mem_has_null: 2022-06-16 10:19:36 +02:00
system.h Add io_read_all, io_read_all_str and mem_has_null: 2022-06-16 10:19:36 +02:00
vmath.h vmath: Make vector2_base() constructors constexpr 2022-05-28 20:58:22 +03:00