arch.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * libdpkg - Debian packaging suite library routines
  3. * arch.h - architecture database functions
  4. *
  5. * Copyright © 2011 Linaro Limited
  6. * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
  7. * Copyright © 2011-2012 Guillem Jover <guillem@debian.org>
  8. *
  9. * This is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. #ifndef LIBDPKG_ARCH_H
  23. #define LIBDPKG_ARCH_H
  24. #include <dpkg/macros.h>
  25. #include <dpkg/varbuf.h>
  26. DPKG_BEGIN_DECLS
  27. /**
  28. * @defgroup arch Architecture database
  29. * @ingroup dpkg-public
  30. * @{
  31. */
  32. enum dpkg_arch_type {
  33. arch_none,
  34. arch_empty,
  35. arch_illegal,
  36. arch_wildcard,
  37. arch_all,
  38. arch_native,
  39. arch_foreign,
  40. arch_unknown,
  41. };
  42. struct dpkg_arch {
  43. struct dpkg_arch *next;
  44. const char *name;
  45. enum dpkg_arch_type type;
  46. };
  47. const char *dpkg_arch_name_is_illegal(const char *name) DPKG_ATTR_NONNULL(1);
  48. struct dpkg_arch *dpkg_arch_find(const char *name);
  49. struct dpkg_arch *dpkg_arch_get(enum dpkg_arch_type type);
  50. struct dpkg_arch *dpkg_arch_get_list(void);
  51. void dpkg_arch_reset_list(void);
  52. struct dpkg_arch *dpkg_arch_add(const char *name);
  53. void dpkg_arch_unmark(struct dpkg_arch *arch);
  54. void dpkg_arch_load_list(void);
  55. void dpkg_arch_save_list(void);
  56. void varbuf_add_archqual(struct varbuf *vb, const struct dpkg_arch *arch);
  57. /** @} */
  58. DPKG_END_DECLS
  59. #endif /* LIBDPKG_ARCH_H */