MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / algorithm_copy_backward

Function algorithm_copy_backward

algorithm/algorithm.c:1293–1307  ·  view source on GitHub ↗

* @brief Copies a range of elements in reverse order. * * @param first Pointer to the start of the range. * @param last Pointer to the end of the range. * @param size Size of each element in bytes. * @param result Pointer to the destination array where elements will be copied. */

Source from the content-addressed store, hash-verified

1291/**
1292 * @brief Finds the first element in a range that matches any element in another range.
1293 *
1294 * This function searches for the first element in the range `[base1, base1 + num1 * size1)` that matches
1295 * any element in the range `[base2, base2 + num2 * size2)`.
1296 *
1297 * @param base1 Pointer to the start of the main array.
1298 * @param num1 Number of elements in the main array.
1299 * @param size1 Size of each element in the main array in bytes.
1300 * @param base2 Pointer to the start of the array to search for matches.
1301 * @param num2 Number of elements in the array to search for matches.
1302 * @param size2 Size of each element in the array to search for matches in bytes.
1303 * @param comp Comparison function used to compare elements.
1304 * It should return 0 if the elements are equal, and a non-zero value otherwise.
1305 *
1306 * @return Pointer to the first matching element in `base1`, or `NULL` if no match is found.
1307 */
1308void *algorithm_find_first_of(const void *base1, size_t num1, size_t size1, const void *base2, size_t num2, size_t size2, CompareFunc comp) {
1309 ALGORITHM_LOG("[algorithm_find_first_of] Info: Searching for the first occurrence of any element from the second array in the main array.");
1310

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected