tor_multipath_voip/src/algo_skel.c

13 lines
412 B
C
Raw Normal View History

2019-02-13 14:32:38 +00:00
#include "algo_skel.h"
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) {
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);
}