archelp.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* archelp.h -- Archive helper functions */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2013 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_ARCHELP_HEADER
  20. #define GRUB_ARCHELP_HEADER 1
  21. #include <grub/fs.h>
  22. #include <grub/file.h>
  23. typedef enum
  24. {
  25. GRUB_ARCHELP_ATTR_TYPE = 0160000,
  26. GRUB_ARCHELP_ATTR_FILE = 0100000,
  27. GRUB_ARCHELP_ATTR_DIR = 0040000,
  28. GRUB_ARCHELP_ATTR_LNK = 0120000,
  29. GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
  30. GRUB_ARCHELP_ATTR_END = 0xffffffff
  31. } grub_archelp_mode_t;
  32. struct grub_archelp_data;
  33. struct grub_archelp_ops
  34. {
  35. grub_err_t
  36. (*find_file) (struct grub_archelp_data *data, char **name,
  37. grub_int32_t *mtime,
  38. grub_archelp_mode_t *mode);
  39. char *
  40. (*get_link_target) (struct grub_archelp_data *data);
  41. void
  42. (*rewind) (struct grub_archelp_data *data);
  43. };
  44. grub_err_t
  45. grub_archelp_dir (struct grub_archelp_data *data,
  46. struct grub_archelp_ops *ops,
  47. const char *path_in,
  48. grub_fs_dir_hook_t hook, void *hook_data);
  49. grub_err_t
  50. grub_archelp_open (struct grub_archelp_data *data,
  51. struct grub_archelp_ops *ops,
  52. const char *name_in);
  53. #endif