2009-08-17 22:37:20 +05:30
|
|
|
/*-
|
2011-01-27 19:06:33 +05:30
|
|
|
* Copyright (c) 2009-2011 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_
|
|
|
|
|
2010-11-13 07:48:58 +05:30
|
|
|
#ifndef __UNCONST
|
|
|
|
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
|
|
|
|
#endif
|
|
|
|
|
2011-07-27 21:34:38 +05:30
|
|
|
#include <sys/time.h>
|
2011-01-22 17:10:19 +05:30
|
|
|
#include <xbps_api.h>
|
|
|
|
|
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;
|
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 */
|
2011-12-20 20:38:23 +05:30
|
|
|
int install_new_pkg(const char *, bool);
|
2011-07-27 20:43:54 +05:30
|
|
|
int update_pkg(const char *);
|
2011-12-24 05:35:26 +05:30
|
|
|
int remove_pkg(const char *, bool);
|
2011-07-27 20:43:54 +05:30
|
|
|
int autoupdate_pkgs(bool, bool);
|
2011-12-24 05:35:26 +05:30
|
|
|
int autoremove_pkgs(bool);
|
2011-07-27 20:43:54 +05:30
|
|
|
int exec_transaction(bool, bool);
|
|
|
|
|
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 */
|
2011-12-22 18:55:27 +05:30
|
|
|
int check_pkg_integrity(prop_dictionary_t, const char *);
|
2011-07-27 20:43:54 +05:30
|
|
|
int check_pkg_integrity_all(void);
|
|
|
|
|
2011-12-29 21:13:52 +05:30
|
|
|
#define CHECK_PKG_DECL(type) \
|
|
|
|
int check_pkg_##type (const char *, void *)
|
2011-10-27 20:38:48 +05:30
|
|
|
|
|
|
|
CHECK_PKG_DECL(autoinstall);
|
|
|
|
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 */
|
|
|
|
int show_pkg_deps(const char *);
|
|
|
|
int show_pkg_reverse_deps(const char *);
|
|
|
|
|
|
|
|
/* from show-info-files.c */
|
2011-10-29 11:47:54 +05:30
|
|
|
int show_pkg_info_from_metadir(const char *, const char *);
|
2009-11-24 16:35:39 +05:30
|
|
|
int show_pkg_files_from_metadir(const char *);
|
2011-07-27 20:43:54 +05:30
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
/* from show-orphans.c */
|
|
|
|
int show_orphans(void);
|
|
|
|
|
2011-07-27 20:43:54 +05:30
|
|
|
/* from find-files.c */
|
2011-12-22 15:15:13 +05:30
|
|
|
int find_files_in_packages(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 */
|
2011-11-24 15:53:08 +05:30
|
|
|
void fetch_file_progress_cb(const 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 */
|
2011-11-24 15:53:08 +05:30
|
|
|
void state_cb(const 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 */
|
2011-11-24 15:53:08 +05:30
|
|
|
void unpack_progress_cb_verbose(const struct xbps_unpack_cb_data *, void *);
|
|
|
|
void unpack_progress_cb(const 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 *);
|
|
|
|
int list_strings_in_array(prop_object_t, void *, bool *);
|
|
|
|
int list_strings_sep_in_array(prop_object_t, void *, bool *);
|
|
|
|
size_t find_longest_pkgver(prop_dictionary_t);
|
|
|
|
void print_package_line(const char *, bool);
|
2011-01-22 17:10:19 +05:30
|
|
|
|
2011-11-11 14:48:52 +05:30
|
|
|
/* from list.c */
|
|
|
|
int list_pkgs_in_dict(prop_object_t, void *, bool *);
|
|
|
|
int list_manual_pkgs(prop_object_t, void *, bool *);
|
|
|
|
|
2009-08-17 22:37:20 +05:30
|
|
|
#endif /* !_XBPS_BIN_DEFS_H_ */
|