2015-08-16 18:59:54 +02:00
|
|
|
#ifndef __PACKAGE_H__
|
2015-08-16 09:53:30 +02:00
|
|
|
|
|
|
|
#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;
|
2015-08-16 18:59:54 +02:00
|
|
|
list_t file_list;
|
2015-08-16 09:53:30 +02:00
|
|
|
int id;
|
|
|
|
char *name;
|
|
|
|
char *version;
|
|
|
|
char *filename;
|
|
|
|
char *description;
|
|
|
|
}package_t;
|
|
|
|
|
2015-08-16 18:59:54 +02:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2015-08-16 09:53:30 +02:00
|
|
|
collection_t* load_collection_file(const char *name);
|
|
|
|
collection_t* load_collection_buffer(const char *buffer);
|
|
|
|
|
2015-08-16 16:12:29 +02:00
|
|
|
int build_install_list(list_t *list, collection_t *collection);
|
|
|
|
int build_download_list(list_t *download, list_t *src);
|
2015-08-16 21:06:43 +02:00
|
|
|
void remove_missing_packages(list_t *install, list_t *missed);
|
2015-08-16 16:12:29 +02:00
|
|
|
char *make_cache_path(const char *path);
|
|
|
|
|
2015-08-16 18:59:54 +02:00
|
|
|
void do_download(list_t *download);
|
2015-08-16 21:06:43 +02:00
|
|
|
void do_install(list_t *install);
|
2015-08-16 18:59:54 +02:00
|
|
|
|
2015-08-16 09:53:30 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-08-16 18:59:54 +02:00
|
|
|
#endif /* __PACKAGE_H__ */
|
|
|
|
|