infodb.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * dpkg - main program for package management
  3. * infodb.h - package control information database
  4. *
  5. * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. #ifndef DPKG_INFODB_H
  21. #define DPKG_INFODB_H
  22. #include <stdbool.h>
  23. #include <dpkg/dpkg-db.h>
  24. enum pkg_infodb_format {
  25. PKG_INFODB_FORMAT_UNKNOWN = -1,
  26. PKG_INFODB_FORMAT_LEGACY = 0,
  27. PKG_INFODB_FORMAT_MULTIARCH = 1,
  28. PKG_INFODB_FORMAT_LAST,
  29. };
  30. enum pkg_infodb_format pkg_infodb_get_format(void);
  31. void pkg_infodb_set_format(enum pkg_infodb_format format);
  32. bool pkg_infodb_is_upgrading(void);
  33. void pkg_infodb_upgrade(void);
  34. const char *pkg_infodb_get_dir(void);
  35. const char *pkg_infodb_get_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
  36. const char *filetype);
  37. bool pkg_infodb_has_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
  38. const char *name);
  39. typedef void pkg_infodb_file_func(const char *filename, const char *filetype);
  40. void pkg_infodb_foreach(struct pkginfo *pkg, struct pkgbin *pkgbin,
  41. pkg_infodb_file_func *func);
  42. #endif /* DPKG_INFODB_H */