FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
sh_util.h File Reference

Utils for fw shell. More...

#include <basics.h>
#include <memory.h>
#include <graphics.h>
#include <keyboard.h>
#include <heap.h>
#include <stddef.h>
#include <strings.h>
#include <stdint.h>
#include <flanterm/flanterm.h>
#include <filesystems/fwrfs.h>
#include <fdlfcn.h>
#include <commands/commands.h>
#include <stream.h>
Include dependency graph for sh_util.h:

Go to the source code of this file.

Classes

struct  command_list_entry
struct  command_list
struct  redir_t
struct  command_t
 Wrapper to store the command and its respective function. More...
struct  subcmd_t

Macros

#define BUFFER_SIZE   128
#define MAX_COMMAND_LINE   1024
#define MAX_SUBCOMMANDS   64
#define MAX_ARGV   64

Typedefs

typedef struct command_list_entry command_list_entry
typedef int(* cmd_func_t) (int argc, char **argv)
 Wrapper to store properly the function commands list.

Enumerations

enum  op_t { OP_NONE = 0 , OP_AND , OP_OR }
 operator types between commands More...

Functions

void init_command_list (command_list *lst)
 Initialize the command list.
void dispose_command_list (command_list *lst)
 Dispose the command list.
void push_command_to_list (command_list *lst, const char *value, size_t length)
 Push a value to the command list.
void execute (const char *buffer, int argc, char **argv)
 Executes the command passed to it.
void user_main (char *buffer)
 Function for adding or removing users.

Variables

string current_user
 Name of the current user.

Detailed Description

Utils for fw shell.

Author
Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com) & GAMINGNOOBdev(https://github.com/GAMINGNOOBdev)
Version
0.1
Date
2025-01-14

Definition in file sh_util.h.

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   128

Definition at line 30 of file sh_util.h.

◆ MAX_ARGV

#define MAX_ARGV   64

Definition at line 33 of file sh_util.h.

◆ MAX_COMMAND_LINE

#define MAX_COMMAND_LINE   1024

Definition at line 31 of file sh_util.h.

◆ MAX_SUBCOMMANDS

#define MAX_SUBCOMMANDS   64

Definition at line 32 of file sh_util.h.

Typedef Documentation

◆ cmd_func_t

typedef int(* cmd_func_t) (int argc, char **argv)

Wrapper to store properly the function commands list.

Definition at line 62 of file sh_util.h.

Enumeration Type Documentation

◆ op_t

enum op_t

operator types between commands

Definition at line 77 of file sh_util.h.

Function Documentation

◆ dispose_command_list()

void dispose_command_list ( command_list * lst)

Dispose the command list.

Parameters
lstPointer to command list object

◆ execute()

void execute ( const char * buffer,
int argc,
char ** argv )

Executes the command passed to it.

Parameters
buffer
argc
argv

◆ init_command_list()

void init_command_list ( command_list * lst)

Initialize the command list.

Parameters
lstPointer to command list object

◆ push_command_to_list()

void push_command_to_list ( command_list * lst,
const char * value,
size_t length )

Push a value to the command list.

Parameters
lstPointer to command list object
valueCommand string (will be copied to a new pointer)
lengthCommand string length

◆ user_main()

void user_main ( char * buffer)

Function for adding or removing users.

Parameters
argument_count
argument_values

Variable Documentation

◆ current_user

string current_user

Name of the current user.

Definition at line 92 of file sh_util.h.