LICK
 All Data Structures Files Functions Variables Enumerations Enumerator
menu.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include "distro.h"
36 #include "lickdir.h"
37 #include "llist.h"
38 
39 typedef int (*menu_install_f)(lickdir_t *lick);
40 typedef int (*menu_uninstall_f)(lickdir_t *lick);
41 typedef int (*menu_fix_f)(lickdir_t *lick);
42 typedef int (*menu_check_fix_f)(lickdir_t *lick);
43 typedef char *(*menu_gen_section_f)(distro_info_t *info);
44 typedef int (*menu_append_section_f)(const char *id, const char *section,
45  lickdir_t *lick);
46 typedef int (*menu_remove_section_f)(const char *id, lickdir_t *lick);
47 
51 typedef struct {
53  menu_install_f install;
55  menu_uninstall_f uninstall;
57  menu_fix_f fix_loader;
59  menu_check_fix_f check_fix_loader;
60  // TODO: header hook
62  menu_gen_section_f gen_section;
64  menu_append_section_f append_section;
66  menu_remove_section_f remove_section;
67 } menu_t;
68 
74 menu_t *new_menu(menu_install_f i, menu_uninstall_f u,
75  menu_fix_f f, menu_check_fix_f c,
76  menu_gen_section_f g, menu_append_section_f a, menu_remove_section_f r);
77 
82 void free_menu(menu_t *m);
83 
95 int install_menu(node_t *files, const char *dst, distro_t *distro,
96  const char *id, const char *name, lickdir_t *lick, menu_t *menu);
97 int uninstall_menu(const char *id, lickdir_t *lick, menu_t *menu);
A linked list node.
Definition: llist.h:19
menu_uninstall_f uninstall
uninstall hook
Definition: menu.h:55
menu_gen_section_f gen_section
generate section for the given distro info
Definition: menu.h:62
Picks the kernel, initrd and options for a given distro.
menu_append_section_f append_section
append section to the menu
Definition: menu.h:64
Information about a distribution.
Definition: distro.h:43
Paths to the LICK directory and its components.
Definition: lickdir.h:15
menu_remove_section_f remove_section
remove sections from the menu
Definition: menu.h:66
Information taken from a list of files.
Definition: distro.h:23
Information about a LICK directory.
menu_check_fix_f check_fix_loader
check if the bootloader fix has been applied
Definition: menu.h:59
A linked list library.
Hooks to call boot loader menu plugins.
Definition: menu.h:51
menu_install_f install
install hook
Definition: menu.h:53
menu_fix_f fix_loader
fix the bootloader when the system does not boot LICK
Definition: menu.h:57