tiny-shell 0.2
A mini shell project aiming to gain knowledge about Win32 and Linux API
Loading...
Searching...
No Matches
operations.h File Reference
#include <stdbool.h>
#include "../core/args.h"
#include "type.h"
Include dependency graph for operations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void get_cwd (unsigned int buffer_size, os_char *buffer)
 Fetch current working directory and copy them into buffer
 
bool change_cwd (const os_char *new_dir)
 Attempt to change current working directory.
 
void clear_screen ()
 Clear the console.
 
bool kill_process (int proc_id)
 Kill a process.
 
bool resume (int proc_id)
 Resume running a process.
 
bool show_child_processes (int proc_id)
 Show child processes.
 
bool delete_file (const os_char *filename)
 Delete a specific file.
 
bool lsdir (const os_char *dir)
 List of files or folders in specific directory.
 
bool launch_executable (const struct args args)
 Launch the executable.
 
bool set_shell_env (const os_char *name, const os_char *val)
 Set environment variable of the shell process.
 
bool unset_shell_env (const os_char *name)
 Unset environment variable of the shell process.
 
bool get_shell_env (const os_char *var, unsigned int buffer_size, os_char *buffer)
 Get value of an an environment variable.
 
bool has_shell_env (const os_char *var)
 Check if a variable environment exists.
 
os_char * get_all_shell_env_display ()
 Get all current environment variable.
 
bool enum_proc ()
 List all running processes.
 
bool get_time ()
 Get current time.
 
bool get_date ()
 Get current date.
 
bool stop_proccess (int proc_id)
 Stop a process use it ID.
 
bool minibat (const struct args args)
 Launch shell executable and execute the file specified by args.argv[0]
 

Function Documentation

◆ change_cwd()

bool change_cwd ( const os_char * new_dir)

Attempt to change current working directory.

Returns
Result of the operation

Referenced by run_cd().

Here is the caller graph for this function:

◆ clear_screen()

void clear_screen ( )

Clear the console.

Referenced by invoke_runner().

Here is the caller graph for this function:

◆ delete_file()

bool delete_file ( const os_char * filename)

Delete a specific file.

Referenced by run_del().

Here is the caller graph for this function:

◆ enum_proc()

bool enum_proc ( )

List all running processes.

Referenced by run_get_list_process().

Here is the caller graph for this function:

◆ get_all_shell_env_display()

os_char * get_all_shell_env_display ( )

Get all current environment variable.

Referenced by run_get_all_env().

Here is the caller graph for this function:

◆ get_cwd()

void get_cwd ( unsigned int buffer_size,
os_char * buffer )

Fetch current working directory and copy them into buffer

Referenced by prompt_input().

Here is the caller graph for this function:

◆ get_date()

bool get_date ( )

Get current date.

Referenced by run_get_date().

Here is the caller graph for this function:

◆ get_shell_env()

bool get_shell_env ( const os_char * var,
unsigned int buffer_size,
os_char * buffer )

Get value of an an environment variable.

Referenced by add_path(), and run_get_env().

Here is the caller graph for this function:

◆ get_time()

bool get_time ( )

Get current time.

Referenced by run_get_time().

Here is the caller graph for this function:

◆ has_shell_env()

bool has_shell_env ( const os_char * var)

Check if a variable environment exists.

Referenced by main().

Here is the caller graph for this function:

◆ kill_process()

bool kill_process ( int proc_id)

Kill a process.

Referenced by run_kill().

Here is the caller graph for this function:

◆ launch_executable()

bool launch_executable ( const struct args args)

Launch the executable.

Referenced by run_launch_executable().

Here is the caller graph for this function:

◆ lsdir()

bool lsdir ( const os_char * dir)

List of files or folders in specific directory.

Referenced by run_lsdir().

Here is the caller graph for this function:

◆ minibat()

bool minibat ( const struct args args)

Launch shell executable and execute the file specified by args.argv[0]

Referenced by run_minibat().

Here is the caller graph for this function:

◆ resume()

bool resume ( int proc_id)

Resume running a process.

Referenced by run_resume().

Here is the caller graph for this function:

◆ set_shell_env()

bool set_shell_env ( const os_char * name,
const os_char * val )

Set environment variable of the shell process.

Parameters
`val`may be NULL

Referenced by add_path(), and run_set_env().

Here is the caller graph for this function:

◆ show_child_processes()

bool show_child_processes ( int proc_id)

Show child processes.

Referenced by run_child_processes().

Here is the caller graph for this function:

◆ stop_proccess()

bool stop_proccess ( int proc_id)

Stop a process use it ID.

Referenced by run_stop().

Here is the caller graph for this function:

◆ unset_shell_env()

bool unset_shell_env ( const os_char * name)

Unset environment variable of the shell process.

Referenced by run_unset_env().

Here is the caller graph for this function: