Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/libtksh/include/nvextra.h
1810 views
1
#include <nval.h>
2
3
#define nv_getvalue(np, val) do \
4
{ \
5
int a = nv_isattr((np),NV_NODISC); \
6
nv_onattr((np), NV_NODISC); \
7
(val) = nv_getval(np); \
8
if (!a) nv_offattr((np), a); \
9
} while(0)
10
11
#define nv_putvalue(np, val, f) do \
12
{ \
13
int a = nv_isattr((np),NV_NODISC); \
14
nv_onattr((np), NV_NODISC); \
15
nv_putval((np),val, f); \
16
if (!a) nv_offattr((np),a); \
17
} while(0)
18
19
#if 0
20
#define nv_stopdisc(np) do \
21
{ \
22
Namfun_t *nf = (Namfun_t *) \
23
malloc(sizeof(Namfun_t)); \
24
nf->disc = & tksh_trace_stop; \
25
nv_stack(np, nf); \
26
} while (0)
27
28
#define nv_resumedisc(np) (free (nv_stack(np, NULL)))
29
#else
30
#define nv_resumedisc(np)
31
#define nv_stopdisc(np)
32
#endif
33
34
#define ov_return(msg) do { errmsg = (msg) ; goto scalar; } while(0)
35
36
37
#define nv_move(src,dst) ((nv_clone((src),(dst),NV_MOVE)?(dst):(src)))
38
#define nv_scanfrom(nv, name) nv_putsub((nv),(name),ARRAY_SCAN)
39
#define nv_inscan(nv) (((Namarr_t *) (nv)->nvalue)->nelem & ARRAY_SCAN)
40
#define nv_notsub(np,sub) ( (!nv_putsub((np),(sub),0)) || (!nv_getsub(np)) )
41
#define nv_setsub(np,sub) (nv_putsub((np),(sub),ARRAY_ADD) && nv_getsub(np) && \
42
(! nv_isnull(nv_opensub(np))) )
43
#define nv_subnull(np) ( (!nv_getsub(np)) || nv_isnull(nv_opensub(np)))
44
#define nv_subnullf(np) (nv_isnull(nv_opensub(np))&& !(nv_opensub(np)->nvfun))
45
46
#ifndef nv_onattr
47
#define nv_onattr(np,f) ((np)->nvflag |= (f))
48
#define nv_offattr(np,f) ((np)->nvflag &= (~(f)))
49
#endif
50
51
52