libmp/include/package.h

33 lines
1.1 KiB
C

#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"
lm_pkg_t *lm_package_new();
void lm_package_free(lm_pkg_t *pkg);
bool lm_package_verify(lm_pkg_t *pkg);
void lm_package_init(lm_pkg_t *pkg);
bool lm_package_data_load(lm_pkg_t *pkg, char *file);
void lm_package_data_free(lm_pkg_t *pkg);
bool lm_package_depend_add(lm_pkg_t *pkg, char *depend);
size_t lm_package_depend_count(lm_pkg_t *pkg);
size_t lm_package_depend_strlen(lm_pkg_t *pkg);
bool lm_package_depend_tostr(lm_pkg_t *pkg, char *buffer);
bool lm_package_depend_fromstr(lm_pkg_t *pkg, char *buffer);
void lm_package_depend_free(lm_pkg_t *pkg);
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);
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);