new: custom pool dirs and remove ctx path functions

This commit is contained in:
ngn
2024-08-03 22:23:32 +03:00
parent 960596ae3a
commit 7c3d0dc1f8
35 changed files with 346 additions and 356 deletions

@ -1,10 +1,10 @@
#include "../../include/all.h"
#include "../common.h"
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#define DATA_DIR "./examples"
int main(int argc, char *argv[]) {
int ret = EXIT_FAILURE;
lm_ctx_t ctx;
@ -14,14 +14,12 @@ int main(int argc, char *argv[]) {
return ret;
}
lm_ctx_init(&ctx);
if (!lm_ctx_set_data(&ctx, DATA_DIR)) {
printf("failed to set data dir: %s (%d)\n", lm_strerror(), lm_error());
if (!lm_ctx_init(&ctx, NULL, TEMP_DIR, NULL)) {
printf("failed to init the ctx: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}
if (lm_ctx_pool_add(&ctx, "test", "mptp://127.0.0.1:5858") == NULL) {
if (lm_ctx_pool_add(&ctx, "test", "mptp://127.0.0.1:5858", "./examples/test") == NULL) {
printf("failed to add pool: %s (%d)\n", lm_strerror(), lm_error());
goto end;
}