12 lines
412 B
C
12 lines
412 B
C
#include "algo_skel.h"
|
|
|
|
void init_algo(struct evt_core_ctx* ctx, struct algo_skel* as, char* name, struct algo_params* ap) {
|
|
for (int i = 0; i < sizeof(available_algo) / sizeof(available_algo[0]); i++) {
|
|
if (strcmp(available_algo[i].name, name) == 0) {
|
|
available_algo[i].init(ctx, as, ap);
|
|
return;
|
|
}
|
|
}
|
|
fprintf(stderr, "Algorithm %s has not been found\n", name);
|
|
exit(EXIT_FAILURE);
|
|
}
|