new: custom pool dirs and remove ctx path functions
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user