Skip to content

File wsh_shell_interact.c

FileList > src > wsh_shell_interact.c

Go to the source code of this file

  • #include "wsh_shell_interact.h"

Public Functions

Type Name
void WshShellInteract_AppendLineBreak (WshShellIO_CommandLine_t * pCommandLine)
Appends a CRLF ( \r\n ) sequence to the interaction buffer.
void WshShellInteract_Attach (WshShell_Interact_t * pInteract, const WshShell_Char_t * pcName, WshShellInteractive_CmdHandler_t handler)
Registers an interactive command.
void WshShellInteract_Flush (WshShell_Interact_t * pInteract)
Clears the contents of an interactive command slot.

Public Functions Documentation

function WshShellInteract_AppendLineBreak

Appends a CRLF ( \r\n ) sequence to the interaction buffer.

1
2
3
void WshShellInteract_AppendLineBreak (
    WshShellIO_CommandLine_t * pCommandLine
) 

Adds a carriage return and line feed to the end of the current input buffer, if there is enough space. This is typically used to terminate user input lines.

If the buffer is too full to append both characters, an error is printed.

Parameters:

  • pCommandLine Pointer to the interaction buffer (command line).

function WshShellInteract_Attach

Registers an interactive command.

1
2
3
4
5
void WshShellInteract_Attach (
    WshShell_Interact_t * pInteract,
    const WshShell_Char_t * pcName,
    WshShellInteractive_CmdHandler_t handler
) 

Attaches a named command and its execution function to the given interact structure. The command name is truncated if it exceeds the internal buffer size.

Parameters:

  • pInteract Pointer to the interact object to initialize.
  • pcName Null-terminated name of the interactive command.
  • handler Function pointer to be called when the command is executed.

function WshShellInteract_Flush

Clears the contents of an interactive command slot.

1
2
3
void WshShellInteract_Flush (
    WshShell_Interact_t * pInteract
) 

Resets the execution function pointer to NULL and clears the command name buffer. This effectively "removes" the interactive command from the shell registry.

Parameters:

  • pInteract Pointer to the interact structure to flush.


The documentation for this class was generated from the following file src/wsh_shell_interact.c