libmp/include/ctx.h

25 lines
1.1 KiB
C

#pragma once
#include "types.h"
#include <stdbool.h>
typedef void (*lm_ctx_pool_callback_t)(lm_ctx_t *ctx, lm_pool_t *pool, bool status, void *data);
void lm_ctx_init(lm_ctx_t *ctx);
bool lm_ctx_set_data(lm_ctx_t *ctx, char *dir);
bool lm_ctx_set_root(lm_ctx_t *ctx, char *dir);
bool lm_ctx_set_temp(lm_ctx_t *ctx, char *dir);
void lm_ctx_free(lm_ctx_t *ctx);
lm_pool_t *lm_ctx_pool_add(lm_ctx_t *ctx, char *name, char *url);
bool lm_ctx_pool_del(lm_ctx_t *ctx, char *name);
void lm_ctx_pool_clear(lm_ctx_t *ctx);
bool lm_ctx_pool_serve(lm_ctx_t *ctx, char *addr, uint8_t threads);
void lm_ctx_pool_test(lm_ctx_t *ctx, lm_ctx_pool_callback_t callback, void *data);
void lm_ctx_pool_get_info(
lm_ctx_t *ctx, bool allow_update, bool force_update, lm_ctx_pool_callback_t callback, void *data);
void lm_ctx_pool_get_list(
lm_ctx_t *ctx, bool allow_update, bool force_update, lm_ctx_pool_callback_t callback, void *data);
lm_pkg_t *lm_ctx_package_install(lm_ctx_t *ctx, char *name, char *version);
lm_pkg_t *lm_ctx_package_get(lm_ctx_t *ctx, char *name, char *version);