2024-06-20 00:34:32 +00:00
|
|
|
#pragma once
|
2024-06-25 18:21:15 +00:00
|
|
|
#include "mptp.h"
|
2024-07-31 18:16:19 +00:00
|
|
|
#include "package.h"
|
|
|
|
#include "url.h"
|
2024-06-26 19:33:20 +00:00
|
|
|
|
2024-06-20 22:36:56 +00:00
|
|
|
#include <stdbool.h>
|
2024-06-25 18:21:15 +00:00
|
|
|
#include <sys/socket.h>
|
|
|
|
|
2024-07-31 18:16:19 +00:00
|
|
|
typedef struct lm_pool_info {
|
|
|
|
char *maintainer;
|
|
|
|
char *pubkey;
|
|
|
|
ssize_t size;
|
|
|
|
} lm_pool_info_t;
|
|
|
|
|
|
|
|
typedef struct lm_pool {
|
|
|
|
struct lm_pool *next;
|
|
|
|
lm_pool_info_t info;
|
|
|
|
lm_url_t url;
|
|
|
|
lm_pkg_t *pkg;
|
|
|
|
char *name;
|
|
|
|
char *info_file;
|
|
|
|
char *list_file;
|
|
|
|
char *dir;
|
|
|
|
bool available, loaded;
|
|
|
|
} lm_pool_t;
|
|
|
|
|
2024-06-27 20:05:39 +00:00
|
|
|
#define POOL_INFO_SIZE "size"
|
|
|
|
#define POOL_INFO_PUBKEY "pubkey"
|
|
|
|
#define POOL_INFO_MAINTAINER "maintainer"
|
|
|
|
|
2024-06-22 22:55:01 +00:00
|
|
|
lm_pool_t *lm_pool_new(char *name, char *url);
|
|
|
|
void lm_pool_test(lm_pool_t *pool);
|
|
|
|
void lm_pool_free(lm_pool_t *pool);
|
2024-06-26 19:33:20 +00:00
|
|
|
|
2024-07-01 03:43:20 +00:00
|
|
|
lm_pkg_t *lm_pool_package_find(lm_pool_t *pool, char *name, char *version);
|
|
|
|
bool lm_pool_package_add(lm_pool_t *pool, lm_pkg_t *pkg);
|
|
|
|
|
2024-07-02 01:44:07 +00:00
|
|
|
bool lm_pool_path_set_dir(lm_pool_t *pool, char *dir);
|
2024-07-01 03:43:20 +00:00
|
|
|
bool lm_pool_path_is_empty(lm_pool_t *pool);
|
2024-06-28 17:51:56 +00:00
|
|
|
|
2024-07-05 13:27:11 +00:00
|
|
|
bool lm_pool_info_download(lm_pool_t *pool, lm_mptp_transfer_callback_t callback, void *data);
|
2024-06-28 20:09:24 +00:00
|
|
|
bool lm_pool_info_load(lm_pool_t *pool);
|
2024-06-26 19:33:20 +00:00
|
|
|
void lm_pool_info_free(lm_pool_t *pool);
|
|
|
|
|
2024-08-03 19:23:32 +00:00
|
|
|
bool lm_pool_list_download(lm_pool_t *pool, char *dir, lm_mptp_transfer_callback_t callback, void *data);
|
|
|
|
bool lm_pool_list_load(lm_pool_t *pool, char *dir);
|
2024-07-02 01:44:07 +00:00
|
|
|
void lm_pool_list_free(lm_pool_t *pool);
|