-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.h
More file actions
66 lines (50 loc) · 1.75 KB
/
api.h
File metadata and controls
66 lines (50 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef SMPL_API_H
#define SMPL_API_H
#define sp_push_String(S,s) sp_push_string((S), (s)->src, (s)->len)
/*
*
* Wrappers for getting globals
*
*/
/*
** given an SMPL string and a mask
*/
#define sp_Smget_global(S,m,s) (sp_mget_global((S), (m), (s)->src, (s)->len))
/*
** given an C string
*/
#define sp_sget_global(S,s,l) (sp_mget_global((S), OT_ANY, (s), (l)))
#define sp_sget_sglobal(S,s,l) (sp_mget_global((S), OT_STR, (s), (l)))
#define sp_sget_nglobal(S,s,l) (sp_mget_global((S), OT_NUM, (s), (l)))
#define sp_sget_fglobal(S,s,l) (sp_mget_global((S), OT_FUNC, (s), (l)))
#define sp_sget_cfglobal(S,s,l) (sp_mget_global((S), OT_CFUNC, (s), (l)))
/*
** given an literal
*/
#define sp_lget_global(S,s) sp_sget_global ((S), (s), sp_strlen((s)))
#define sp_lget_sglobal(S,s) sp_sget_sglobal ((S), (s), sp_strlen((s)))
#define sp_lget_nglobal(S,s) sp_sget_nglobal ((S), (s), sp_strlen((s)))
#define sp_lget_fglobal(S,s) sp_sget_fglobal ((S), (s), sp_strlen((s)))
#define sp_lget_cfglobal(S,s) sp_sget_cfglobal((S), (s), sp_strlen((s)))
/*
** given an SMPL string
*/
#define sp_Sget_global(S,s) sp_sget_global ((S), (s)->src, (s)->len)
#define sp_Sget_sglobal(S,s) sp_sget_sglobal ((S), (s)->src, (s)->len)
#define sp_Sget_nglobal(S,s) sp_sget_nglobal ((S), (s)->src, (s)->len)
#define sp_Sget_fglobal(S,s) sp_sget_fglobal ((S), (s)->src, (s)->len)
#define sp_Sget_cfglobal(S,s) sp_sget_cfglobal((S), (s)->src, (s)->len)
/*
*
* Wrappers for setting globals
*
*/
/*
** given an literal
*/
#define sp_lset_global(S,s) (sp_set_global((S), (s), sp_strlen((s))))
/*
** given an SMPL string
*/
#define sp_Sset_global(S,s) (sp_set_global((S), (s)->src, (s)->len))
#endif // SMPL_API_H