MALOC 0.1
Vsh class

A bourne-compatible shell. More...

Files

file  psh.h
 Header file for a simple parallel extension of ALOC's VSH.
file  vsh.h
 Header file for vsh, a bourne-compatible shell.

Classes

struct  sVsh
 Contains public data members for Vsh class. More...

Typedefs

typedef struct sVsh Vsh
 Declaration of the Vsh class as the Vsh structure.

Functions

int Vsh_pshell (Vsh *thee, char *pPR, void *pthee, int(*builtin)(void *thee, int argc, char **argv))
 Drop-in replacement for Vsh_shell giving parallel extensions.
Vsh * Vsh_ctor (Vmem *vmem, int argc, char **argv)
 Create the shell.
void Vsh_dtor (Vsh **thee)
 Destroy the shell.
int Vsh_shell (Vsh *thee, char *pPR, void *pthee, int(*builtin)(void *thee, int argc, char **argv))
 A bash-like shell with user-definable extensions.
int Vsh_putenv (Vsh *thee, const char *envi, const char *valu)
 Place a variable with a value in the environment.
int Vsh_putenvInfo (Vsh *thee, const char *envi, const char *valu)
 Place a variable with an info string in the environment.
int Vsh_putenvInt (Vsh *thee, const char *envi, const int valu)
 Place a variable with a value (integer) in the environment.
int Vsh_putenvReal (Vsh *thee, const char *envi, const double valu)
 Place a variable with a value (real) in the environment.
char * Vsh_getenv (Vsh *thee, const char *envi)
 Get a value of variable in the environment.
char * Vsh_getenvInfo (Vsh *thee, const char *envi)
 Get info associated with a variable in the environment.
int Vsh_getenvInt (Vsh *thee, const char *envi)
 Get a value of variable in the environment as an integer.
double Vsh_getenvReal (Vsh *thee, const char *envi)
 Get a value of variable in the environment as a real.
void Vsh_remove (Vsh *thee, const char *envi)
 Remove a variable from the environment.
void Vsh_wipe (Vsh *thee)
 Wipe the environment.
void Vsh_memChk (Vsh *thee)
 Print the exact current malloc usage.
Vio * Vsh_ioSetup (Vsh *thee, char *key)
 Setup for an I/O command.
void Vsh_ioCleanup (Vsh *thee, Vio **sock)
 Cleanup an I/O command.

Detailed Description

A bourne-compatible shell.

Typedef Documentation

◆ Vsh

typedef struct sVsh Vsh

Declaration of the Vsh class as the Vsh structure.

Author
Michael Holst

Function Documentation

◆ Vsh_ctor()

Vsh * Vsh_ctor ( Vmem * vmem,
int argc,
char ** argv )

Create the shell.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Pointer to the new allocated Vsh object
Parameters
vmemMemory management object
argcnumber of the command line arguments
argvthe command line arguments

References Vsh_ctor().

Referenced by Vsh_ctor().

Here is the call graph for this function:

◆ Vsh_dtor()

void Vsh_dtor ( Vsh ** thee)

Destroy the shell.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
None
Parameters
theePointer to the Vsh object

References Vsh_dtor().

Referenced by Vsh_dtor().

Here is the call graph for this function:

◆ Vsh_getenv()

char * Vsh_getenv ( Vsh * thee,
const char * envi )

Get a value of variable in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
value of variable in the environment.
Parameters
theePointer to the Vsh object
envienvironment string

References Vsh_getenv().

Referenced by Vsh_getenv().

Here is the call graph for this function:

◆ Vsh_getenvInfo()

char * Vsh_getenvInfo ( Vsh * thee,
const char * envi )

Get info associated with a variable in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
info associated with a variable in the environment.
Parameters
theePointer to the Vsh object
envienvironment string

References Vsh_getenvInfo().

Referenced by Vsh_getenvInfo().

Here is the call graph for this function:

◆ Vsh_getenvInt()

int Vsh_getenvInt ( Vsh * thee,
const char * envi )

Get a value of variable in the environment as an integer.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
value of variable in the environment as an integer.
Parameters
theePointer to the Vsh object
envienvironment string

References Vsh_getenvInt().

Referenced by Vsh_getenvInt().

Here is the call graph for this function:

◆ Vsh_getenvReal()

double Vsh_getenvReal ( Vsh * thee,
const char * envi )

