2009-08-17 22:37:20 +05:30
|
|
|
/*-
|
2012-01-19 16:56:40 +05:30
|
|
|
* Copyright (c) 2009-2012 Juan Romero Pardines.
|
2009-08-17 22:37:20 +05:30
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XBPS_BIN_DEFS_H_
|
|
|
|
#define _XBPS_BIN_DEFS_H_
|
|
|
|
|
2011-07-27 21:34:38 +05:30
|
|
|
#include <sys/time.h>
|
2011-01-22 17:10:19 +05:30
|
|
|
#include <xbps_api.h>
|
|
|
|
|
2012-06-14 11:52:11 +05:30
|
|
|
#ifndef __UNCONST
|
|
|
|
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
|
|
|
|
#endif
|
|
|
|
|
2011-07-27 21:34:38 +05:30
|
|
|
struct xferstat {
|
|
|
|
struct timeval start;
|
|
|
|
struct timeval last;
|
|
|
|
};
|
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
struct list_pkgver_cb {
|
|
|
|
pkg_state_t state;
|
|
|
|
size_t pkgver_len;
|
2012-07-31 21:20:50 +05:30
|
|
|
size_t maxcols;
|
2011-12-03 15:07:31 +05:30
|
|
|
bool check_state;
|
2011-11-11 14:48:52 +05:30
|
|
|
};
|
|
|
|
|
2011-11-25 15:50:03 +05:30
|
|
|
/* from transaction.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int install_new_pkg(struct xbps_handle *, const char *, bool);
|
|
|
|
int update_pkg(struct xbps_handle *, const char *);
|
2012-07-31 21:20:50 +05:30
|
|
|
int remove_pkg(struct xbps_handle *, const char *, size_t, bool);
|
|
|
|
int remove_pkg_orphans(struct xbps_handle *, size_t, bool, bool);
|
|
|
|
int dist_upgrade(struct xbps_handle *, size_t, bool, bool, bool);
|
|
|
|
int exec_transaction(struct xbps_handle *, size_t, bool, bool, bool);
|
2011-07-27 20:43:54 +05:30
|
|
|
|
2011-10-27 20:38:48 +05:30
|
|
|
/* from remove.c */
|
2011-07-27 20:43:54 +05:30
|
|
|
int remove_installed_pkgs(int, char **, bool, bool, bool, bool);
|
|
|
|
|
|
|
|
/* from check.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int check_pkg_integrity(struct xbps_handle *,
|
|
|
|
prop_dictionary_t,
|
|
|
|
const char *,
|
|
|
|
bool,
|
|
|
|
bool *);
|
|
|
|
int check_pkg_integrity_all(struct xbps_handle *);
|
2011-07-27 20:43:54 +05:30
|
|
|
|
2011-12-29 21:13:52 +05:30
|
|
|
#define CHECK_PKG_DECL(type) \
|
2012-06-14 11:52:11 +05:30
|
|
|
int check_pkg_##type (struct xbps_handle *, const char *, void *, bool *)
|
2011-10-27 20:38:48 +05:30
|
|
|
|
|
|
|
CHECK_PKG_DECL(autoinstall);
|
2012-10-25 12:59:56 +05:30
|
|
|
CHECK_PKG_DECL(unneeded);
|
2011-10-27 20:38:48 +05:30
|
|
|
CHECK_PKG_DECL(files);
|
|
|
|
CHECK_PKG_DECL(rundeps);
|
|
|
|
CHECK_PKG_DECL(symlinks);
|
2011-10-28 04:27:16 +05:30
|
|
|
CHECK_PKG_DECL(requiredby);
|
2011-10-27 20:38:48 +05:30
|
|
|
|
2011-07-27 20:43:54 +05:30
|
|
|
/* from show-deps.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int show_pkg_deps(struct xbps_handle *, const char *);
|
|
|
|
int show_pkg_reverse_deps(struct xbps_handle *, const char *);
|
2011-07-27 20:43:54 +05:30
|
|
|
|
|
|
|
/* from show-info-files.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int show_pkg_info_from_metadir(struct xbps_handle *, const char *, const char *);
|
|
|
|
int show_pkg_files_from_metadir(struct xbps_handle *, const char *);
|
2011-07-27 20:43:54 +05:30
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
/* from show-orphans.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int show_orphans(struct xbps_handle *);
|
2011-11-11 14:48:52 +05:30
|
|
|
|
2011-07-27 20:43:54 +05:30
|
|
|
/* from find-files.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int find_files_in_packages(struct xbps_handle *, int, char **);
|
2011-01-22 17:10:19 +05:30
|
|
|
|
|
|
|
/* from question.c */
|
2011-07-27 20:43:54 +05:30
|
|
|
bool yesno(const char *, ...);
|
|
|
|
bool noyes(const char *, ...);
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2011-07-28 12:55:30 +05:30
|
|
|
/* from fetch_cb.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
void fetch_file_progress_cb(struct xbps_handle *,
|
|
|
|
struct xbps_fetch_cb_data *,
|
|
|
|
void *);
|
2011-01-22 17:10:19 +05:30
|
|
|
|
2011-11-11 14:11:48 +05:30
|
|
|
/* from state_cb.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
void state_cb(struct xbps_handle *,
|
|
|
|
struct xbps_state_cb_data *,
|
|
|
|
void *);
|
2011-07-28 12:55:30 +05:30
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
/* from unpack_cb.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
void unpack_progress_cb_verbose(struct xbps_handle *,
|
|
|
|
struct xbps_unpack_cb_data *,
|
|
|
|
void *);
|
|
|
|
void unpack_progress_cb(struct xbps_handle *,
|
|
|
|
struct xbps_unpack_cb_data *,
|
|
|
|
void *);
|
2011-11-11 14:48:52 +05:30
|
|
|
|
2011-01-22 17:10:19 +05:30
|
|
|
/* From util.c */
|
2011-10-29 11:47:54 +05:30
|
|
|
int show_pkg_files(prop_dictionary_t);
|
|
|
|
void show_pkg_info(prop_dictionary_t);
|
|
|
|
void show_pkg_info_one(prop_dictionary_t, const char *);
|
2012-06-14 11:52:11 +05:30
|
|
|
int list_strings_sep_in_array(struct xbps_handle *,
|
|
|
|
prop_object_t,
|
|
|
|
void *,
|
|
|
|
bool *);
|
2012-07-31 21:20:50 +05:30
|
|
|
size_t find_longest_pkgver(struct xbps_handle *, prop_object_t);
|
|
|
|
void print_package_line(const char *, size_t, bool);
|
|
|
|
size_t get_maxcols(void);
|
2011-01-22 17:10:19 +05:30
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
/* from list.c */
|
2012-06-14 11:52:11 +05:30
|
|
|
int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *);
|
|
|
|
int list_manual_pkgs(struct xbps_handle *, prop_object_t, void *, bool *);
|
2011-11-11 14:48:52 +05:30
|
|
|
|
2009-08-17 22:37:20 +05:30
|
|
|
#endif /* !_XBPS_BIN_DEFS_H_ */
|