mutek/shell.h header reference
[Kernel services module]

The source code of this header can be browsed online.

Description  

Interactive shell

Members  

Types  

Functions  

Macros  

Members detail  

#define GCT_CONTAINER_ALGO_shell_buffer  

This macro is declared in mutek/shell.h source file, line 50.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL_BUFFER )

#define MUTEK_SHELL_H_  

This macro is declared in mutek/shell.h source file, line 33.

#define MUTEK_SHELL_ROOT_ENTRY(decl, ...)  

This macro is declared in mutek/shell.h source file, line 247.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL )

#define MUTEK_SHELL_ROOT_ENTRY(decl, ...)  

This macro is declared in mutek/shell.h source file, line 253.

Preprocessor condition: not defined( CONFIG_MUTEK_SHELL )

#define MUTEK_SHELL_ROOT_GROUP(group, name)  

This macro is declared in mutek/shell.h source file, line 243.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL )

#define MUTEK_SHELL_ROOT_GROUP(group, name)  

This macro is declared in mutek/shell.h source file, line 252.

Preprocessor condition: not defined( CONFIG_MUTEK_SHELL )

TERMUI_CON_ARGS_COLLECT_PROTOTYPE(shell_opt_buffer_comp )  

Documentation from alternate declaration:

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

This constructor is for internal use only.

Alternate declarations with same identifier: [1], [2], [3], [4], [5].

TERMUI_CON_ARGS_COLLECT_PROTOTYPE(shell_opt_buffer_name_comp )  

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

This constructor is for internal use only.

Alternate declarations with same identifier: [1], [2], [3], [4], [5].

#define TERMUI_CON_OPT_SHELL_BUFFER_GET_ENTRY(sname_, lname_, id_, type_, field_, typeptr_, ...)  

This macro is declared in mutek/shell.h source file, line 227.

This macro can be used to declare a libtermui console option which specifies a shell buffer or raw data.

#define TERMUI_CON_OPT_SHELL_BUFFER_RAW_ENTRY(sname_, lname_, id_, type_, field_, typeptr_, ...)  

This macro is declared in mutek/shell.h source file, line 216.

This macro can be used to declare a libtermui console option which accepts an exisiting shell buffer or raw data.

TERMUI_CON_PARSE_OPT_PROTOTYPE(shell_opt_buffer_raw_parse )  

Documentation from alternate declaration:

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

This constructor is for internal use only.

Alternate declarations with same identifier: [1], [2], [3], [4], [5], [6], [7].

TERMUI_CON_PARSE_OPT_PROTOTYPE(shell_opt_buffer_get_parse )  

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

This constructor is for internal use only.

Alternate declarations with same identifier: [1], [2], [3], [4], [5], [6], [7].

void mutek_shell_start(const struct device_char_s *c, const char *term, const struct termui_con_entry_s *const*root, const char *prompt)  

This function starts an interactive shell. This function does not returns until the shell is exited by the user.

This is available when CONFIG_MUTEK_SHELL is defined.

void shell_buffer_advertise(struct termui_console_s *con, void *data, size_t size)  

This function can be used to advertise the availability of new data in a buffer. When the CONFIG_MUTEK_SHELL_BUFFER token is defined, this show the name of the buffer. In the other case, it hexdumps the buffer content.

void shell_buffer_collect(const struct termui_console_s *con, const char *name)  

This function destroy a buffer which is not in use. All buffers are released when the name pointer is NULL.

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

void shell_buffer_drop(void *data)  

This function drops the reference to a buffer. The buffer is released when the shell_buffer_collect function is called provided that no one else has taken the reference.

When the CONFIG_MUTEK_SHELL_BUFFER token is undefined, this is equivalent to calling mem_free.

typedef void * shell_buffer_entry_t  

This typedef is declared in mutek/shell.h source file, line 67.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL_BUFFER )

void * shell_buffer_get(const struct termui_console_s *con, const char *name, size_t *size, const void *type)  

