Unify Framework Lib 1.6.0
uic_stdin_command_handler.h File Reference

Command handler and generator. More...

#include "sl_status.h"
#include <stdint.h>

Go to the source code of this file.

Functions

sl_status_t uic_stdin_handle_command (const char *command)
 Handle a command e.g. from stdio. More...
 
char * uic_stdin_command_generator (const char *text, int state)
 Command generator for editline. More...
 
const char * get_prompt_string ()
 Get the prompt string for CLI. More...
 
void uic_stdin_init ()
 Initialize Unify stdin/stdout. More...
 

Detailed Description

Command handler and generator.

This component implements default commands like exit, help and log_level. Also it has the basic functionalities of handling these commands and possibility to add more commands to the existing CLI.

Function Documentation

◆ get_prompt_string()

const char * get_prompt_string ( )

Get the prompt string for CLI.

◆ uic_stdin_command_generator()

char * uic_stdin_command_generator ( const char *  text,
int  state 
)

Command generator for editline.

This function will be called several times when we are trying to autocomplete a word. See man rl_completion_matches

Parameters
textSee man rl_completion_matches
stateSee man rl_completion_matches
Returns
char* See man rl_completion_matches

◆ uic_stdin_handle_command()

sl_status_t uic_stdin_handle_command ( const char *  command)

Handle a command e.g. from stdio.

Parameters
commandZero terminated string with the command, e.g. "help"

◆ uic_stdin_init()

void uic_stdin_init ( )

Initialize Unify stdin/stdout.