~ubuntu-branches/ubuntu/lucid/grub2/lucid

« back to all changes in this revision

Viewing changes to commands/timeout.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2006-01-05 15:20:40 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060105152040-1ab076d4n3y2o5yf
Tags: 1.92-1
* New upstream release.
  - Add support for GPT partition table format.
  - Add a new command "play" to play an audio file on PC.
  - Add support for Linux/ADFS partition table format.
  - Add support for BASH-like scripting.
  - Add support for Apple HFS+ filesystems.
* 01_fix_grub-install.patch: Added. Fix grub-install to use
  /bin/grub-mkimage instead of /sbin/grub-mkimage. Closes: #338824
* Do not use CDBS tarball mode anymore. Closes: #344272  

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* timeout.c - set the timeout */
 
2
/*
 
3
 *  GRUB  --  GRand Unified Bootloader
 
4
 *  Copyright (C) 2005  Free Software Foundation, Inc.
 
5
 *
 
6
 *  GRUB is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with GRUB; if not, write to the Free Software
 
18
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 */
 
20
 
 
21
#include <grub/arg.h>
 
22
#include <grub/misc.h>
 
23
#include <grub/normal.h>
 
24
#include <grub/err.h>
 
25
#include <grub/dl.h>
 
26
 
 
27
static grub_err_t
 
28
grub_cmd_timeout (struct grub_arg_list *state __attribute__ ((unused)),
 
29
                  int argc, char **args)
 
30
{
 
31
  grub_menu_t menu;
 
32
  
 
33
  if (argc != 1)
 
34
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "timeout value required");
 
35
 
 
36
  menu = grub_context_get_current_menu ();
 
37
  if (menu)
 
38
    menu->timeout = grub_strtoul (args[0], 0, 0);
 
39
 
 
40
  return grub_errno;
 
41
}
 
42
 
 
43
 
 
44
 
 
45
GRUB_MOD_INIT(timeout)
 
46
{
 
47
  (void)mod;                    /* To stop warning. */
 
48
  grub_register_command ("timeout", grub_cmd_timeout, GRUB_COMMAND_FLAG_MENU,
 
49
                         "timeout SECS", "Set the timeout", 0);
 
50
}
 
51
 
 
52
GRUB_MOD_FINI(timeout)
 
53
{
 
54
  grub_unregister_command ("timeout");
 
55
}