shell.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2013 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef SHELL_H
21 #define SHELL_H
22 
23 #include <stdint.h>
24 
25 #include "kernel_defines.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #define SHELL_DEFAULT_BUFSIZE (128)
35 
53 typedef int (*shell_command_handler_t)(int argc, char **argv);
54 
60 typedef struct shell_command_t {
61  const char *name;
62  const char *desc;
65 
75 void shell_run(const shell_command_t *commands, char *line_buf, int len) NORETURN;
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* SHELL_H */
82 
int(* shell_command_handler_t)(int argc, char **argv)
Protype of a shell callback handler.
Definition: shell.h:53
const char * name
Name of the function.
Definition: shell.h:61
A single command in the list of the supported commands.
Definition: shell.h:60
const char * desc
Description to print in the "help" command.
Definition: shell.h:62
Common macros and compiler attributes/pragmas configuration.
void shell_run(const shell_command_t *commands, char *line_buf, int len) NORETURN
Start a shell.
shell_command_handler_t handler
The callback function.
Definition: shell.h:63
struct shell_command_t shell_command_t
A single command in the list of the supported commands.
#define NORETURN
The NORETURN keyword tells the compiler to assume that the function cannot return.