~ubuntu-branches/ubuntu/feisty/apex/feisty

« back to all changes in this revision

Viewing changes to include/command.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Singer
  • Date: 2006-10-22 14:20:13 UTC
  • Revision ID: james.westby@ubuntu.com-20061022142013-zy5md2199ipggdxq
Tags: 1.4.7
* New command line starts RTC.
* Moved the environment to the same block as the loader.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* command.h
 
2
 
 
3
   written by Marc Singer
 
4
   3 Nov 2004
 
5
 
 
6
   Copyright (C) 2004 Marc Singer
 
7
 
 
8
   This program is free software; you can redistribute it and/or
 
9
   modify it under the terms of the GNU General Public License as
 
10
   published by the Free Software Foundation; either version 2 of the
 
11
   License, or (at your option) any later version.
 
12
 
 
13
   This program is distributed in the hope that it will be useful, but
 
14
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
   General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU General Public License
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
21
   USA.
 
22
 
 
23
   -----------
 
24
   DESCRIPTION
 
25
   -----------
 
26
 
 
27
*/
 
28
 
 
29
#if !defined (__COMMAND_H__)
 
30
#    define   __COMMAND_H__
 
31
 
 
32
/* ----- Includes */
 
33
 
 
34
#include "config.h"
 
35
#include <attributes.h>
 
36
 
 
37
/* ----- Types */
 
38
 
 
39
typedef int (*command_func_t) (int argc, const char** argv);
 
40
 
 
41
struct command_d {
 
42
  const char* command;
 
43
  command_func_t func;
 
44
#if !defined (CONFIG_NOHELP)
 
45
  const char* description;
 
46
#endif
 
47
#if defined (CONFIG_ALLHELP)
 
48
  const char* help;
 
49
#endif
 
50
};
 
51
 
 
52
#if defined (CONFIG_ALLHELP)
 
53
# define COMMAND_HELP(s) .help = s,
 
54
#else
 
55
# define COMMAND_HELP(s)
 
56
#endif
 
57
 
 
58
#if defined (CONFIG_NOHELP)
 
59
# define COMMAND_DESCRIPTION(s)
 
60
#else
 
61
# define COMMAND_DESCRIPTION(s) .description = s,
 
62
#endif
 
63
 
 
64
#define __command __used __section(.command)
 
65
 
 
66
/* ----- Globals */
 
67
 
 
68
/* ----- Prototypes */
 
69
 
 
70
 
 
71
 
 
72
#endif  /* __COMMAND_H__ */