tor_multipath_voip/src/algo_skel.c

14 lines
385 B
C
Raw Normal View History

2019-02-13 14:32:38 +00:00
#include "algo_skel.h"
2019-03-19 09:00:03 +00:00
void init_algo(struct evt_core_ctx* ctx, struct algo_skel* as, char* name) {
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-19 09:00:03 +00:00
available_algo[i].init(ctx, as);
2019-02-13 14:32:38 +00:00
return;
}
}
fprintf(stderr, "Algorithm %s has not been found\n", name);
exit(EXIT_FAILURE);
}