2022-03-21 21:11:46 +01:00
|
|
|
/******************************************************************************/
|
|
|
|
/* SlunkCrypt, by LoRd_MuldeR <MuldeR2@GMX.de> */
|
|
|
|
/* This work has been released under the CC0 1.0 Universal license! */
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef INC_SLUNKCRYPT_THREAD_H
|
|
|
|
#define INC_SLUNKCRYPT_THREAD_H
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-03-21 22:45:29 +01:00
|
|
|
#define MIN_THREADS 1U
|
|
|
|
#define MAX_THREADS 16U
|
2022-03-21 21:11:46 +01:00
|
|
|
#define THRDPL_NULL ((thrdpl_t)NULL)
|
|
|
|
|
2022-03-21 22:45:29 +01:00
|
|
|
typedef void (*thrdpl_worker_t)(const size_t thread_count, void *const context, const uint8_t *const input, uint8_t *const output, const size_t length);
|
2022-03-21 21:11:46 +01:00
|
|
|
typedef uintptr_t thrdpl_t;
|
|
|
|
|
2022-03-21 22:45:29 +01:00
|
|
|
thrdpl_t slunkcrypt_thrdpl_create(const size_t count);
|
|
|
|
size_t slunkcrypt_thrdpl_count(const thrdpl_t thrdpl);
|
|
|
|
void slunkcrypt_thrdpl_exec(const thrdpl_t thrdpl, const size_t index, const thrdpl_worker_t worker, void *const context, const uint8_t *const input, uint8_t *const output, const size_t length);
|
|
|
|
void slunkcrypt_thrdpl_await(const thrdpl_t thrdpl);
|
|
|
|
void slunkcrypt_thrdpl_destroy(const thrdpl_t thrdpl);
|
2022-03-21 21:11:46 +01:00
|
|
|
|
2022-03-21 22:45:29 +01:00
|
|
|
#endif
|