iPXE
command.h
Go to the documentation of this file.
1#ifndef _IPXE_COMMAND_H
2#define _IPXE_COMMAND_H
3
4FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5FILE_SECBOOT ( PERMITTED );
6
7#include <ipxe/tables.h>
8
9/** A command-line command */
10struct command {
11 /** Name of the command */
12 const char *name;
13 /**
14 * Function implementing the command
15 *
16 * @v argc Argument count
17 * @v argv Argument list
18 * @ret rc Return status code
19 */
20 int ( * exec ) ( int argc, char **argv );
21};
22
23#define COMMANDS __table ( struct command, "commands" )
24
25#define __command( name ) __table_entry ( COMMANDS, _C2 ( 01., name ) )
26
27#define COMMAND( name, exec ) \
28 struct command name ## _command __command ( name ) = { \
29 #name, exec \
30 }
31
32extern char * concat_args ( char **args );
33
34#endif /* _IPXE_COMMAND_H */
char * concat_args(char **args)
Concatenate arguments.
Definition exec.c:359
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
A command-line command.
Definition command.h:10
int(* exec)(int argc, char **argv)
Function implementing the command.
Definition command.h:20
const char * name
Name of the command.
Definition command.h:12
Linker tables.