2
* ***************************************************************************
3
* MALOC = < Minimal Abstraction Layer for Object-oriented C >
4
* Copyright (C) 1994--2000 Michael Holst
6
* This program is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation; either version 2 of the License, or (at your
9
* option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
* See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 675 Mass Ave, Cambridge, MA 02139, USA.
20
* rcsid="$Id: vsh.h,v 1.15 2002/10/01 21:29:45 mholst Exp $"
21
* ***************************************************************************
25
* ***************************************************************************
26
* File: vsh.h < vsh.c, ... >
28
* Purpose: Header file for vsh, a bourne-compatible shell.
30
* Author: Michael Holst
31
* ***************************************************************************
37
#include <maloc/maloc_base.h>
39
#include <maloc/vsys.h>
42
* ***************************************************************************
43
* Class Vsh: Parameters and datatypes
44
* ***************************************************************************
48
* ***************************************************************************
49
* Class Vsh: Definition
50
* ***************************************************************************
55
Vmem *vmem; /* the memory manager */
56
int iMadeVmem; /* did i make vmem or was it inherited */
58
char processArgs; /* whether the shell should process (argc,argv) */
60
int envValuLen; /* number of environment variables */
61
int envInfoLen; /* number of environment variable help strings */
62
char **envValu; /* the environment variables */
63
char **envInfo; /* the environment variable help strings */
65
FILE *inUnit; /* input unit */
66
FILE *scUnit; /* script input unit */
67
FILE *clUnit; /* input unit */
68
FILE *cinUnit; /* input unit */
69
char cinName[80]; /* input unit */
71
char PR[80]; /* minimal prompt (just the binary name) */
72
char PR_PATH[80]; /* full prompt (with user,hostname,path,etc) */
73
char PR_EXIT[80]; /* the exit print string */
75
int cmdKey; /* external supershell command key */
76
void *Ext_thee; /* external supershell object */
78
char *buf; /* internal buffer */
79
int bufsize; /* internal buffer size */
81
/* external supershell builtin function */
82
int (*Ext_builtin)(void *thee, int argc, char **argv);
87
* ***************************************************************************
88
* Class Vsh: Inlineable methods (vsh.c)
89
* ***************************************************************************
92
#if !defined(VINLINE_MALOC)
93
#else /* if defined(VINLINE_MALOC) */
94
#endif /* if !defined(VINLINE_MALOC) */
97
* ***************************************************************************
98
* Class Vsh: Non-inlineable methods (vsh.c)
99
* ***************************************************************************
102
VEXTERNC Vsh* Vsh_ctor(Vmem *vmem, int argc, char **argv);
103
VEXTERNC void Vsh_dtor(Vsh **thee);
105
VEXTERNC int Vsh_shell(Vsh *thee, char *pPR, void *pthee,
106
int (*builtin)(void *thee, int argc, char **argv));
108
VEXTERNC int Vsh_putenv(Vsh *thee, const char *envi, const char *valu);
109
VEXTERNC int Vsh_putenvInfo(Vsh *thee, const char *envi, const char *valu);
110
VEXTERNC int Vsh_putenvInt(Vsh *thee, const char *envi, const int valu);
111
VEXTERNC int Vsh_putenvReal(Vsh *thee, const char *envi, const double valu);
113
VEXTERNC char *Vsh_getenv(Vsh *thee, const char *envi);
114
VEXTERNC char *Vsh_getenvInfo(Vsh *thee, const char *envi);
115
VEXTERNC int Vsh_getenvInt(Vsh *thee, const char *envi);
116
VEXTERNC double Vsh_getenvReal(Vsh *thee, const char *envi);
118
VEXTERNC void Vsh_remove(Vsh *thee, const char *envi);
119
VEXTERNC void Vsh_wipe(Vsh *thee);
121
VEXTERNC void Vsh_memChk(Vsh *thee);
123
VEXTERNC Vio *Vsh_ioSetup(Vsh *thee, char *key);
124
VEXTERNC void Vsh_ioCleanup(Vsh *thee, Vio **sock);