orphan
[debian/elilo] / chooser.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  *  GNU EFI 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  *  GNU EFI 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 GNU EFI; 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
26 #ifndef __ELILO_CHOOSER_H__
27 #define __ELILO_CHOOSER_H__
28
29 typedef INTN chooser_func_t(CHAR16 **argv, INTN arc, INTN index, CHAR16 *kname, CHAR16 *cmdline);
30
31 /*
32  * structure to interface to generic chooser selection code.
33  *
34  * XXX: must add support for moer than one choice (rating scheme)
35  *
36  * Interface for probe:
37  *      dev: boot device handle
38  *      return: -1, if not support, 0 if supported
39  *
40  * Interface for chooser:
41  *      argv,argc: command line argument passed to elilo
42  *      index    : position of first non-option argument (min value=1)
43  *      kname    : selected kernel name
44  *      cmdline  : requested kernel command line
45  *      return:
46  *              -1: if error
47  *               0: if successful
48  */
49 typedef struct {
50         CHAR16          *chooser_name;
51         INTN            (*chooser_probe)(EFI_HANDLE dev);
52         chooser_func_t  *chooser_func;
53 } chooser_t;
54
55 extern INTN init_chooser(EFI_HANDLE);
56 extern INTN exist_chooser(CHAR16 *name);
57
58 extern chooser_func_t *kernel_chooser;
59
60 #endif /* __ELILO_CHOOSER_H__ */