kolibrios/contrib/other/kpm/package.h
Sergey Semyonov (Serge) b098d55252 kpm: and finally unpack packages to tmp disk. just for testing.
git-svn-id: svn://kolibrios.org@5729 a494cfbc-eb01-0410-851d-a64ba20cac60
2015-08-16 19:06:43 +00:00

60 lines
1.1 KiB
C

#ifndef __PACKAGE_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "list.h"
typedef struct
{
list_t groups;
char *issue;
}collection_t;
typedef struct
{
list_t list;
list_t packages;
char *name;
}pkg_group_t;
typedef struct package
{
list_t list;
list_t file_list;
int id;
char *name;
char *version;
char *filename;
char *description;
}package_t;
static inline void list_del_pkg(package_t *pkg)
{
list_del(&pkg->list);
free(pkg->description);
free(pkg->filename);
free(pkg->version);
free(pkg->name);
free(pkg);
};
collection_t* load_collection_file(const char *name);
collection_t* load_collection_buffer(const char *buffer);
int build_install_list(list_t *list, collection_t *collection);
int build_download_list(list_t *download, list_t *src);
void remove_missing_packages(list_t *install, list_t *missed);
char *make_cache_path(const char *path);
void do_download(list_t *download);
void do_install(list_t *install);
#ifdef __cplusplus
}
#endif
#endif /* __PACKAGE_H__ */