This function takes a reference to a buffer. If the name parameter is not NULL, a buffer with the specified name must exist for the function to succeed. If the name parameter is NULL, the last created buffer is returned.

The current size of the buffer is stored in size if not NULL. The reference to the buffer must be released by calling the shell_buffer_drop function.

The function return NULL on failure.

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

See also TERMUI_CON_OPT_SHELL_BUFFER_GET_ENTRY.

typedef struct mutek_shell_buffer_s * shell_buffer_item_t  

This typedef is declared in mutek/shell.h source file, line 67.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL_BUFFER )

const char * shell_buffer_name(void *data)  

This function returns the name of a referenced buffer

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

void * shell_buffer_new(const struct termui_console_s *con, size_t size, const char *prefix, const void *type, bool_t nocopy)  

This function allocates a new buffer. The reference to the buffer must be released by calling the shell_buffer_drop function.

The type argument can be used to indentify the type of data contained in the buffer. It allows trusting the content of an existing buffer for casting to a C structure. Editing the buffer at byte level from the shell will change the type to NULL. The nocopy flag can also be used to drop the type when the buffer is duplicated.

When the CONFIG_MUTEK_SHELL_BUFFER token is undefined, this is equivalent to calling mem_alloc.

void * shell_buffer_reuse(const struct termui_console_s *con, size_t size, const char *prefix, const void *type, bool_t nocopy)  

This function lookup a buffer with a matching type and a no reference. If no such buffer exist a new buffer is allocated. The reference to the buffer must be released by calling the shell_buffer_drop function.

The function return NULL if the allocation failed.

When the CONFIG_MUTEK_SHELL_BUFFER token is undefined, this is equivalent to calling mem_alloc.

typedef void * shell_buffer_root_t  

This typedef is declared in mutek/shell.h source file, line 67.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL_BUFFER )

void * shell_opt_buffer_new_if_null(struct shell_opt_buffer_s *b, const struct termui_console_s *con, size_t size, const char *prefix, const void *type, bool_t nocopy)  

This function calls shell_buffer_new only if the TERMUI_CON_OPT_SHELL_BUFFER_GET_ENTRY option has not parsed a buffer. In either cases the buffer should be released by the options cleanup handler.

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

struct shell_opt_buffer_s  

This struct is declared in mutek/shell.h source file, line 174.

This is used to store a pointer to a shell buffer or other storage in a console options parsing context.

See also TERMUI_CON_OPT_SHELL_BUFFER_GET_ENTRY.

FieldDescription
void * addr;pointer to storage
uintptr_t size:31;size storage
uintptr_t buffered:1;this is set when the shell_buffer_drop function must be called on cleanup.

struct mutek_shell_buffer_s  

This struct is declared in mutek/shell.h source file, line 56.

This struct is for internal use only.

Preprocessor condition: defined( CONFIG_MUTEK_SHELL_BUFFER )

FieldDescription
char name[16];
struct mutek_shell_context_s * sctx;
const void * type;
uintptr_t size:24;
uintptr_t use:1;
uintptr_t nocopy:1;
uint8_t data[0];

See also shell_buffer_item_t.

struct mutek_shell_context_s  

This struct is declared in mutek/shell.h source file, line 76.

This struct is for internal use only.

struct mutek_shell_root_groups_s  

This struct is declared in mutek/shell.h source file, line 239.

This struct is for internal use only.

FieldDescription
const struct termui_con_entry_s * e;

bool_t shell_buffer_collect_all(struct mutek_shell_context_s *sctx)  

This is for internal purpose, shell context must be locked.

This is available when CONFIG_MUTEK_SHELL_BUFFER is defined.

This function is for internal use only.

struct shell_opt_buffer_desc_s  

This struct is declared in mutek/shell.h source file, line 186.

This struct is for internal use only.

See also TERMUI_CON_OPT_SHELL_BUFFER_GET_ENTRY.

FieldDescription
struct termui_con_opts_s opt;
const void * type;
uint16_t offset;

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:39 2018 using MkDoc