~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to include/grub/fs.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2006-01-05 15:20:40 UTC
  • mto: (17.3.1 squeeze) (1.9.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060105152040-b72i5pq1a82z22yi
Tags: upstream-1.92
ImportĀ upstreamĀ versionĀ 1.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* fs.h - filesystem manager */
 
2
/*
 
3
 *  GRUB  --  GRand Unified Bootloader
 
4
 *  Copyright (C) 2002,2003,2004  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 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program 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, write to the Free Software
 
18
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 */
 
20
 
 
21
#ifndef GRUB_FS_HEADER
 
22
#define GRUB_FS_HEADER  1
 
23
 
 
24
#include <grub/device.h>
 
25
#include <grub/symbol.h>
 
26
#include <grub/types.h>
 
27
 
 
28
/* Forward declaration is required, because of mutual reference.  */
 
29
struct grub_file;
 
30
 
 
31
/* Filesystem descriptor.  */
 
32
struct grub_fs
 
33
{
 
34
  /* My name.  */
 
35
  const char *name;
 
36
 
 
37
  /* Call HOOK with each file under DIR.  */
 
38
  grub_err_t (*dir) (grub_device_t device, const char *path,
 
39
                     int (*hook) (const char *filename, int dir));
 
40
  
 
41
  /* Open a file named NAME and initialize FILE.  */
 
42
  grub_err_t (*open) (struct grub_file *file, const char *name);
 
43
  
 
44
  /* Read LEN bytes data from FILE into BUF.  */
 
45
  grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_ssize_t len);
 
46
  
 
47
  /* Close the file FILE.  */
 
48
  grub_err_t (*close) (struct grub_file *file);
 
49
  
 
50
  /* Return the label of the device DEVICE in LABEL.  The label is
 
51
     returned in a grub_malloc'ed buffer and should be freed by the
 
52
     caller.  */
 
53
  grub_err_t (*label) (grub_device_t device, char **label);
 
54
 
 
55
  /* The next filesystem.  */
 
56
  struct grub_fs *next;
 
57
};
 
58
typedef struct grub_fs *grub_fs_t;
 
59
 
 
60
/* This is special, because block lists are not files in usual sense.  */
 
61
extern struct grub_fs grub_fs_blocklist;
 
62
 
 
63
/* This hook is used to automatically load filesystem modules.
 
64
   If this hook loads a module, return non-zero. Otherwise return zero.
 
65
   The newly loaded filesystem is assumed to be inserted into the head of
 
66
   the linked list GRUB_FS_LIST through the function grub_fs_register.  */
 
67
typedef int (*grub_fs_autoload_hook_t) (void);
 
68
extern grub_fs_autoload_hook_t EXPORT_VAR(grub_fs_autoload_hook);
 
69
 
 
70
void EXPORT_FUNC(grub_fs_register) (grub_fs_t fs);
 
71
void EXPORT_FUNC(grub_fs_unregister) (grub_fs_t fs);
 
72
void EXPORT_FUNC(grub_fs_iterate) (int (*hook) (const grub_fs_t fs));
 
73
grub_fs_t EXPORT_FUNC(grub_fs_probe) (grub_device_t device);
 
74
 
 
75
#ifdef GRUB_UTIL
 
76
void grub_fat_init (void);
 
77
void grub_fat_fini (void);
 
78
void grub_ext2_init (void);
 
79
void grub_ext2_fini (void);
 
80
void grub_ufs_init (void);
 
81
void grub_ufs_fini (void);
 
82
void grub_minix_init (void);
 
83
void grub_minix_fini (void);
 
84
void grub_hfs_init (void);
 
85
void grub_hfs_fini (void);
 
86
void grub_jfs_init (void);
 
87
void grub_jfs_fini (void);
 
88
void grub_xfs_init (void);
 
89
void grub_xfs_fini (void);
 
90
void grub_affs_init (void);
 
91
void grub_affs_fini (void);
 
92
void grub_sfs_init (void);
 
93
void grub_sfs_fini (void);
 
94
void grub_iso9660_init (void);
 
95
#endif /* GRUB_UTIL */
 
96
 
 
97
#endif /* ! GRUB_FS_HEADER */