]> git.proxmox.com Git - grub2.git/blob - include/grub/archelp.h
Import grub2_2.02+dfsg1.orig.tar.xz
[grub2.git] / include / grub / archelp.h
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
20 #ifndef GRUB_ARCHELP_HEADER
21 #define GRUB_ARCHELP_HEADER 1
22
23 #include <grub/fs.h>
24 #include <grub/file.h>
25
26 typedef enum
27 {
28 GRUB_ARCHELP_ATTR_TYPE = 0160000,
29 GRUB_ARCHELP_ATTR_FILE = 0100000,
30 GRUB_ARCHELP_ATTR_DIR = 0040000,
31 GRUB_ARCHELP_ATTR_LNK = 0120000,
32 GRUB_ARCHELP_ATTR_NOTIME = 0x80000000,
33 GRUB_ARCHELP_ATTR_END = 0xffffffff
34 } grub_archelp_mode_t;
35
36 struct grub_archelp_data;
37
38 struct grub_archelp_ops
39 {
40 grub_err_t
41 (*find_file) (struct grub_archelp_data *data, char **name,
42 grub_int32_t *mtime,
43 grub_archelp_mode_t *mode);
44
45 char *
46 (*get_link_target) (struct grub_archelp_data *data);
47
48 void
49 (*rewind) (struct grub_archelp_data *data);
50 };
51
52 grub_err_t
53 grub_archelp_dir (struct grub_archelp_data *data,
54 struct grub_archelp_ops *ops,
55 const char *path_in,
56 grub_fs_dir_hook_t hook, void *hook_data);
57
58 grub_err_t
59 grub_archelp_open (struct grub_archelp_data *data,
60 struct grub_archelp_ops *ops,
61 const char *name_in);
62
63 #endif