iPXE
command.h
Go to the documentation of this file.
1 #ifndef _IPXE_COMMAND_H
2 #define _IPXE_COMMAND_H
3 
4 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5 
6 #include <ipxe/tables.h>
7 
8 /** A command-line command */
9 struct command {
10  /** Name of the command */
11  const char *name;
12  /**
13  * Function implementing the command
14  *
15  * @v argc Argument count
16  * @v argv Argument list
17  * @ret rc Return status code
18  */
19  int ( * exec ) ( int argc, char **argv );
20 };
21 
22 #define COMMANDS __table ( struct command, "commands" )
23 
24 #define __command __table_entry ( COMMANDS, 01 )
25 
26 extern char * concat_args ( char **args );
27 
28 #endif /* _IPXE_COMMAND_H */
int(* exec)(int argc, char **argv)
Function implementing the command.
Definition: command.h:19
A command-line command.
Definition: command.h:9
char * concat_args(char **args)
Concatenate arguments.
Definition: exec.c:358
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
const char * name
Name of the command.
Definition: command.h:11
Linker tables.