summaryrefslogtreecommitdiff
path: root/src/sp_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_utils.h')
-rw-r--r--src/sp_utils.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/sp_utils.h b/src/sp_utils.h
index e54f307..e055e70 100644
--- a/src/sp_utils.h
+++ b/src/sp_utils.h
@@ -9,13 +9,13 @@
9#include "sp_list.h" 9#include "sp_list.h"
10 10
11#if defined(__GNUC__) 11#if defined(__GNUC__)
12# if __GNUC__ >= 3 12#if __GNUC__ >= 3
13# define sp_pure __attribute__((pure)) 13#define sp_pure __attribute__((pure))
14# define sp_const __attribute__((const)) 14#define sp_const __attribute__((const))
15# else 15#else
16# define sp_pure 16#define sp_pure
17# define sp_const 17#define sp_const
18# endif 18#endif
19#endif 19#endif
20/* The dump filename are of the form 20/* The dump filename are of the form
21 * `sp_dump_DATE_IPADDR.dump`, with: 21 * `sp_dump_DATE_IPADDR.dump`, with:
@@ -34,7 +34,8 @@
34#define SHA256_SIZE 32 34#define SHA256_SIZE 32
35 35
36#define HOOK_FUNCTION(original_name, hook_table, new_function, execution) \ 36#define HOOK_FUNCTION(original_name, hook_table, new_function, execution) \
37 hook_function(original_name, SNUFFLEUPAGUS_G(hook_table), new_function, execution) 37 hook_function(original_name, SNUFFLEUPAGUS_G(hook_table), new_function, \
38 execution)
38 39
39#define HOOK_FUNCTION_BY_REGEXP(regexp, hook_table, new_function, execution) \ 40#define HOOK_FUNCTION_BY_REGEXP(regexp, hook_table, new_function, execution) \
40 hook_regexp(regexp, SNUFFLEUPAGUS_G(hook_table), new_function, execution) 41 hook_regexp(regexp, SNUFFLEUPAGUS_G(hook_table), new_function, execution)
@@ -46,14 +47,14 @@
46 47
47#define sp_log_err(feature, ...) sp_log_msg(feature, SP_LOG_ERROR, __VA_ARGS__) 48#define sp_log_err(feature, ...) sp_log_msg(feature, SP_LOG_ERROR, __VA_ARGS__)
48#ifdef SP_DEBUG 49#ifdef SP_DEBUG
49 #define sp_log_debug(...) sp_log_msg("DEBUG", SP_LOG_DEBUG, __VA_ARGS__) 50#define sp_log_debug(...) sp_log_msg("DEBUG", SP_LOG_DEBUG, __VA_ARGS__)
50#else 51#else
51 #define sp_log_debug(...) 52#define sp_log_debug(...)
52#endif 53#endif
53 54
54#define GET_SUFFIX(x) (x==1)?"st":((x==2)?"nd":"th") 55#define GET_SUFFIX(x) (x == 1) ? "st" : ((x == 2) ? "nd" : "th")
55 56
56void sp_log_msg(char const *feature, char const *level, const char* fmt, ...); 57void sp_log_msg(char const *feature, char const *level, const char *fmt, ...);
57int compute_hash(const char *const filename, char *file_hash); 58int compute_hash(const char *const filename, char *file_hash);
58char *sp_convert_to_string(zval *); 59char *sp_convert_to_string(zval *);
59bool sp_match_value(const char *, const char *, const pcre *); 60bool sp_match_value(const char *, const char *, const pcre *);