10/14
This commit is contained in:
1 parent
ee4bcc3b77
commit
ae54f74070
53 files changed
+8916
-1424
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include <libconfig.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "common.h"
|
||||
@@ -43,44 +44,57 @@ typedef struct {
|
||||
}
|
||||
gl_pkg_t;
|
||||
|
||||
extern dep_t null_dep;
|
||||
extern conf_t null_conf;
|
||||
extern gl_pkg_t empty;
|
||||
|
||||
semver_t gl_pkgver(int major, int minor, int patch);
|
||||
semver_t gl_parse_semver(const char *str);
|
||||
void gl_free_semver(semver_t *v);
|
||||
|
||||
gl_pkg_t *gl_spawn_pkg(
|
||||
char *name, semver_t *ver, char *desc,
|
||||
char *maint, char *copy, char *repo,
|
||||
dep_t *dep, conf_t *conf
|
||||
);
|
||||
|
||||
void gl_show_pkg_props(const gl_pkg_t *pkg);
|
||||
void gl_free_pkg(gl_pkg_t *pkg);
|
||||
|
||||
int gl_mkdir(dir_t *dir);
|
||||
char *gl_cat_dir(const dir_t *a, const dir_t *b);
|
||||
char *gl_cat_dir_and_ver(const dir_t *base, const gl_pkg_t *pkg);
|
||||
dir_t gl_return_dir(const dir_t *a, const dir_t *b, mode_t mode);
|
||||
dir_t gl_return_dir_and_ver(const dir_t *base, gl_pkg_t *pkg, mode_t mode);
|
||||
void gl_free_path(char *path);
|
||||
void gl_free_dir(dir_t *dir);
|
||||
|
||||
typedef enum {
|
||||
GL_CONF_OK = 0,
|
||||
GL_CONF_ERR_READ = 1,
|
||||
GL_CONF_ERR_MISSING = 2,
|
||||
GL_CONF_ERR_TYPE = 3
|
||||
GL_CONF_ERR_TYPE = 3,
|
||||
GL_CONF_ERR_INVALID = 4,
|
||||
GL_CONF_ERR_SPACE = 5
|
||||
} gl_conf_status_t;
|
||||
|
||||
#define GL_CONF_PATH "/etc/glacier/glacier.conf"
|
||||
|
||||
gl_conf_status_t gl_conf_get_int(const char *path, const char *key, int *out);
|
||||
gl_conf_status_t gl_conf_repo_keys(const char *path, const char *repo,
|
||||
char *out, size_t outlen);
|
||||
gl_conf_status_t gl_conf_repos(const char *path, char *out, size_t outlen);
|
||||
|
||||
/* A repository index (REPO_DESIGN.txt section 4), as gl_index_parse
|
||||
* reads it. deps/confs are "NAME VER\n" lines ("" for none). */
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *ver;
|
||||
char *file;
|
||||
char *sha256;
|
||||
int64_t size;
|
||||
char *deps;
|
||||
char *confs;
|
||||
} gl_index_pkg_t;
|
||||
|
||||
typedef struct {
|
||||
char *repo;
|
||||
int64_t serial;
|
||||
int64_t valid_until;
|
||||
size_t npkgs;
|
||||
gl_index_pkg_t *pkgs;
|
||||
} gl_index_t;
|
||||
|
||||
typedef enum {
|
||||
GL_INDEX_OK = 0,
|
||||
GL_INDEX_ERR_FORMAT = 1,
|
||||
GL_INDEX_ERR_REPO = 2,
|
||||
GL_INDEX_ERR_NOMEM = 3
|
||||
} gl_index_status_t;
|
||||
|
||||
gl_index_status_t gl_index_parse(const char *text, size_t len,
|
||||
const char *repo, gl_index_t *out);
|
||||
void gl_index_free(gl_index_t *idx);
|
||||
|
||||
bool gl_valid_pkg_ident(const char *s);
|
||||
int gl_gpm2gpkg(const char *filename, gl_pkg_t *pkg);
|
||||
char *join_with_cwd(const char *path);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user