-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnse_macros.h
57 lines (45 loc) · 1.44 KB
/
nse_macros.h
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
#ifndef NSE_MACROS
#define NSE_MACROS
#define HOSTRULE "hostrule"
#define HOSTTESTS "hosttests"
#define PORTRULE "portrule"
#define PORTTESTS "porttests"
#define ACTION "action"
#define DESCRIPTION "description"
#define AUTHOR "author"
#define LICENSE "license"
#define RUNLEVEL "runlevel"
#define FILES 1
#define DIRS 2
#define SCRIPT_ENGINE "SCRIPT ENGINE"
#define SCRIPT_ENGINE_LUA "LUA INTERPRETER"
#define SCRIPT_ENGINE_SUCCESS 0
#define SCRIPT_ENGINE_ERROR 2
#define SCRIPT_ENGINE_LUA_ERROR 3
#ifdef WIN32
#define SCRIPT_ENGINE_LUA_DIR "scripts\\"
#else
#define SCRIPT_ENGINE_LUA_DIR "scripts/"
#endif
#define SCRIPT_ENGINE_DATABASE "script.db"
#define SCRIPT_ENGINE_EXTENSION ".nse"
#define SCRIPT_ENGINE_LUA_TRY(func) if (func != 0) {\
error("LUA INTERPRETER in %s:%d: %s", __FILE__, __LINE__, (char *)lua_tostring(l, -1));\
return SCRIPT_ENGINE_LUA_ERROR;\
}
#define SCRIPT_ENGINE_TRY(func) if (func != 0) {\
return SCRIPT_ENGINE_ERROR;\
}
#define SCRIPT_ENGINE_VERBOSE(msg) if (o.debugging || o.verbose > 0) {msg};
#define SCRIPT_ENGINE_DEBUGGING(msg) if (o.debugging) {msg};
#define MATCH 0
#define MAX_FILENAME_LEN 4096
#define NOT_PRINTABLE '.'
// if the character is not printable
// and the character is not a tab
// and the character is not a new line
// and the character is not a carriage return
// return 0
// otherwise return 1
#define ISPRINT(c) ((!(c > 31 && c < 127) && c != 9 && c != 10 && c != 13)? 0 : 1)
#endif