BSB Developer Docs
Loading...
Searching...
No Matches
cli_command_min.h File Reference

Bare minimum for internal CLI commands including redundant opaque types defined elsewhere. More...

Go to the source code of this file.

Typedefs

typedef struct PipeSide PipeSide
 
typedef struct FuriString FuriString
 
typedef void(* CliCommandExecuteCallback) (PipeSide *pipe, FuriString *args, void *context)
 CLI command execution callback pointer.
 

Enumerations

enum  CliCommandFlag {
  CliCommandFlagDefault = 0 , CliCommandFlagParallelUnsafe = (1 << 0) , CliCommandFlagInsomniaSafe = (1 << 1) , CliCommandFlagDontAttachStdio = (1 << 2) ,
  CliCommandFlagUseShellThread , CliCommandFlagExclusive , CliCommandFlagExternal = (1 << 5)
}
 

Detailed Description

Bare minimum for internal CLI commands including redundant opaque types defined elsewhere.

This file is needed for applications.h.

Typedef Documentation

◆ CliCommandExecuteCallback

typedef void(* CliCommandExecuteCallback) (PipeSide *pipe, FuriString *args, void *context)

CLI command execution callback pointer.

This callback will be called from a separate thread spawned just for your command. The pipe will be installed as the thread's stdio, so you can use printf, getchar and other standard functions to communicate with the user.

Parameters
[in]pipePipe that can be used to send and receive data. If CliCommandFlagDontAttachStdio was not set, you can also use standard C functions (printf, getc, etc.) to access this pipe.
[in]argsString with what was passed after the command
[in]contextWhatever you provided to cli_add_command

Enumeration Type Documentation

◆ CliCommandFlag

Enumerator
CliCommandFlagDefault 

Default.

CliCommandFlagParallelUnsafe 

Unsafe to run in parallel with other apps.

CliCommandFlagInsomniaSafe 

Safe to run with insomnia mode on.

CliCommandFlagDontAttachStdio 

Do no attach I/O pipe to thread stdio.

CliCommandFlagUseShellThread 

Don't start a separate thread to run the command in.

Incompatible with DontAttachStdio

CliCommandFlagExclusive 

Only one instance of the command can be run at a time.

CliCommandFlagExternal 

The command comes from a .fal file.