examine.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* This file is part of ilk.
  2. *
  3. * Ilk is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU Lesser General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * Ilk is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public License
  14. * along with ilk. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef ILK_EXAMINE_H
  17. #define ILK_EXAMINE_H
  18. /*
  19. Include:
  20. #include <dirent.h>
  21. #include <rid.h>
  22. #include <stdint.h>
  23. #include <fn85.h>
  24. #include <rid_fn85.h>
  25. #include <unfy/unfy.h>
  26. #include <rls/rls.h>
  27. #include <rls/rlsp.h>
  28. #include <nit/list.h>
  29. #include <nit/set.h>
  30. #include <nit/map.h>
  31. #include <nit/err.h>
  32. #include <nit/file.h>
  33. #include <nit/buf.h>
  34. #include <nit/gap.h>
  35. #include <ilk/utilize.h>
  36. #include <ilk/examine.h>
  37. */
  38. #ifndef STYLE_9
  39. #include <rid_fn85.h>
  40. #include <rls/rlsp.h>
  41. #include "ilk.h"
  42. #endif
  43. typedef char Ilk_rule_path[sizeof("rules/") - 1 + sizeof(Rid_fn85_path)];
  44. typedef char Ilk_meta_path[sizeof("metas/") - 1 + sizeof(Rid_fn85_path)];
  45. typedef char Ilk_srch_path[39];
  46. /* get path */
  47. void
  48. ilk_rule_path(Ilk_rule_path path, const Rid id);
  49. void
  50. ilk_meta_path(Ilk_meta_path path, const Rid id);
  51. void
  52. ilk_srch_path(Ilk_srch_path path, uint64_t srch_cnt);
  53. /* get from path */
  54. int
  55. ilk_path_grp(Ilk_grp *grp, const char *path, int check, Ilk_sys *sys);
  56. void
  57. ilk_grp_dispose(Ilk_grp *grp, Ilk_sys *sys);
  58. int
  59. ilk_path_meta(Ilk_meta *meta, const char *path, int check, Ilk_sys *sys);
  60. int
  61. ilk_path_srch(Rls_srch **srch_ref, const char *path, Ilk_sys *sys);
  62. int
  63. ilk_path_meta_dep(Ilk_sys *sys, const char *path, uint64_t srch_cnt);
  64. int
  65. ilk_meta_ser(Ilk_meta *meta, unsigned char **buf_ref,
  66. size_t *size, size_t *pos);
  67. const char *
  68. ilk_meta_deserable(const unsigned char *buf, size_t *pos,
  69. const size_t max);
  70. int
  71. ilk_meta_deser(Ilk_meta *meta, const unsigned char *buf, size_t *pos);
  72. #endif