Get a value of variable in the environment as a real.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
value of variable in the environment as a real.
Parameters
theePointer to the Vsh object
envienvironment string

References Vsh_getenvReal().

Referenced by Vsh_getenvReal().

Here is the call graph for this function:

◆ Vsh_ioCleanup()

void Vsh_ioCleanup ( Vsh * thee,
Vio ** sock )

Cleanup an I/O command.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
None
Parameters
theePointer to the Vsh object
socksocket for reading/writing the external data

References Vsh_ioCleanup().

Referenced by Vsh_ioCleanup().

Here is the call graph for this function:

◆ Vsh_ioSetup()

Vio * Vsh_ioSetup ( Vsh * thee,
char * key )

Setup for an I/O command.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
socket for reading/writing the external data
Parameters
theePointer to the Vsh object
keyPointer to different read/write option

References Vsh_ioSetup().

Referenced by Vsh_ioSetup().

Here is the call graph for this function:

◆ Vsh_memChk()

void Vsh_memChk ( Vsh * thee)

Print the exact current malloc usage.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
None
Parameters
theePointer to the Vsh object

References Vsh_memChk().

Referenced by Vsh_memChk().

Here is the call graph for this function:

◆ Vsh_pshell()

int Vsh_pshell ( Vsh * thee,
char * pPR,
void * pthee,
int(* builtin )(void *thee, int argc, char **argv) )

Drop-in replacement for Vsh_shell giving parallel extensions.

Author
Michael Holst
Note
None
Returns
Success enumeration
Parameters
theePointer to the Vsh object
pPRminimal prompt
ptheethe externally supplied builtin object pointer
builtinexternal supershell builtin function

References Vsh_pshell().

Referenced by Vsh_pshell().

Here is the call graph for this function:

◆ Vsh_putenv()

int Vsh_putenv ( Vsh * thee,
const char * envi,
const char * valu )

Place a variable with a value in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Success enumeration
Parameters
theePointer to the Vsh object
envienvironment string
valuvalue string

References Vsh_putenv().

Referenced by Vsh_putenv().

Here is the call graph for this function:

◆ Vsh_putenvInfo()

int Vsh_putenvInfo ( Vsh * thee,
const char * envi,
const char * valu )

Place a variable with an info string in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Success enumeration
Parameters
theePointer to the Vsh object
envienvironment string
valuvalue string

References Vsh_putenvInfo().

Referenced by Vsh_putenvInfo().

Here is the call graph for this function:

◆ Vsh_putenvInt()

int Vsh_putenvInt ( Vsh * thee,
const char * envi,
const int valu )

Place a variable with a value (integer) in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Success enumeration
Parameters
theePointer to the Vsh object
envienvironment string
valuvalue string

References Vsh_putenvInt().

Referenced by Vsh_putenvInt().

Here is the call graph for this function:

◆ Vsh_putenvReal()

int Vsh_putenvReal ( Vsh * thee,
const char * envi,
const double valu )

Place a variable with a value (real) in the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Success enumeration
Parameters
theePointer to the Vsh object
envienvironment string
valuvalue string

References Vsh_putenvReal().

Referenced by Vsh_putenvReal().

Here is the call graph for this function:

◆ Vsh_remove()

void Vsh_remove ( Vsh * thee,
const char * envi )

Remove a variable from the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
None
Parameters
theePointer to the Vsh object
envienvironment string

References Vsh_remove().

Referenced by Vsh_remove().

Here is the call graph for this function:

◆ Vsh_shell()

int Vsh_shell ( Vsh * thee,
char * pPR,
void * pthee,
int(* builtin )(void *thee, int argc, char **argv) )

A bash-like shell with user-definable extensions.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
Success enumeration
Parameters
theePointer to the Vsh object
pPRminimal prompt
ptheethe externally supplied builtin object pointer
builtinexternal supershell builtin function

References Vsh_shell().

Referenced by Vsh_shell().

Here is the call graph for this function:

◆ Vsh_wipe()

void Vsh_wipe ( Vsh * thee)

Wipe the environment.

Author
Michael Holst
Note
Class Vsh: Non-inlineable method (vsh.c)
Returns
None
Parameters
theePointer to the Vsh object

References Vsh_wipe().

Referenced by Vsh_wipe().

Here is the call graph for this function: