CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
shell.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
7
8#ifndef CARDSIGHT_SHELL_H
9#define CARDSIGHT_SHELL_H
10
14struct shell_cmd {
15 const char *name;
16 const char *help;
17 int (*fn)(int argc, char **argv);
18};
19
30#define SHELL_CMD(name, help, fn) \
31 static const struct shell_cmd __shell_cmd_##name \
32 __attribute__((used, section(".shell_cmd"))) = { #name, help, fn }
33
43int shell_exec(char *line);
44
45#endif /* CARDSIGHT_SHELL_H */
int shell_exec(char *line)
Run a command line.
One command registered in the .shell_cmd linker section.
Definition shell.h:14
int(* fn)(int argc, char **argv)
Definition shell.h:17
const char * name
Definition shell.h:15
const char * help
Definition shell.h:16