2019-02-13 14:32:38 +00:00
|
|
|
#include "algo_skel.h"
|
|
|
|
|
2019-03-28 10:54:01 +00:00
|
|
|
void init_algo(struct evt_core_ctx* ctx, struct algo_skel* as, char* name, struct algo_params* ap) {
|
2019-02-13 14:32:38 +00:00
|
|
|
for (int i = 0; i < sizeof(available_algo) / sizeof(available_algo[0]); i++) {
|
|
|
|
if (strcmp(available_algo[i].name, name) == 0) {
|
2019-03-28 10:54:01 +00:00
|
|
|
available_algo[i].init(ctx, as, ap);
|
2019-02-13 14:32:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(stderr, "Algorithm %s has not been found\n", name);
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|