infodb.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * dpkg - main program for package management
  3. * infodb.h - package control information database
  4. *
  5. * Copyright © 2011 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 <http://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. };
  29. enum pkg_infodb_format pkg_infodb_get_format(void);
  30. void pkg_infodb_set_format(enum pkg_infodb_format format);
  31. bool pkg_infodb_is_upgrading(void);
  32. void pkg_infodb_upgrade(void);
  33. const char *pkg_infodb_get_dir(void);
  34. const char *pkg_infodb_get_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
  35. const char *filetype);
  36. bool pkg_infodb_has_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
  37. const char *name);
  38. typedef void pkg_infodb_file_func(const char *filename, const char *filetype);
  39. void pkg_infodb_foreach(struct pkginfo *pkg, struct pkgbin *pkgbin,
  40. pkg_infodb_file_func *func);
  41. #endif /* DPKG_INFODB_H */