From c49d3249613be41d6d2160573b495560c9a25b13 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 5 Apr 2009 15:06:09 +0200 Subject: [PATCH] Use a single header (xbps_api.h) for defs and protos. --HG-- extra : convert_revision : 45979550279f24dbb76e7fff8d0f7b9e76f59bce --- include/cmpver.h | 33 ----------- include/fexec.h | 38 ------------- include/humanize_number.h | 44 --------------- include/install.h | 45 --------------- include/plist.h | 113 -------------------------------------- include/remove.h | 33 ----------- include/repository.h | 42 -------------- include/util.h | 48 ---------------- include/xbps_api.h | 101 ++++++++++++++++++++++++++++++---- 9 files changed, 91 insertions(+), 406 deletions(-) delete mode 100644 include/cmpver.h delete mode 100644 include/fexec.h delete mode 100644 include/humanize_number.h delete mode 100644 include/install.h delete mode 100644 include/plist.h delete mode 100644 include/remove.h delete mode 100644 include/repository.h delete mode 100644 include/util.h diff --git a/include/cmpver.h b/include/cmpver.h deleted file mode 100644 index 5518d7cc3a..0000000000 --- a/include/cmpver.h +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright (c) 2008-2009 Juan Romero Pardines. - * 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_CMPVER_H_ -#define _XBPS_CMPVER_H_ - -/* from lib/cmpver.c */ -int xbps_cmpver_packages(const char *, const char *); -int xbps_cmpver_versions(const char *, const char *); - -#endif /* !_XBPS_PLIST_H_ */ diff --git a/include/fexec.h b/include/fexec.h deleted file mode 100644 index 623f5d47c2..0000000000 --- a/include/fexec.h +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2003 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Matthias Scheler. - * - * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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_FEXEC_H_ -#define _XBPS_FEXEC_H_ - -/* From lib/fexec.c */ -int xbps_file_exec(const char *, ...); -int xbps_file_exec_skipempty(const char *, ...); -int xbps_file_chdir_exec(const char *, const char *, ...); - -#endif /* !_XBPS_FEXEC_H_ */ diff --git a/include/humanize_number.h b/include/humanize_number.h deleted file mode 100644 index ec16a61c9d..0000000000 --- a/include/humanize_number.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center, by Luke Mewburn and by Tomas Svensson. - * - * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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_HUMANIZE_NUMBER_H_ -#define _XBPS_HUMANIZE_NUMBER_H_ - -#define HN_DECIMAL 0x01 -#define HN_NOSPACE 0x02 -#define HN_B 0x04 -#define HN_DIVISOR_1000 0x08 -#define HN_GETSCALE 0x10 -#define HN_AUTOSCALE 0x20 - -/* From lib/humanize_number.c */ -int xbps_humanize_number(char *, size_t, int64_t, const char *, int, int); - -#endif /* !_XBPS_HUMANIZE_NUMBER_H_ */ diff --git a/include/install.h b/include/install.h deleted file mode 100644 index 4c14dddb64..0000000000 --- a/include/install.h +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2008-2009 Juan Romero Pardines. - * 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_INSTALL_H_ -#define _XBPS_INSTALL_H_ - -/* From lib/install.c, lib/depends.c and lib/unpack.c */ -int xbps_install_pkg_deps(const char *, bool); -int xbps_install_binary_pkg(const char *, bool); -int xbps_install_binary_pkg_fini(prop_dictionary_t, prop_dictionary_t, - bool); -int xbps_register_pkg(prop_dictionary_t, bool, bool); -int xbps_unpack_binary_pkg(prop_dictionary_t, prop_dictionary_t); -int xbps_requiredby_pkg_add(prop_array_t, prop_dictionary_t, bool); -int xbps_requiredby_pkg_remove(const char *); -int xbps_find_deps_in_pkg(prop_dictionary_t, prop_object_iterator_t); - -prop_dictionary_t xbps_get_pkg_deps_dictionary(void); - -/* From lib/sortdeps.c */ -int xbps_sort_pkg_deps(prop_dictionary_t); - -#endif /* !_XBPS_INSTALL_H_ */ diff --git a/include/plist.h b/include/plist.h deleted file mode 100644 index 30b7491b5a..0000000000 --- a/include/plist.h +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * Copyright (c) 2008 Juan Romero Pardines. - * 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_PLIST_H_ -#define _XBPS_PLIST_H_ - -/* From lib/plist.c */ -bool xbps_add_obj_to_dict(prop_dictionary_t, prop_object_t, const char *); -bool xbps_add_obj_to_array(prop_array_t, prop_object_t); - -/* - * Executes a function callback to process all objects that are - * found in array with specified key inside of a dictionary. - * - * Arguments: - * - prop_dictionary_t: dictionary to search on. - * - const char *: key of the array. - * - func(prop_object_t, void *, bool *): callback associated. - * - void *: argument for the callback. - * - * Returns true on success, false otherwise and the loop is terminated. - */ -int -xbps_callback_array_iter_in_dict(prop_dictionary_t, const char *, - int (*fn)(prop_object_t, void *, bool *), - void *); -int -xbps_callback_array_iter_in_repolist(int (*fn)(prop_object_t, void *, bool *), - void *); -/* - * Finds a package's dictionary into the main dictionary. - * - * Arguments: - * - prop_dictionary_t: main dictionary to search the object. - * - const char *: string of package name. - * - * Returns the package's dictionary object, otherwise NULL. - */ -prop_dictionary_t -xbps_find_pkg_in_dict(prop_dictionary_t, const char *, const char *); - -prop_dictionary_t -xbps_find_pkg_from_plist(const char *, const char *); - -prop_dictionary_t -xbps_find_pkg_installed_from_plist(const char *); - -/* - * Finds a string object in an array. - * - * Arguments: - * - prop_array_t: array to search for the string. - * - const char *: string value of the object to be found. - * - * Returns true on success, false otherwise. - */ -bool -xbps_find_string_in_array(prop_array_t, const char *); - -/* - * Gets an array iterator from a dictionary with a specified key. - * - * Arguments: - * - prop_dictionary_t: dictionary to search the array. - * - const char *: key of the array. - * - * Returns the object iterator, NULL otherwise. - */ -prop_object_iterator_t -xbps_get_array_iter_from_dict(prop_dictionary_t, const char *); - -/* - * Remove package's dictionary from the "packages" array in - * the specified plist file. - * - * Arguments: - * - 1st const char *: package name. - * - 2nd const char *: full path to plist file. - * - * Returns true on success, or false and an appropiate errno value otherwise. - */ -bool -xbps_remove_pkg_dict_from_file(const char *, const char *); - -bool -xbps_remove_pkg_from_dict(prop_dictionary_t, const char *, const char *); - -int -xbps_remove_string_from_array(prop_array_t, const char *); - -#endif /* !_XBPS_PLIST_H_ */ diff --git a/include/remove.h b/include/remove.h deleted file mode 100644 index 81734be6e3..0000000000 --- a/include/remove.h +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright (c) 2008-2009 Juan Romero Pardines. - * 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_REMOVE_H_ -#define _XBPS_REMOVE_H_ - -/* From lib/remove.c */ -int xbps_remove_binary_pkg(const char *, bool); -int xbps_unregister_pkg(const char *); - -#endif /* !_XBPS_REMOVE_H_ */ diff --git a/include/repository.h b/include/repository.h deleted file mode 100644 index 5df2095193..0000000000 --- a/include/repository.h +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * Copyright (c) 2008-2009 Juan Romero Pardines. - * 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_REPOSITORY_H_ -#define _XBPS_REPOSITORY_H_ - -/* From lib/remove.c */ - -/* - * (Un)registers a repository specified by an URI from/into the pool. - * - * Arguments: - * - const char *: URI to (un)register. - * - * Returns 0 on success, or an appropiate value otherwise. - */ -int xbps_register_repository(const char *); -int xbps_unregister_repository(const char *); - -#endif /* !_XBPS_REPOSITORY_H_ */ diff --git a/include/util.h b/include/util.h deleted file mode 100644 index 35e5933385..0000000000 --- a/include/util.h +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * Copyright (c) 2008-2009 Juan Romero Pardines. - * 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_UTIL_H_ -#define _XBPS_UTIL_H_ - -/* From lib/util.c */ -char * xbps_xasprintf(const char *, ...); -char * xbps_get_file_hash(const char *); -int xbps_check_file_hash(const char *, const char *); -int xbps_check_pkg_file_hash(prop_dictionary_t, const char *); -int xbps_check_is_installed_pkg(const char *); -bool xbps_check_is_installed_pkgname(const char *); -char * xbps_get_pkg_index_plist(const char *); -char * xbps_get_pkg_name(const char *); -const char * xbps_get_pkg_version(const char *); -bool xbps_pkg_has_rundeps(prop_dictionary_t); -void xbps_set_rootdir(const char *); -const char * xbps_get_rootdir(void); -void xbps_set_flags(int); -int xbps_get_flags(void); - -/* From lib/orphans.c */ -prop_array_t xbps_find_orphan_packages(void); - -#endif /* !_XBPS_UTIL_H_ */ diff --git a/include/xbps_api.h b/include/xbps_api.h index 75250c6794..44e69427ca 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -35,6 +35,9 @@ #include #include +#include "sha256.h" +#include "queue.h" + /* Default root PATH for xbps to store metadata info. */ #define XBPS_META_PATH "/var/db/xbps" @@ -57,15 +60,93 @@ /* Verbose messages */ #define XBPS_VERBOSE 0x00000001 -#include "cmpver.h" -#include "fexec.h" -#include "humanize_number.h" -#include "install.h" -#include "plist.h" -#include "remove.h" -#include "repository.h" -#include "sha256.h" -#include "util.h" -#include "queue.h" +/* from lib/cmpver.c */ +int xbps_cmpver_packages(const char *, const char *); +int xbps_cmpver_versions(const char *, const char *); + +/* From lib/fexec.c */ +int xbps_file_exec(const char *, ...); +int xbps_file_exec_skipempty(const char *, ...); +int xbps_file_chdir_exec(const char *, const char *, ...); + +/* From lib/humanize_number.c */ +#define HN_DECIMAL 0x01 +#define HN_NOSPACE 0x02 +#define HN_B 0x04 +#define HN_DIVISOR_1000 0x08 +#define HN_GETSCALE 0x10 +#define HN_AUTOSCALE 0x20 + +int xbps_humanize_number(char *, size_t, int64_t, const char *, + int, int); + +/* From lib/install.c, lib/depends.c and lib/unpack.c */ +int xbps_install_pkg_deps(const char *, bool); +int xbps_install_binary_pkg(const char *, bool); +int xbps_install_binary_pkg_fini(prop_dictionary_t, + prop_dictionary_t, bool); +int xbps_register_pkg(prop_dictionary_t, bool, bool); +int xbps_unpack_binary_pkg(prop_dictionary_t, prop_dictionary_t); +int xbps_requiredby_pkg_add(prop_array_t, prop_dictionary_t, bool); +int xbps_requiredby_pkg_remove(const char *); +int xbps_find_deps_in_pkg(prop_dictionary_t, + prop_object_iterator_t); + +prop_dictionary_t xbps_get_pkg_deps_dictionary(void); + +/* From lib/plist.c */ +bool xbps_add_obj_to_dict(prop_dictionary_t, prop_object_t, + const char *); +bool xbps_add_obj_to_array(prop_array_t, prop_object_t); + +int xbps_callback_array_iter_in_dict(prop_dictionary_t, + const char *, int (*fn)(prop_object_t, void *, bool *), + void *); +int xbps_callback_array_iter_in_repolist(int (*fn)(prop_object_t, + void *, bool *), void *); + +prop_dictionary_t xbps_find_pkg_in_dict(prop_dictionary_t, + const char *, const char *); +prop_dictionary_t xbps_find_pkg_from_plist(const char *, const char *); +prop_dictionary_t xbps_find_pkg_installed_from_plist(const char *); +bool xbps_find_string_in_array(prop_array_t, const char *); + +prop_object_iterator_t xbps_get_array_iter_from_dict(prop_dictionary_t, + const char *); + +bool xbps_remove_pkg_dict_from_file(const char *, const char *); +bool xbps_remove_pkg_from_dict(prop_dictionary_t, const char *, + const char *); +int xbps_remove_string_from_array(prop_array_t, const char *); + +/* From lib/remove.c */ +int xbps_remove_binary_pkg(const char *, bool); +int xbps_unregister_pkg(const char *); + +/* From lib/repository.c */ +int xbps_register_repository(const char *); +int xbps_unregister_repository(const char *); + +/* From lib/sortdeps.c */ +int xbps_sort_pkg_deps(prop_dictionary_t); + +/* From lib/util.c */ +char * xbps_xasprintf(const char *, ...); +char * xbps_get_file_hash(const char *); +int xbps_check_file_hash(const char *, const char *); +int xbps_check_pkg_file_hash(prop_dictionary_t, const char *); +int xbps_check_is_installed_pkg(const char *); +bool xbps_check_is_installed_pkgname(const char *); +char * xbps_get_pkg_index_plist(const char *); +char * xbps_get_pkg_name(const char *); +const char * xbps_get_pkg_version(const char *); +bool xbps_pkg_has_rundeps(prop_dictionary_t); +void xbps_set_rootdir(const char *); +const char * xbps_get_rootdir(void); +void xbps_set_flags(int); +int xbps_get_flags(void); + +/* From lib/orphans.c */ +prop_array_t xbps_find_orphan_packages(void); #endif /* !_XBPS_API_H_ */