orphan
[debian/elilo] / fs / ext2fs.h
1 /*
2  *  Copyright (C) 2001-2003 Hewlett-Packard Co.
3  *      Contributed by Stephane Eranian <eranian@hpl.hp.com>
4  *
5  * This file is part of the ELILO, the EFI Linux boot loader.
6  *
7  *  ELILO is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  ELILO is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with ELILO; see the file COPYING.  If not, write to the Free
19  *  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20  *  02111-1307, USA.
21  *
22  * Please check out the elilo.txt for complete documentation on how
23  * to use this program.
24  */
25 #ifndef __EXT2FS_H__
26 #define __EXT2FS_H__
27
28 INTERFACE_DECL(_ext2fs_interface_t);
29
30 /*
31  * simplified stat structure
32  * XXX: need to cleanup types !
33  */
34 typedef struct {
35         unsigned long   st_ino;
36         unsigned long   st_nlink;
37         unsigned int    st_mode;
38         unsigned int    st_uid;
39         unsigned int    st_gid;
40         unsigned long   st_size;
41         unsigned long   st_atime;
42         unsigned long   st_mtime;
43         unsigned long   st_ctime;
44 } ext2fs_stat_t;
45
46
47 typedef struct _ext2fs_interface_t {
48         EFI_STATUS (*ext2fs_name)(struct _ext2fs_interface_t *this, CHAR16 *name, UINTN maxlen);
49         EFI_STATUS (*ext2fs_open)(struct _ext2fs_interface_t *this, CHAR16 *name, UINTN *fd);
50         EFI_STATUS (*ext2fs_read)(struct _ext2fs_interface_t *this, UINTN fd, VOID *buf, UINTN *size);
51         EFI_STATUS (*ext2fs_close)(struct _ext2fs_interface_t *this, UINTN fd);
52         EFI_STATUS (*ext2fs_fstat)(struct _ext2fs_interface_t *this, UINTN fd, ext2fs_stat_t *st);
53         EFI_STATUS (*ext2fs_seek)(struct _ext2fs_interface_t *this, UINTN fd, UINT64 newpos);
54 } ext2fs_interface_t;
55
56 #define EXT2FS_PROTOCOL \
57     { 0x6ea924f6, 0xc9f2, 0x4331, {0x83, 0x54, 0x19, 0xd0, 0x17, 0x50, 0xd9, 0xc7} }
58
59 extern EFI_STATUS ext2fs_install(VOID);
60 extern EFI_STATUS ext2fs_uninstall(VOID);
61
62
63 #endif /* __EXT2FS_H__ */