2024-06-20 00:34:32 +00:00
|
|
|
#pragma once
|
|
|
|
#include "url.h"
|
2024-07-01 03:43:20 +00:00
|
|
|
|
2024-06-20 00:34:32 +00:00
|
|
|
#include <stdbool.h>
|
2024-06-22 22:55:01 +00:00
|
|
|
#include <stddef.h>
|
2024-07-01 03:43:20 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
typedef struct lm_pkg_path {
|
|
|
|
char *archive;
|
|
|
|
char *signature;
|
|
|
|
} lm_pkg_path_t;
|
2024-06-22 22:55:01 +00:00
|
|
|
|
2024-06-26 19:33:20 +00:00
|
|
|
typedef struct lm_pkg {
|
|
|
|
struct lm_pkg *next;
|
2024-07-01 03:43:20 +00:00
|
|
|
lm_pkg_path_t paths;
|
2024-06-26 19:33:20 +00:00
|
|
|
char *name;
|
|
|
|
char *desc;
|
|
|
|
char **depends;
|
|
|
|
char *version;
|
2024-07-01 03:43:20 +00:00
|
|
|
size_t size;
|
2024-06-26 19:33:20 +00:00
|
|
|
} lm_pkg_t;
|
|
|
|
|
2024-06-22 22:55:01 +00:00
|
|
|
typedef struct lm_pool_info {
|
2024-07-01 03:43:20 +00:00
|
|
|
char *maintainer;
|
|
|
|
char *pubkey;
|
|
|
|
ssize_t size;
|
2024-06-22 22:55:01 +00:00
|
|
|
} lm_pool_info_t;
|
2024-06-20 00:34:32 +00:00
|
|
|
|
2024-07-01 03:43:20 +00:00
|
|
|
typedef struct lm_pool_path {
|
|
|
|
char *packages;
|
2024-06-28 17:51:56 +00:00
|
|
|
char *list;
|
|
|
|
char *info;
|
2024-07-01 03:43:20 +00:00
|
|
|
} lm_pool_path_t;
|
2024-06-28 17:51:56 +00:00
|
|
|
|
2024-06-20 00:34:32 +00:00
|
|
|
typedef struct lm_pool {
|
|
|
|
struct lm_pool *next;
|
2024-06-22 22:55:01 +00:00
|
|
|
lm_pool_info_t info;
|
2024-07-01 03:43:20 +00:00
|
|
|
lm_pool_path_t paths;
|
2024-06-20 22:36:56 +00:00
|
|
|
lm_url_t url;
|
2024-06-26 19:33:20 +00:00
|
|
|
lm_pkg_t *pkg;
|
2024-06-20 22:36:56 +00:00
|
|
|
bool available;
|
|
|
|
char *name;
|
2024-06-20 00:34:32 +00:00
|
|
|
} lm_pool_t;
|
|
|
|
|
|
|
|
typedef struct lm_ctx {
|
2024-06-28 17:51:56 +00:00
|
|
|
lm_pool_t *pools; // pool list
|
|
|
|
char *root; // root path for package installtion
|
|
|
|
char *temp; // temp path
|
|
|
|
char *data; // package database path
|
|
|
|
const char *version; // libmp version (read-only)
|
2024-06-20 00:34:32 +00:00
|
|
|
} lm_ctx_t;
|