File wsh_shell.h
FileList > src > wsh_shell.h
Go to the source code of this file
Core shell interface for command parsing, user authentication, and terminal interaction. More...
#include "wsh_shell_autocomplete.h"#include "wsh_shell_cfg.h"#include "wsh_shell_cmd.h"#include "wsh_shell_cmd_def.h"#include "wsh_shell_esc.h"#include "wsh_shell_history.h"#include "wsh_shell_interact.h"#include "wsh_shell_io.h"#include "wsh_shell_promptwait.h"#include "wsh_shell_ps1_custom.h"#include "wsh_shell_str.h"#include "wsh_shell_types.h"#include "wsh_shell_user.h"#include "wsh_shell_version.h"
Classes
| Type | Name |
|---|---|
| struct | WshShell_AuthCtx_t Temporary authentication context for login input handling. |
| struct | WshShell_ExtCallbacks_t Optional external callbacks invoked on user session changes. |
| struct | WshShell_t Main shell structure containing state, configuration, user context, and subsystems. |
Public Types
| Type | Name |
|---|---|
| typedef void(* | WshShell_ExtClbk_t Type of external callback used in shell extension hooks. |
Public Functions
| Type | Name |
|---|---|
| WshShell_Bool_t | WshShell_Auth (WshShell_t * pShell, const WshShell_Char_t * pcLogin, const WshShell_Char_t * pcPass) Attempt to authenticate a user with given login credentials. |
| void | WshShell_DeAuth (WshShell_t * pShell, const WshShell_Char_t * pcReason) De-authenticate the currently logged-in user. |
| WSH_SHELL_RET_STATE_t | WshShell_Init (WshShell_t * pShell, const WshShell_Char_t * pcDevName, const WshShell_Char_t * pcCustomHeader, WshShell_ExtCallbacks_t * pExtClbks) Initialize a shell instance. |
| void | WshShell_InsertChar (WshShell_t * pShell, const WshShell_Char_t symbol) Process a new character entered by the user. |
| WshShell_Bool_t | WshShell_IsAuth (WshShell_t * pShell) Check if a user is currently authenticated. |
Macros
| Type | Name |
|---|---|
| define | COMPILER "Unknown Compiler" |
| define | OS_NAME WSH\_SHELL\_TARGET\_OS |
Detailed Description
This header provides the main shell object (WshShell_t), core APIs for initialization, input processing, user session management, and support for optional external callbacks.
Author:
Whoosh Embedded Team
Copyright:
Copyright (c) 2024
Public Types Documentation
typedef WshShell_ExtClbk_t
Type of external callback used in shell extension hooks.
Public Functions Documentation
function WshShell_Auth
Attempt to authenticate a user with given login credentials.
Updates the current user context on success, or leaves it unchanged on failure.
Parameters:
pShellShell instance.pcLoginUser name.pcPassPassword.
Returns:
Is auth OK?
function WshShell_DeAuth
De-authenticate the currently logged-in user.
Resets the user context and optionally triggers the DeAuth callback.
Parameters:
pShellShell instance.pcReasonReason or source of deauth.
function WshShell_Init
Initialize a shell instance.
Initializes internal subsystems, assigns device name and optional header, and installs optional external callbacks.
Parameters:
pShellPointer to the shell instance.pcDevNameDevice name (e.g., "ttyS0" or "shell0").pcCustomHeaderOptional header string (can be NULL).pExtClbksPointer to external callback structure (can be NULL).
Returns:
Initialization status code.
function WshShell_InsertChar
Process a new character entered by the user.
Handles interactive editing, history navigation, or command execution if input is complete.
Parameters:
pShellShell instance.symbolCharacter to insert.
function WshShell_IsAuth
Check if a user is currently authenticated.
Parameters:
pShellShell instance.
Returns:
WSH_SHELL_TRUE if a user is authenticated, WSH_SHELL_FALSE otherwise.
Macro Definition Documentation
define COMPILER
define OS_NAME
The documentation for this class was generated from the following file src/wsh_shell.h