Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libtksh/include/shcompat.h
1810 views
1
#pragma prototyped
2
3
#ifdef SH_VERSION
4
#define NEWKSH
5
# if SH_VERSION >= 19961101
6
# define KSH93F
7
# endif
8
#endif
9
10
#define NIL(t) ((t)0)
11
12
#ifndef SH_SUBSHARE
13
#define SH_SUBSHARE (1L<<27) /* subshell shares state with parent */
14
#endif
15
16
#ifndef KSH93F
17
/* Functionality to support ksh93d and ksh93e */
18
19
/* Functions to save and restore Fcin */
20
typedef struct _fcin
21
{
22
Sfio_t *_fcfile; /* input file pointer */
23
unsigned char *fcbuff; /* pointer to input buffer */
24
unsigned char *fclast; /* pointer to end of input buffer */
25
unsigned char *fcptr; /* pointer to next input char */
26
unsigned char fcchar; /* saved character */
27
void (*fcfun) __PROTO__((Sfio_t*,const char*,int));
28
} Fcin_t;
29
extern __MANGLE__ Fcin_t _Fcin; /* used by macros */
30
#define fcsave(x) (*(x) = _Fcin)
31
#define fcrestore(x) (_Fcin = *(x))
32
33
/* ksh93f changes nv_scan arguments, compatibility for 93e */
34
int _nv_scan(Hashtab_t *root, void (*fn)(Namval_t *,void*), void *data,
35
int mask, int flags);
36
#define nv_scan _nv_scan
37
38
#else
39
40
/* typedef char Fcin_t[256]; */
41
typedef struct _fcin
42
{
43
char data[256];
44
} Fcin_t;
45
extern void fcsave(Fcin_t*);
46
extern void fcrestore(Fcin_t*);
47
48
#endif
49
50
/* Functions all versions of tksh need to support */
51
Namval_t * nv_move(Namval_t *src, Namval_t *dst);
52
extern int TkshUpVar(Tcl_Interp *interp,char *,char *,char *,
53
Hashtab_t *scope);
54
extern Namval_t * TkshAccessVar(Tcl_Interp *interp, char *part1,
55
char *part2);
56
Hashtab_t* nv_globalscope(void);
57
void * nv_currentscope(void);
58
59
60
/* Structures all versions of tksh need to support */
61
typedef Shscope_t CallFrame;
62
typedef int (*ShellProc_t)(int, char**, void*);
63
typedef int (*ShellNote_t)(int, long, int);
64
65