path: root/src/package.h
diff options
Diffstat (limited to 'src/package.h')
1 files changed, 40 insertions, 40 deletions
diff --git a/src/package.h b/src/package.h
index fa39f6d..429e495 100644
--- a/src/package.h
+++ b/src/package.h
@@ -51,12 +51,12 @@ typedef struct {
SLAPT_BOOL_T installed;
} slapt_pkg_info_t;
-struct slapt_pkg_list {
+typedef struct {
slapt_pkg_info_t **pkgs;
unsigned int pkg_count;
SLAPT_BOOL_T free_pkgs;
SLAPT_BOOL_T ordered;
+} slapt_pkg_list_t;
typedef struct {
slapt_pkg_info_t *installed;
@@ -64,21 +64,21 @@ typedef struct {
SLAPT_BOOL_T reinstall;
} slapt_pkg_upgrade_t;
-struct slapt_pkg_upgrade_list {
+typedef struct {
slapt_pkg_upgrade_t **pkgs;
unsigned int pkg_count;
unsigned int reinstall_count;
+} slapt_pkg_upgrade_list_t;
typedef struct {
char *pkg;
char *error;
} slapt_pkg_err_t;
-struct slapt_pkg_err_list {
+typedef struct {
slapt_pkg_err_t **errs;
unsigned int err_count;
+} slapt_pkg_err_list_t;
/* returns an empty package structure */
__inline slapt_pkg_info_t *slapt_init_pkg(void);
@@ -86,12 +86,12 @@ __inline slapt_pkg_info_t *slapt_init_pkg(void);
void slapt_free_pkg(slapt_pkg_info_t *pkg);
/* create an empty package list */
-struct slapt_pkg_list *slapt_init_pkg_list(void);
+slapt_pkg_list_t *slapt_init_pkg_list(void);
/* add a package to a package list */
-void slapt_add_pkg_to_pkg_list(struct slapt_pkg_list *list,
+void slapt_add_pkg_to_pkg_list(slapt_pkg_list_t *list,
slapt_pkg_info_t *pkg);
/* free package list */
-void slapt_free_pkg_list(struct slapt_pkg_list *);
+void slapt_free_pkg_list(slapt_pkg_list_t *);
update the local package cache. Must be chdir'd to working_dir.
@@ -99,31 +99,31 @@ void slapt_free_pkg_list(struct slapt_pkg_list *);
int slapt_update_pkg_cache(const slapt_rc_config *global_config);
/* write pkg data to disk */
void slapt_write_pkg_data(const char *source_url,FILE *d_file,
- struct slapt_pkg_list *pkgs);
+ slapt_pkg_list_t *pkgs);
/* parse the PACKAGES.TXT file */
-struct slapt_pkg_list *slapt_parse_packages_txt(FILE *);
+slapt_pkg_list_t *slapt_parse_packages_txt(FILE *);
return a list of available packages. Must be chdir'd to
rc_config->working_dir. Otherwise, open a filehandle to the package data
and pass it to slapt_parse_packages_txt();
-struct slapt_pkg_list *slapt_get_available_pkgs(void);
+slapt_pkg_list_t *slapt_get_available_pkgs(void);
/* retrieve list of installed pkgs */
-struct slapt_pkg_list *slapt_get_installed_pkgs(void);
+slapt_pkg_list_t *slapt_get_installed_pkgs(void);
/* retrieve the newest package from package list */
-slapt_pkg_info_t *slapt_get_newest_pkg(struct slapt_pkg_list *,const char *);
+slapt_pkg_info_t *slapt_get_newest_pkg(slapt_pkg_list_t *,const char *);
/* get the exact package */
-slapt_pkg_info_t *slapt_get_exact_pkg(struct slapt_pkg_list *list,
+slapt_pkg_info_t *slapt_get_exact_pkg(slapt_pkg_list_t *list,
const char *name,
const char *version);
/* lookup package by details */
-slapt_pkg_info_t *slapt_get_pkg_by_details(struct slapt_pkg_list *list,
+slapt_pkg_info_t *slapt_get_pkg_by_details(slapt_pkg_list_t *list,
const char *name,
const char *version,
const char *location);
/* search package list with pattern */
-struct slapt_pkg_list *slapt_search_pkg_list(struct slapt_pkg_list *list,
+slapt_pkg_list_t *slapt_search_pkg_list(slapt_pkg_list_t *list,
const char *pattern);
@@ -145,10 +145,10 @@ int slapt_upgrade_pkg(const slapt_rc_config *global_config,
int slapt_remove_pkg(const slapt_rc_config *,slapt_pkg_info_t *);
/* get a list of obsolete packages */
-struct slapt_pkg_list *
+slapt_pkg_list_t *
slapt_get_obsolete_pkgs ( const slapt_rc_config *global_config,
- struct slapt_pkg_list *avail_pkgs,
- struct slapt_pkg_list *installed_pkgs);
+ slapt_pkg_list_t *avail_pkgs,
+ slapt_pkg_list_t *installed_pkgs);
@@ -191,7 +191,7 @@ slapt_code_t slapt_verify_downloaded_pkg(const slapt_rc_config *global_config,
fill in the md5sum of the package
-void slapt_get_md5sums(struct slapt_pkg_list *pkgs, FILE *checksum_file);
+void slapt_get_md5sums(slapt_pkg_list_t *pkgs, FILE *checksum_file);
find out the pkg file size (post download)
@@ -214,26 +214,26 @@ int slapt_cmp_pkgs(slapt_pkg_info_t *a, slapt_pkg_info_t *b);
(usually called with transaction->conflict_err and transaction->missing_err)
int slapt_get_pkg_dependencies(const slapt_rc_config *global_config,
- struct slapt_pkg_list *avail_pkgs,
- struct slapt_pkg_list *installed_pkgs,
+ slapt_pkg_list_t *avail_pkgs,
+ slapt_pkg_list_t *installed_pkgs,
slapt_pkg_info_t *pkg,
- struct slapt_pkg_list *deps,
- struct slapt_pkg_err_list *conflict_err,
- struct slapt_pkg_err_list *missing_err);
+ slapt_pkg_list_t *deps,
+ slapt_pkg_err_list_t *conflict_err,
+ slapt_pkg_err_list_t *missing_err);
return list of package conflicts
-struct slapt_pkg_list *slapt_get_pkg_conflicts(struct slapt_pkg_list *avail_pkgs,
- struct slapt_pkg_list *installed_pkgs,
+slapt_pkg_list_t *slapt_get_pkg_conflicts(slapt_pkg_list_t *avail_pkgs,
+ slapt_pkg_list_t *installed_pkgs,
slapt_pkg_info_t *pkg);
return list of packages required by
-struct slapt_pkg_list *slapt_is_required_by(const slapt_rc_config *global_config,
- struct slapt_pkg_list *avail,
- struct slapt_pkg_list *installed_pkgs,
- struct slapt_pkg_list *pkgs_to_install,
- struct slapt_pkg_list *pkgs_to_remove,
+slapt_pkg_list_t *slapt_is_required_by(const slapt_rc_config *global_config,
+ slapt_pkg_list_t *avail,
+ slapt_pkg_list_t *installed_pkgs,
+ slapt_pkg_list_t *pkgs_to_install,
+ slapt_pkg_list_t *pkgs_to_remove,
slapt_pkg_info_t *pkg);
@@ -246,7 +246,7 @@ void slapt_clean_pkg_dir(const char *dir_name);
void slapt_purge_old_cached_pkgs(const slapt_rc_config *global_config,
const char *dir_name,
- struct slapt_pkg_list *avail_pkgs);
+ slapt_pkg_list_t *avail_pkgs);
make a copy of a package (needs to be freed with free_pkg)
@@ -256,20 +256,20 @@ slapt_pkg_info_t *slapt_copy_pkg(slapt_pkg_info_t *dst,slapt_pkg_info_t *src);
package error handling api to handle errors within core functions
-struct slapt_pkg_err_list *slapt_init_pkg_err_list(void);
-void slapt_add_pkg_err_to_list(struct slapt_pkg_err_list *l,
+slapt_pkg_err_list_t *slapt_init_pkg_err_list(void);
+void slapt_add_pkg_err_to_list(slapt_pkg_err_list_t *l,
const char *pkg,const char *err);
-int slapt_search_pkg_err_list(struct slapt_pkg_err_list *l,
+int slapt_search_pkg_err_list(slapt_pkg_err_list_t *l,
const char *pkg, const char *err);
-void slapt_free_pkg_err_list(struct slapt_pkg_err_list *l);
+void slapt_free_pkg_err_list(slapt_pkg_err_list_t *l);
download the PACKAGES.TXT and CHECKSUMS.md5 files
compressed is set to 1 if the compressed version was downloaded.
-struct slapt_pkg_list *slapt_get_pkg_source_packages (const slapt_rc_config *global_config,
+slapt_pkg_list_t *slapt_get_pkg_source_packages (const slapt_rc_config *global_config,
const char *url, unsigned int *compressed);
-struct slapt_pkg_list *slapt_get_pkg_source_patches (const slapt_rc_config *global_config,
+slapt_pkg_list_t *slapt_get_pkg_source_patches (const slapt_rc_config *global_config,
const char *url, unsigned int *compressed);
FILE *slapt_get_pkg_source_checksums (const slapt_rc_config *global_config,
const char *url, unsigned int *compressed);