/* dyncmd.c - support dynamic command */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* 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/>.
*/
#include <grub/script_sh.h>
static grub_err_t
{
char *modname;
if (mod)
{
char *name;
grub_dl_ref (mod);
if (cmd)
{
else
}
else
ret = grub_errno;
}
else
ret = grub_errno;
return ret;
}
/* Read the file command.lst for auto-loading. */
void
{
if (prefix)
{
char *filename;
if (filename)
{
if (file)
{
/* Override previous commands.lst. */
{
{
if (last)
else
}
else
}
{
int prio = 0;
if (! buf)
break;
if (*name == '*')
{
name++;
prio++;
}
if (! grub_isgraph (name[0]))
continue;
if (! p)
continue;
*p = '\0';
while (*++p == ' ')
;
if (! grub_isgraph (*p))
continue;
if (grub_dl_get (p))
continue;
if (! name)
continue;
modname = grub_strdup (p);
if (! modname)
{
continue;
}
0, N_("not loaded"), 0,
prio);
if (! cmd)
{
continue;
}
/* Update the active flag. */
}
}
}
}
/* Ignore errors. */
}