MCPcopy Create free account

hub / github.com/KaisenAmin/c_std / functions

Functions2,651 in github.com/KaisenAmin/c_std

Functionudp_set_timeout
* @brief Apply the same send/receive timeout (in milliseconds) to a UDP socket. * * Sets both `SO_RCVTIMEO` and `SO_SNDTIMEO`. After this, blocking
network/udp.c:551
Functionudp_set_ttl
* @brief Set the unicast hop limit (TTL) for outgoing datagrams. * * The unicast counterpart of `udp_set_multicast_ttl`. Because the library's * so
network/udp.c:1159
Functionudp_socket_create
* @brief Create a UDP socket configured for dual-stack IPv4/IPv6 operation. * * Returns an `AF_INET6` socket with `IPV6_V6ONLY` disabled so that bot
network/udp.c:203
Functionudp_status_to_string
* @brief Human-readable label for a `UdpStatus` code. * * Returns a static, immutable string suitable for printing or logging * (`"UDP_SUCCESS"`, `
network/udp.c:1056
Functionudp_wait_writable
* @brief Wait until the socket is writable (or timeout). Mirrors * udp_wait_readable on the write fd-set. * * @param socket A valid UDP
network/udp.c:1584
Functionunittest_clear_mock_registry
* @brief Free every heap allocation owned by the mock-call registry. * * Walks the registry linked list, freeing each `MockCall`'s * strdup'd `func
unittest/unittest.c:720
Functionunittest_clear_stub_registry
* @brief Reset the stub registry. * * `unittest_register_stub` stores the supplied pointers in a static * array — it does NOT take ownership of the
unittest/unittest.c:751
Functionunittest_display_progress
* @brief Render a single-line progress bar reflecting * `completed / total` test cases. * * Writes to stdout with a leading `\r` and an `ffl
unittest/unittest.c:635
Functionunittest_free
* @brief Free a pointer previously returned by `unittest_malloc`. * * Removes the matching tracking record (if any) then forwards to * libc `free()
unittest/unittest.c:290
Functionunittest_free_generated_data
* @brief Free a heap block produced by a generator (currently only * `unittest_generate_random_string` allocates). Safe with NULL. */
unittest/unittest.c:617
Functionunittest_generate_edge_case_doubles
* @brief Return a static array of double edge cases. * * Values: `{-DBL_MAX, -1.0, 0.0, 1.0, DBL_MAX}`. Do NOT free. */
unittest/unittest.c:584
Functionunittest_generate_edge_case_floats
* @brief Return a static array of float edge cases. * * Values: `{-FLT_MAX, -1.0f, 0.0f, 1.0f, FLT_MAX}`. Do NOT free. */
unittest/unittest.c:571
Functionunittest_generate_edge_case_integers
* @brief Return a static array of int edge cases. * * Values: `{INT_MIN, -1, 0, 1, INT_MAX}`. The pointer is internal — * do NOT free. Writes the c
unittest/unittest.c:558
Functionunittest_generate_edge_case_strings
* @brief Return a static array of string edge cases. * * Entries: empty, single char, 80-char run, embedded NUL, newline, * tab. The pointers are t
unittest/unittest.c:599
Functionunittest_generate_random_bytes
* @brief Fill @p buffer with @p size random bytes (0..255). * * Pulls each byte from `rand()` modulo 256. Useful for fuzzing * binary parsers, gene
unittest/unittest.c:780
Functionunittest_generate_random_double
* @brief Uniformly-distributed pseudo-random `double` in `[min, max]`. */
unittest/unittest.c:521
Functionunittest_generate_random_float
* @brief Uniformly-distributed pseudo-random `float` in `[min, max]`. */
unittest/unittest.c:513
Functionunittest_generate_random_int
* @brief Uniformly-distributed pseudo-random `int` in `[min, max]`. * * If `max < min` the arguments are swapped so the call is always * valid. Use
unittest/unittest.c:494
Functionunittest_generate_random_string
* @brief Generate a `length`-character random alphanumeric string. * * Heap-allocated; NUL-terminated. Caller releases with `free()` or * `unittest
unittest/unittest.c:534
Functionunittest_get_memory_usage
* @brief Return the total bytes currently tracked by `unittest_malloc`. * * Equivalent to reading `total_memory_allocated`. Provided as a * functio
unittest/unittest.c:183
Functionunittest_get_mock_call
* @brief Return the most-recent `MockCall` registered for @p function_name. * * Walks `mock_registry` from head and returns the first match. Because
unittest/unittest.c:351
Functionunittest_get_stub_return_value
* @brief Look up a previously-registered stub. * * @return The stored `return_value` for the matching (function_name, * arg) pair, or NULL
unittest/unittest.c:450
Functionunittest_malloc
* @brief Allocate @p size bytes and record the allocation in the * tracking list (so it shows up in leak reports). * * Use the `UNITTEST_MAL
unittest/unittest.c:275
Functionunittest_mock_call_arg
* @brief Programmatic getter for an argument that a mock function * was called with — returns the captured string for inspection. * * Pairs
unittest/unittest.c:818
Functionunittest_register_mock_call
* @brief Record a mock-function invocation in the global registry. * * Prepends a new node to `mock_registry` carrying a `strdup` of * @p function_
unittest/unittest.c:313
Functionunittest_register_stub
* @brief Register a stub that maps (@p function_name, @p arg) to * @p return_value. * * Stored in the static `stub_registry`. The framework
unittest/unittest.c:428
Functionunittest_reset_state
* @brief Reset every global test-runner counter back to its starting * state, including the cached real / CPU timer baselines. * * Use this
unittest/unittest.c:685
Functionunittest_set_timeout
* @brief Configure the per-test wall-clock timeout (in milliseconds). * * After setting this, `UNITTEST_RUN_TEST` will mark any test that * runs lo
unittest/unittest.c:172
Functionunittest_timer_cpu
* @brief Return the current process CPU time in seconds. * * Implementation: * - Windows: `GetProcessTimes` — sums user + kernel time. * - POS
unittest/unittest.c:140
Functionunittest_timer_real
* @brief Return the current wall-clock time in seconds. * * Cross-platform implementation: * - Windows: `QueryPerformanceCounter` / `QueryPerform
unittest/unittest.c:95
Functionunittest_verify_mock_call
* @brief Assert that a specific recorded mock call matches the * expected arguments. * * Looks up the (function, call_index) entry in the re
unittest/unittest.c:377
Functionunittest_verify_mock_call_count
* @brief Assert that @p function_name was invoked exactly * @p expected_count times. * * Counts every entry in `mock_registry` whose `functi
unittest/unittest.c:401
Functionuptr_get
* @brief Return the raw pointer without giving up ownership. * * Use this when you want to dereference / pass the pointee but * intend to keep the
uniqueptr/uniqueptr.c:91
Functionuptr_get_deleter
* @brief Return the registered deleter. * * @return The deleter, or NULL on NULL/empty receiver. */
uniqueptr/uniqueptr.c:105
Functionuptr_is_null
* @brief true if @p up is empty (no owned pointer). */
uniqueptr/uniqueptr.c:117
Functionuptr_move
* @brief Move-assign: destroy @p dst's current payload, then transfer * @p src's payload into @p dst. After the call, @p src is * empt
uniqueptr/uniqueptr.c:219
Functionuptr_new
* @brief Build a UniquePtr that owns @p ptr and will release it via * @p deleter. * * If @p deleter is NULL, `free` is used as the default —
uniqueptr/uniqueptr.c:25
Functionuptr_release
* @brief Relinquish ownership without running the deleter. * * After this call the UniquePtr is empty and the returned pointer is * the caller's re
uniqueptr/uniqueptr.c:134
Functionuptr_reset
* @brief Run the current deleter (if any), then take ownership of * @p new_ptr using the SAME deleter. * * If you need to change deleters at
uniqueptr/uniqueptr.c:162
Functionuptr_swap
* @brief Swap two UniquePtrs in O(1) with no allocations. * * NULL-safe; self-swap is a no-op. */
uniqueptr/uniqueptr.c:195
Functionuptr_take
* @brief Move-construct: return a UniquePtr holding @p src's payload; * @p src becomes empty. * * Mirrors `auto q = std::move(p);` exactly.
uniqueptr/uniqueptr.c:246
Functionuuid_compare
* @brief Order two UUIDs lexicographically by their 16 big-endian bytes. * * Uses the same sign convention as `memcmp`/`strcmp`. For v7 UUIDs this b
uuid/uuid.c:832
Functionuuid_equal
* @brief Test two UUIDs for byte-for-byte equality. * @param a The first UUID. * @param b The second UUID. * @return `true` if @p a and @p b are id
uuid/uuid.c:813
Functionuuid_from_bytes
* @brief Build a UUID from 16 raw bytes in big-endian field order. * * The bytes are stored verbatim, so this round-trips exactly with * @ref uuid_
uuid/uuid.c:721
Functionuuid_from_string
* @brief Parse a UUID from its text form into @p out. * * Accepts, case-insensitively, all of these forms: * - canonical hyphenated: `6ba7b810-9d
uuid/uuid.c:643
Functionuuid_is_max
* @brief Test whether @p u is the Max UUID (all 16 bytes 0xFF). * @param u The UUID. * @return `true` if @p u is the Max UUID, otherwise `false`. *
uuid/uuid.c:795
Functionuuid_is_nil
* @brief Test whether @p u is the Nil UUID (all 16 bytes zero). * @param u The UUID. * @return `true` if @p u is the Nil UUID, otherwise `false`. *
uuid/uuid.c:778
Functionuuid_max
* @brief Return the Max UUID — all 128 bits one (RFC 9562 §5.10). * * Formats as `ffffffff-ffff-ffff-ffff-ffffffffffff`. * * @return The Max UUID,
uuid/uuid.c:511
Functionuuid_namespace_dns
* @brief Return the predefined DNS namespace UUID (RFC 9562 Appendix C): * `6ba7b810-9dad-11d1-80b4-00c04fd430c8`. * @return The DNS namespac
uuid/uuid.c:534
Functionuuid_namespace_oid
* @brief Return the predefined ISO OID namespace UUID (RFC 9562 Appendix C): * `6ba7b812-9dad-11d1-80b4-00c04fd430c8`. * @return The OID name
uuid/uuid.c:556
Functionuuid_namespace_url
* @brief Return the predefined URL namespace UUID (RFC 9562 Appendix C): * `6ba7b811-9dad-11d1-80b4-00c04fd430c8`. * @return The URL namespac
uuid/uuid.c:545
Functionuuid_namespace_x500
* @brief Return the predefined X.500 namespace UUID (RFC 9562 Appendix C): * `6ba7b814-9dad-11d1-80b4-00c04fd430c8`. * @return The X.500 name
uuid/uuid.c:567
Functionuuid_nil
* @brief Return the Nil UUID — all 128 bits zero (RFC 9562 §5.9). * * Formats as `00000000-0000-0000-0000-000000000000`. * * @return The Nil UUID,
uuid/uuid.c:492
Functionuuid_to_bytes
* @brief Copy the 16 raw bytes of @p u (big-endian field order) into @p out. * * The compact binary form, suitable for a 16-byte BLOB column or wire
uuid/uuid.c:702
Functionuuid_to_urn
* @brief Write the URN form `urn:uuid:xxxxxxxx-…` of @p u into @p out. * * Produces the 45-character `urn:uuid:` prefixed form plus a NUL terminator
uuid/uuid.c:618
Functionuuid_v3
* @brief Generate a version-3 (name-based, MD5) UUID (RFC 9562 §5.3). * * Computes `MD5(namespace_id.bytes || name)`, copies the 16-byte digest in,
uuid/uuid.c:417
Functionuuid_v4
* @brief Generate a version-4 (fully random) UUID (RFC 9562 §5.4). * * All 122 free bits are filled from the cross-platform `secrets` CSPRNG * (BCr
uuid/uuid.c:348
Functionuuid_v5
* @brief Generate a version-5 (name-based, SHA-1) UUID (RFC 9562 §5.5). * * Like @ref uuid_v3, but hashes with SHA-1 and uses the first 16 bytes of
uuid/uuid.c:454
Functionuuid_v7
* @brief Generate a version-7 (Unix-time-ordered) UUID (RFC 9562 §5.7). * * Layout: octets 0–5 hold the current Unix timestamp in **milliseconds** a
uuid/uuid.c:376
Functionuuid_v7_timestamp_ms
* @brief Extract the embedded creation timestamp from a version-7 UUID. * * Reads octets 0–5 as a 48-bit big-endian integer — the Unix timestamp in
uuid/uuid.c:850
Functionuuid_variant
* @brief Return the variant of @p u. * * Classifies the leading bits of octet 8. * * @param u The UUID. * @return One of `UUID_VARIANT_NCS`, `UUI
uuid/uuid.c:755
Functionvariant_array_at
@brief Borrowed pointer to element at @p index. NULL if OOR. */
variant/variant.c:1288
Functionvariant_array_capacity
* @brief Current capacity (slots allocated, not in use). * * Always satisfies `capacity >= size`. Grows automatically on push; * `variant_array_cle
variant/variant.c:1377
Functionvariant_array_clear
@brief Destroy every element; the array becomes empty. */
variant/variant.c:1331
Functionvariant_array_empty
* @brief True iff the array is NULL or holds no elements. * * Capacity is not consulted — an array with cap=64 but size=0 is * empty. Use `variant_
variant/variant.c:1363
Functionvariant_array_free
* @brief Free every variant in the array and the array itself. * NULL-safe. */
variant/variant.c:1205
Functionvariant_array_new
* @brief Allocate a new dynamic array of variants. Initial capacity * of 0 is fine; the array grows on first push. */
variant/variant.c:1176
Functionvariant_array_pop
@brief Drop the last element. False on empty/NULL. */
variant/variant.c:1274
Functionvariant_array_push
@brief Append a deep copy of @p v to the array. */
variant/variant.c:1254
Functionvariant_array_remove_at
@brief Remove element at @p index, shifting later elements left. */
variant/variant.c:1314
Functionvariant_array_set
@brief Replace element at @p index with a deep copy of @p v. */
variant/variant.c:1297
Functionvariant_array_size
* @brief Current element count. * @param a Array. May be NULL. * @return Number of elements; 0 if @p a is NULL. */
variant/variant.c:1350
Functionvariant_equal
* @brief Convenience equality check. * * `true` exactly when `variant_compare(a, b) == 0`. Two NULLs are equal; * two NONEs are equal; two STRINGs
variant/variant.c:971
Functionvariant_get_bool
* @brief Type-checked read of the BOOL value. * @copydetails variant_get_int */
variant/variant.c:812
Functionvariant_get_char
* @brief Type-checked read of the CHAR value. * @copydetails variant_get_int */
variant/variant.c:804
Functionvariant_get_custom
* @brief Borrow the variant's CUSTOM payload and (optionally) its descriptor. * * On success `*out` points to the variant's owned storage; if * @p
variant/variant.c:865
Functionvariant_get_double
* @brief Type-checked read of the DOUBLE value. * @copydetails variant_get_int */
variant/variant.c:796
Functionvariant_get_float
* @brief Type-checked read of the FLOAT value. * @copydetails variant_get_int */
variant/variant.c:788
Functionvariant_get_int
* @brief Type-checked read of the INT value. * * `*out` is only written when the variant is INT-tagged AND @p out is * non-NULL — a type-mismatch l
variant/variant.c:772
Functionvariant_get_long
* @brief Type-checked read of the LONG value. * @copydetails variant_get_int */
variant/variant.c:780
Functionvariant_get_pointer
* @brief Type-checked read of the POINTER value. * * The returned pointer is borrowed — the caller is still responsible * for whatever it points to
variant/variant.c:825
Functionvariant_get_string
* @brief Borrow the variant's underlying string buffer. * * On success `*out` is set to a pointer into the variant's owned * storage. That pointer
variant/variant.c:842
Functionvariant_hash
@brief Hash suitable for use as a hashmap key. */
variant/variant.c:987
Functionvariant_is
* @brief Tag predicate. True iff the variant currently holds type @p t. * * NULL receiver returns false (even for `VARIANT_TYPE_NONE` — use * `vari
variant/variant.c:731
Functionvariant_is_none
* @brief Convenience: true for NULL OR for a NONE-tagged variant. * * The asymmetry with `variant_is(v, VARIANT_TYPE_NONE)` is deliberate — * "is t
variant/variant.c:745
Functionvariant_move
* @brief Move * @p src into * @p dst (destroying @p dst's prior value). * * After this returns, @p src is NONE. O(1), no allocation. */
variant/variant.c:564
Functionvariant_println
* @brief Like `variant_print` but appends a newline. * * @param v Variant. May be NULL. * @return Total chars written (including the newline), or
variant/variant.c:1155
Functionvariant_set_bool
* @brief Re-tag @p v as BOOL and assign @p x. * @copydetails variant_set_int */
variant/variant.c:438
Functionvariant_set_char
* @brief Re-tag @p v as CHAR and assign @p x. * @copydetails variant_set_int */
variant/variant.c:430
Functionvariant_set_custom
* @brief Re-tag @p v as CUSTOM and copy @p src into newly-owned storage. * * Functionally `variant_destroy(v); *v = variant_from_custom(src, info);`
variant/variant.c:513
Functionvariant_set_double
* @brief Re-tag @p v as DOUBLE and assign @p x. * @copydetails variant_set_int */
variant/variant.c:422
Functionvariant_set_float
* @brief Re-tag @p v as FLOAT and assign @p x. * @copydetails variant_set_int */
variant/variant.c:414
Functionvariant_set_int
* @brief Re-tag @p v as INT and assign @p x. * * The previous content (if any) is destroyed first via * `variant_destroy`, so any owned string/cust
variant/variant.c:398
Functionvariant_set_long
* @brief Re-tag @p v as LONG and assign @p x. * @copydetails variant_set_int */
variant/variant.c:406
Functionvariant_set_none
* @brief Reset @p v to NONE, releasing any owned payload. * * Equivalent to `variant_destroy(v)` but returns a status instead of * void, so it comp
variant/variant.c:545
Functionvariant_set_pointer
* @brief Re-tag @p v as a non-owning POINTER and assign @p x. * * As with `variant_from_pointer`, the variant does NOT take ownership; * the caller
variant/variant.c:452
Functionvariant_set_string
* @brief Re-tag @p v as STRING with a deep-copied @p x. * * Safe even when @p x is a pointer the variant currently owns (e.g. the * result of `vari
variant/variant.c:474
Functionvariant_swap
* @brief Swap the contents of two variants. O(1), no allocation. * * After this call @p a holds what @p b held and vice versa. No * destructors run
variant/variant.c:592
Functionvariant_take
* @brief Detach the owned payload (string buffer or custom data * pointer) without freeing it. After this call @p v is NONE * and the
variant/variant.c:612
Functionvariant_type
* @brief Return the variant's tag. * @param v Variant. May be NULL. * @return `v->type` for a valid pointer; `VARIANT_TYPE_NONE` for NULL. */
variant/variant.c:641
← previousnext →2,501–2,600 of 2,651, ranked by callers