2024-07-01 03:43:20 +00:00
|
|
|
#pragma once
|
|
|
|
#include "types.h"
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#define PKG_DATA_SIZE "size"
|
|
|
|
#define PKG_DATA_DESC "desc"
|
|
|
|
#define PKG_DATA_VERSION "version"
|
|
|
|
#define PKG_DATA_DEPENDS "depends"
|
2024-07-03 00:40:52 +00:00
|
|
|
#define PKG_DATA_KEEPS "keeps"
|
2024-07-01 03:43:20 +00:00
|
|
|
|
|
|
|
lm_pkg_t *lm_package_new();
|
|
|
|
void lm_package_free(lm_pkg_t *pkg);
|
2024-07-02 01:44:07 +00:00
|
|
|
bool lm_package_verify(lm_pkg_t *pkg);
|
2024-07-02 03:04:29 +00:00
|
|
|
void lm_package_init(lm_pkg_t *pkg);
|
2024-07-01 03:43:20 +00:00
|
|
|
|
|
|
|
bool lm_package_data_load(lm_pkg_t *pkg, char *file);
|
|
|
|
void lm_package_data_free(lm_pkg_t *pkg);
|
|
|
|
|
2024-07-04 00:12:33 +00:00
|
|
|
bool lm_package_downloaded(lm_pkg_t *pkg);
|
2024-07-01 03:43:20 +00:00
|
|
|
bool lm_package_depend_add(lm_pkg_t *pkg, char *depend);
|
|
|
|
size_t lm_package_depend_count(lm_pkg_t *pkg);
|
2024-07-02 01:44:07 +00:00
|
|
|
size_t lm_package_depend_strlen(lm_pkg_t *pkg);
|
|
|
|
bool lm_package_depend_tostr(lm_pkg_t *pkg, char *buffer);
|
2024-07-02 03:04:29 +00:00
|
|
|
bool lm_package_depend_fromstr(lm_pkg_t *pkg, char *buffer);
|
|
|
|
void lm_package_depend_free(lm_pkg_t *pkg);
|
2024-07-02 01:44:07 +00:00
|
|
|
|
|
|
|
size_t lm_package_keep_count(lm_pkg_t *pkg);
|
|
|
|
bool lm_package_keep_add(lm_pkg_t *pkg, char *path);
|
|
|
|
bool lm_package_keep_contains(lm_pkg_t *pkg, char *path);
|
2024-07-03 00:40:52 +00:00
|
|
|
void lm_package_keep_free(lm_pkg_t *pkg);
|
2024-07-01 03:43:20 +00:00
|
|
|
|
|
|
|
bool lm_package_path_set_signature(lm_pkg_t *pkg, char *signature_path);
|
|
|
|
bool lm_package_path_set_archive(lm_pkg_t *pkg, char *archive_path);
|
|
|
|
bool lm_package_path_is_empty(lm_pkg_t *pkg);
|
|
|
|
void lm_package_path_free(lm_pkg_t *pkg);
|