X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fgrub2%2Fgrub2.h;h=07a1e6c7fe3517deb46e4786472cab0312a82f64;hb=352621fe8719c8488098719240252bc04c303963;hp=33180d49125438519c51b5a905081abe1089ddf7;hpb=84a286992f5c2d100583686a84d533c3e1256562;p=petitboot diff --git a/discover/grub2/grub2.h b/discover/grub2/grub2.h index 33180d4..07a1e6c 100644 --- a/discover/grub2/grub2.h +++ b/discover/grub2/grub2.h @@ -5,7 +5,7 @@ #include #include -struct grub2_parser; +struct grub2_script; struct grub2_word { const char *text; @@ -31,6 +31,8 @@ struct grub2_statement { STMT_TYPE_IF, STMT_TYPE_BLOCK, } type; + int (*exec)(struct grub2_script *, + struct grub2_statement *); }; struct grub2_statement_simple { @@ -96,6 +98,12 @@ void argv_append(struct grub2_argv *argv, struct grub2_word *word); void word_append(struct grub2_word *w1, struct grub2_word *w2); /* script interface */ +void script_execute(struct grub2_script *script); + +int statement_simple_execute(struct grub2_script *script, + struct grub2_statement *statement); +int statement_if_execute(struct grub2_script *script, + struct grub2_statement *statement); struct grub2_script *create_script(void *ctx);