From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: play.c
Date: Sun, 06 Nov 2005 18:50:26 +0100 [thread overview]
Message-ID: <87irv5zmvx.fsf@student.han.nl> (raw)
In-Reply-To: <436CBF00.1060304@yahoo.fr> (Vincent Pelletier's message of "Sat, 05 Nov 2005 15:17:36 +0100")
Vincent Pelletier <subdino2004@yahoo.fr> writes:
Hi Vincent,
> Here is the play command, along with some songs.
Cool, thanks for this neat patch. :-)
> Vincent Pelletier
> Index: commands/i386/pc/play.c
> ===================================================================
> RCS file: commands/i386/pc/play.c
> diff -N commands/i386/pc/play.c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ commands/i386/pc/play.c 5 Nov 2005 14:06:00 -0000
> @@ -0,0 +1,248 @@
> +/* play.c - command to play a tune */
> +/*
> + * GRUB -- GRand Unified Bootloader
> + * Copyright (C) 2003 Free Software Foundation, Inc.
Shouldn't it be (C) 2003, 2005 or so?
> +static grub_err_t
> +grub_cmd_play (struct grub_arg_list *state __attribute__ ((unused)),
> + int argc, char **args)
> +{
> + grub_file_t file;
> + struct note buf;
> + int tempo;
> + unsigned int to;
> +
> + if (argc != 1)
> + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
> +
> + file = grub_file_open (args[0]);
> + if (! file)
> + return 0;
> +
> + if (grub_file_read (file, (void *) &tempo, sizeof(tempo)) != sizeof(tempo))
> + return 0;
You have to close the file here.
> +#ifdef GRUB_UTIL
> +void
> +grub_play_init (void)
> +{
> + grub_register_command ("play", grub_cmd_play, GRUB_COMMAND_FLAG_BOTH,
> + "play FILE", "Play a tune", 0);
> +}
> +
> +void
> +grub_play_fini (void)
> +{
> + grub_unregister_command ("play");
> +}
> +#else /* ! GRUB_UTIL */
This code is quite low level and not needed in GRUB_UTIL. So you can
just leave this away. Perhaps the same needs to be done for some
commands that are already in CVS, I'll look at that.
Thanks,
Marco
prev parent reply other threads:[~2005-11-06 17:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-05 14:17 play.c Vincent Pelletier
2005-11-05 18:28 ` play.c Yoshinori K. Okuji
2005-11-05 20:20 ` play.c Vincent Pelletier
2005-11-29 22:05 ` play.c Vincent Pelletier
2005-11-30 4:38 ` play.c Hollis Blanchard
2005-11-05 20:48 ` play.c Dennis Clarke
2005-11-05 21:12 ` play.c Hollis Blanchard
2005-11-05 21:19 ` play.c Yoshinori K. Okuji
2005-11-05 21:25 ` play.c Dennis Clarke
2005-11-05 21:59 ` play.c Hollis Blanchard
2005-11-06 17:55 ` play.c Marco Gerards
2005-11-06 20:58 ` play.c Dennis Clarke
2005-11-06 17:53 ` play.c Marco Gerards
2005-11-05 22:17 ` play.c Hollis Blanchard
2005-11-05 22:23 ` play.c Samuel Thibault
2005-11-05 22:43 ` play.c Vincent Pelletier
2005-11-06 17:50 ` Marco Gerards [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87irv5zmvx.fsf@student.han.nl \
--to=metgerards@student.han.nl \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.