vsh.h
Go to the documentation of this file.
#ifndef _VSH_H_
#define _VSH_H_
#include <maloc/maloc_base.h>
#include <maloc/vsys.h>
/*
* ***************************************************************************
* Class Vsh: Parameters and datatypes
* ***************************************************************************
*/
struct sVsh {
Vmem *vmem;
int iMadeVmem;
char processArgs;
int envValuLen;
int envInfoLen;
char **envValu;
char **envInfo;
FILE *inUnit;
FILE *scUnit;
FILE *clUnit;
FILE *cinUnit;
char cinName[VMAX_ARGLEN];
char PR[VMAX_ARGLEN];
char PR_PATH[VMAX_ARGLEN];
char PR_EXIT[VMAX_ARGLEN];
int cmdKey;
void *Ext_thee;
char *buf;
int bufsize;
int (*Ext_builtin)(void *thee, int argc, char **argv);
};
typedef struct sVsh Vsh;
/*
* ***************************************************************************
* Class Vsh: Inlineable methods (vsh.c)
* ***************************************************************************
*/
#if !defined(VINLINE_MALOC)
#else /* if defined(VINLINE_MALOC) */
#endif /* if !defined(VINLINE_MALOC) */
Vsh* Vsh_ctor(Vmem *vmem, int argc, char **argv);
void Vsh_dtor(Vsh **thee);
int Vsh_shell(Vsh *thee, char *pPR, void *pthee,
int (*builtin)(void *thee, int argc, char **argv));
int Vsh_putenv(Vsh *thee, const char *envi, const char *valu);
int Vsh_putenvInfo(Vsh *thee, const char *envi, const char *valu);
int Vsh_putenvInt(Vsh *thee, const char *envi, const int valu);
int Vsh_putenvReal(Vsh *thee, const char *envi, const double valu);
char *Vsh_getenv(Vsh *thee, const char *envi);
char *Vsh_getenvInfo(Vsh *thee, const char *envi);
int Vsh_getenvInt(Vsh *thee, const char *envi);
double Vsh_getenvReal(Vsh *thee, const char *envi);
void Vsh_remove(Vsh *thee, const char *envi);
void Vsh_wipe(Vsh *thee);
void Vsh_memChk(Vsh *thee);
Vio *Vsh_ioSetup(Vsh *thee, char *key);
void Vsh_ioCleanup(Vsh *thee, Vio **sock);
#endif /* _VSH_H_ */
maloc_base.h
The base (or foundation) header for MALOC.
VMAX_ARGLEN
#define VMAX_ARGLEN
Global constant.
Definition: maloc_base.h:227
vsys.h
The primary header for VSYS. (Virtual SYStem utilities library.)
Vsh_getenvReal
double Vsh_getenvReal(Vsh *thee, const char *envi)
Get a value of variable in the environment as a real.
Vsh_putenvInfo
int Vsh_putenvInfo(Vsh *thee, const char *envi, const char *valu)
Place a variable with an info string in the environment.
Vsh_getenv
char * Vsh_getenv(Vsh *thee, const char *envi)
Get a value of variable in the environment.
Vsh_getenvInfo
char * Vsh_getenvInfo(Vsh *thee, const char *envi)
Get info associated with a variable in the environment.
Vsh_putenv
int Vsh_putenv(Vsh *thee, const char *envi, const char *valu)
Place a variable with a value in the environment.
Vsh_ioCleanup
void Vsh_ioCleanup(Vsh *thee, Vio **sock)
Cleanup an I/O command.
Vsh_getenvInt
int Vsh_getenvInt(Vsh *thee, const char *envi)
Get a value of variable in the environment as an integer.
Vsh_memChk
void Vsh_memChk(Vsh *thee)
Print the exact current malloc usage.
Vsh_remove
void Vsh_remove(Vsh *thee, const char *envi)
Remove a variable from the environment.
Vsh_ioSetup
Vio * Vsh_ioSetup(Vsh *thee, char *key)
Setup for an I/O command.
Vsh_ctor
Vsh * Vsh_ctor(Vmem *vmem, int argc, char **argv)
Create the shell.
Vsh_dtor
void Vsh_dtor(Vsh **thee)
Destroy the shell.
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.
Vsh_putenvReal
int Vsh_putenvReal(Vsh *thee, const char *envi, const double valu)
Place a variable with a value (real) in the environment.
Vsh_wipe
void Vsh_wipe(Vsh *thee)
Wipe the environment.
Vsh_putenvInt
int Vsh_putenvInt(Vsh *thee, const char *envi, const int valu)
Place a variable with a value (integer) in the environment.
sVsh
Contains public data members for Vsh class.
Definition: vsh.h:56
sVsh::bufsize
int bufsize
internal buffer size
Definition: vsh.h:101
sVsh::PR_PATH
char PR_PATH[VMAX_ARGLEN]
full prompt (user,hostname,path,etc)
Definition: vsh.h:89
sVsh::scUnit
FILE * scUnit
script input unit
Definition: vsh.h:78
sVsh::processArgs
char processArgs
whether the shell should process (argc,argv)
Definition: vsh.h:64
sVsh::envInfo
char ** envInfo
the environment variable help strings
Definition: vsh.h:73
sVsh::iMadeVmem
int iMadeVmem
did i make vmem or was it inherited
Definition: vsh.h:61
sVsh::cinName
char cinName[VMAX_ARGLEN]
input unit
Definition: vsh.h:84
sVsh::buf
char * buf
internal buffer
Definition: vsh.h:99
sVsh::PR_EXIT
char PR_EXIT[VMAX_ARGLEN]
the exit print string
Definition: vsh.h:91
sVsh::clUnit
FILE * clUnit
input unit
Definition: vsh.h:80
sVsh::envValu
char ** envValu
the environment variables
Definition: vsh.h:71
sVsh::envValuLen
int envValuLen
number of environment variables
Definition: vsh.h:67
sVsh::vmem
Vmem * vmem
the memory manager
Definition: vsh.h:59
sVsh::inUnit
FILE * inUnit
input unit
Definition: vsh.h:76
sVsh::envInfoLen
int envInfoLen
number of environment variable help strings
Definition: vsh.h:69
sVsh::cmdKey
int cmdKey
external supershell command key
Definition: vsh.h:94
sVsh::cinUnit
FILE * cinUnit
input unit
Definition: vsh.h:82
sVsh::Ext_thee
void * Ext_thee
external supershell object
Definition: vsh.h:96
sVsh::PR
char PR[VMAX_ARGLEN]
minimal prompt (just the binary name)
Definition: vsh.h:87
sVsh::Ext_builtin
int(* Ext_builtin)(void *thee, int argc, char **argv)
external supershell builtin function
Definition: vsh.h:104
sVio
Contains public data members for Vio class.
Definition: vio.h:98
sVmem
Contains public data members for Vmem class.
Definition: vmem.h:57