diff options
| author | Thibault "bui" Koechlin | 2017-12-28 17:04:06 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-28 17:04:06 +0100 |
| commit | 9f5e8d12f05fb24c915a5266a1e908a75c8aed08 (patch) | |
| tree | 9160075ea943c7fd29a3923f844a0ac0d6b8b457 /src/sp_utils.h | |
| parent | 62c48bf9a85e0294b7b32cea438e904e1cd50669 (diff) | |
Clang-format pass
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h`
- Update the documentation accordingly
Diffstat (limited to 'src/sp_utils.h')
| -rw-r--r-- | src/sp_utils.h | 25 |
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 | ||
| 56 | void sp_log_msg(char const *feature, char const *level, const char* fmt, ...); | 57 | void sp_log_msg(char const *feature, char const *level, const char *fmt, ...); |
| 57 | int compute_hash(const char *const filename, char *file_hash); | 58 | int compute_hash(const char *const filename, char *file_hash); |
| 58 | char *sp_convert_to_string(zval *); | 59 | char *sp_convert_to_string(zval *); |
| 59 | bool sp_match_value(const char *, const char *, const pcre *); | 60 | bool sp_match_value(const char *, const char *, const pcre *); |
