opkg_conf.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* opkg_conf.h - the opkg package management system
  2. Carl D. Worth
  3. Copyright (C) 2001 University of Southern California
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation; either version 2, or (at
  7. your option) any later version.
  8. This program is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. */
  13. #ifndef OPKG_CONF_H
  14. #define OPKG_CONF_H
  15. typedef struct opkg_conf opkg_conf_t;
  16. extern opkg_conf_t *conf;
  17. #include "config.h"
  18. #include <stdarg.h>
  19. #include <fnmatch.h> /* FNM_CASEFOLD */
  20. #include "hash_table.h"
  21. #include "pkg_src_list.h"
  22. #include "pkg_dest_list.h"
  23. #include "nv_pair_list.h"
  24. #define OPKG_CONF_DEFAULT_TMP_DIR_BASE "/tmp"
  25. #define OPKG_CONF_TMP_DIR_SUFFIX "opkg-XXXXXX"
  26. #define OPKG_CONF_LISTS_DIR OPKG_STATE_DIR_PREFIX "/lists"
  27. #define OPKG_CONF_DEFAULT_CONF_FILE_DIR OPKGETCDIR"/opkg"
  28. /* In case the config file defines no dest */
  29. #define OPKG_CONF_DEFAULT_DEST_NAME "root"
  30. #define OPKG_CONF_DEFAULT_DEST_ROOT_DIR "/"
  31. #define OPKG_CONF_DEFAULT_HASH_LEN 1024
  32. struct opkg_conf {
  33. pkg_src_list_t pkg_src_list;
  34. pkg_src_list_t dist_src_list;
  35. pkg_dest_list_t pkg_dest_list;
  36. pkg_dest_list_t tmp_dest_list;
  37. nv_pair_list_t arch_list;
  38. int restrict_to_default_dest;
  39. pkg_dest_t *default_dest;
  40. char *dest_str;
  41. char *conf_file;
  42. char *tmp_dir;
  43. char *lists_dir;
  44. unsigned int pfm; /* package field mask */
  45. /* For libopkg users to capture messages. */
  46. void (*opkg_vmessage) (int, const char *fmt, va_list ap);
  47. /* options */
  48. int autoremove;
  49. int force_depends;
  50. int force_defaults;
  51. int force_maintainer;
  52. int force_overwrite;
  53. int force_downgrade;
  54. int force_reinstall;
  55. int force_space;
  56. int force_removal_of_dependent_packages;
  57. int force_removal_of_essential_packages;
  58. int force_postinstall;
  59. int force_remove;
  60. int force_checksum;
  61. int check_signature;
  62. int force_signature;
  63. int nodeps; /* do not follow dependencies */
  64. int nocase; /* perform case insensitive matching */
  65. char *offline_root;
  66. char *overlay_root;
  67. int query_all;
  68. int verbosity;
  69. int noaction;
  70. int size;
  71. int download_only;
  72. char *cache;
  73. #ifdef HAVE_SSLCURL
  74. /* some options could be used by
  75. * wget if curl support isn't builtin
  76. * If someone want to try...
  77. */
  78. char *ssl_engine;
  79. char *ssl_cert;
  80. char *ssl_cert_type;
  81. char *ssl_key;
  82. char *ssl_key_type;
  83. char *ssl_key_passwd;
  84. char *ssl_ca_file;
  85. char *ssl_ca_path;
  86. int ssl_dont_verify_peer;
  87. #endif
  88. #ifdef HAVE_PATHFINDER
  89. int check_x509_path;
  90. #endif
  91. /* proxy options */
  92. char *http_proxy;
  93. char *ftp_proxy;
  94. char *no_proxy;
  95. char *proxy_user;
  96. char *proxy_passwd;
  97. char *signature_ca_file;
  98. char *signature_ca_path;
  99. hash_table_t pkg_hash;
  100. hash_table_t file_hash;
  101. hash_table_t obs_file_hash;
  102. };
  103. enum opkg_option_type {
  104. OPKG_OPT_TYPE_BOOL,
  105. OPKG_OPT_TYPE_INT,
  106. OPKG_OPT_TYPE_STRING
  107. };
  108. typedef enum opkg_option_type opkg_option_type_t;
  109. typedef struct opkg_option opkg_option_t;
  110. struct opkg_option {
  111. const char *name;
  112. const opkg_option_type_t type;
  113. void *const value;
  114. };
  115. int opkg_conf_init(void);
  116. int opkg_conf_load(void);
  117. void opkg_conf_deinit(void);
  118. int opkg_conf_write_status_files(void);
  119. char *root_filename_alloc(char *filename);
  120. #endif