Zephyr API Documentation
4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_history.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
12
13
#ifndef ZEPHYR_INCLUDE_SHELL_HISTORY_H_
14
#define ZEPHYR_INCLUDE_SHELL_HISTORY_H_
15
16
#include <
zephyr/kernel.h
>
17
#include <
zephyr/sys/util.h
>
18
#include <
zephyr/sys/dlist.h
>
19
#include <
zephyr/sys/ring_buffer.h
>
20
#include <
stdbool.h
>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
27
struct
shell_history
{
28
struct
k_heap
*
heap
;
29
sys_dlist_t
list
;
30
sys_dnode_t
*
current
;
31
};
32
39
#define Z_SHELL_HISTORY_DEFINE(_name, _size) \
40
K_HEAP_DEFINE(_name##_heap, _size); \
41
static struct shell_history _name = { \
42
.heap = &_name##_heap, \
43
.list = SYS_DLIST_STATIC_INIT(&_name.list), \
44
}
45
54
void
z_shell_history_purge(
struct
shell_history
*history);
55
61
void
z_shell_history_mode_exit(
struct
shell_history
*history);
62
75
bool
z_shell_history_get(
struct
shell_history
*history,
bool
up,
76
uint8_t
*dst,
uint16_t
*len);
77
88
void
z_shell_history_put(
struct
shell_history
*history,
uint8_t
*line,
89
size_t
len);
90
98
static
inline
bool
z_shell_history_active(
struct
shell_history
*history)
99
{
100
return
(history->
current
) ?
true
:
false
;
101
}
102
103
#ifdef __cplusplus
104
}
105
#endif
106
107
#endif
/* ZEPHYR_INCLUDE_SHELL_HISTORY_H_ */
dlist.h
sys_dnode_t
struct _dnode sys_dnode_t
Doubly-linked list node structure.
Definition
dlist.h:54
sys_dlist_t
struct _dnode sys_dlist_t
Doubly-linked list structure.
Definition
dlist.h:50
kernel.h
Public kernel APIs.
ring_buffer.h
stdbool.h
true
#define true
Definition
stdbool.h:14
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
k_heap
Kernel synchronized heap structure.
Definition
kernel.h:6106
shell_history
Definition
shell_history.h:27
shell_history::heap
struct k_heap * heap
Definition
shell_history.h:28
shell_history::current
sys_dnode_t * current
Definition
shell_history.h:30
shell_history::list
sys_dlist_t list
Definition
shell_history.h:29
util.h
Misc utilities.
zephyr
shell
shell_history.h
Generated on
for Zephyr API Documentation by
1.16.1