This commit is contained in:
BVK Chaitanya 2010-07-29 22:52:09 +05:30
parent 8c184ffa19
commit 9e3e24e47f
4 changed files with 81 additions and 135 deletions

View file

@ -70,6 +70,15 @@ struct grub_script_argv
char **args;
};
/* Pluggable wildcard translator. */
struct grub_script_wildcard_translator
{
char *(*escape) (const char *str);
char *(*unescape) (const char *str);
grub_err_t (*expand) (const char *str, char ***expansions);
};
extern struct grub_script_wildcard_translator *wildcard_translator;
/* A complete argument. It consists of a list of one or more `struct
grub_script_arg's. */
struct grub_script_arglist
@ -225,12 +234,7 @@ struct grub_parser_param
void grub_script_argv_free (struct grub_script_argv *argv);
int grub_script_argv_next (struct grub_script_argv *argv);
int grub_script_argv_append (struct grub_script_argv *argv, const char *s);
int grub_script_argv_append_escaped (struct grub_script_argv *argv,
const char *s);
int grub_script_argv_append_unescaped (struct grub_script_argv *argv,
const char *s);
int grub_script_argv_split_append (struct grub_script_argv *argv, char *s);
int grub_script_argv_expand (struct grub_script_argv *argv);
struct grub_script_arglist *
grub_script_create_arglist (struct grub_parser_param *state);

View file

@ -1,34 +0,0 @@
/* wildcard.h */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_WILDCARD_HEADER
#define GRUB_WILDCARD_HEADER
/* Pluggable wildcard expansion engine. */
struct grub_wildcard_translator
{
char *(*escape) (const char *str);
char *(*unescape) (const char *str);
grub_err_t (*expand) (const char *str, char ***expansions);
struct grub_wildcard_translator *next;
};
#endif /* GRUB_WILDCARD_HEADER */