summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2025-10-02 12:16:29 +0200
committerjvoisin2025-10-02 12:16:29 +0200
commit09bc3ffc8734cf2437e14ab123c7b732db53b836 (patch)
treea7ab04ed2ad5d1848068af8d6e4849ed35153ca4
parent9509733befcb4010bc77b06fcf41e77078976e80 (diff)
Rename a handful of global constants
-rw-r--r--src/sp_config.h4
-rw-r--r--src/sp_config_keywords.c4
-rw-r--r--src/sp_ini.c2
-rw-r--r--src/sp_utils.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/sp_config.h b/src/sp_config.h
index fb25fdb..6bfb009 100644
--- a/src/sp_config.h
+++ b/src/sp_config.h
@@ -19,9 +19,9 @@ typedef enum {
19 SP_PHP_TYPE_REFERENCE = IS_REFERENCE 19 SP_PHP_TYPE_REFERENCE = IS_REFERENCE
20} sp_php_type; 20} sp_php_type;
21 21
22typedef enum { SP_ZEND = 0, SP_SYSLOG = 1 } sp_log_media; 22typedef enum { SP_LOG_ZEND = 0, SP_LOG_SYSLOG = 1 } sp_log_media;
23 23
24typedef enum { SP_UNSET = 0, SP_READONLY = 1, SP_READWRITE = -1 } sp_ini_permission; 24typedef enum { SP_INI_UNSET = 0, SP_INI_READONLY = 1, SP_INI_READWRITE = -1 } sp_ini_permission;
25 25
26typedef struct { 26typedef struct {
27 int ip_version; 27 int ip_version;
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index 796b44b..a5b4c5d 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -60,11 +60,11 @@ SP_PARSEKW_FN(parse_log_media) {
60 SP_PARSE_ARG(value); 60 SP_PARSE_ARG(value);
61 61
62 if (!strcmp(ZSTR_VAL(value), "php")) { 62 if (!strcmp(ZSTR_VAL(value), "php")) {
63 *(char*)retval = SP_ZEND; 63 *(char*)retval = SP_LOG_ZEND;
64 zend_string_release_ex(value, 1); 64 zend_string_release_ex(value, 1);
65 return SP_PARSER_SUCCESS; 65 return SP_PARSER_SUCCESS;
66 } else if (!strcmp(ZSTR_VAL(value), "syslog")) { 66 } else if (!strcmp(ZSTR_VAL(value), "syslog")) {
67 *(char*)retval = SP_SYSLOG; 67 *(char*)retval = SP_LOG_SYSLOG;
68 zend_string_release_ex(value, 1); 68 zend_string_release_ex(value, 1);
69 return SP_PARSER_SUCCESS; 69 return SP_PARSER_SUCCESS;
70 } 70 }
diff --git a/src/sp_ini.c b/src/sp_ini.c
index cfbc615..2529760 100644
--- a/src/sp_ini.c
+++ b/src/sp_ini.c
@@ -1,7 +1,7 @@
1#include "php_snuffleupagus.h" 1#include "php_snuffleupagus.h"
2 2
3#define SP_INI_HAS_CHECKS_COND(entry) (entry->min || entry->max || entry->regexp) 3#define SP_INI_HAS_CHECKS_COND(entry) (entry->min || entry->max || entry->regexp)
4#define SP_INI_ACCESS_READONLY_COND(entry, cfg) (entry->access == SP_READONLY || (!entry->access && cfg->policy_readonly)) 4#define SP_INI_ACCESS_READONLY_COND(entry, cfg) (entry->access == SP_INI_READONLY || (!entry->access && cfg->policy_readonly))
5 5
6#define sp_log_auto2(feature, is_simulation, drop, ...) \ 6#define sp_log_auto2(feature, is_simulation, drop, ...) \
7 sp_log_msgf(feature, ((is_simulation || !drop) ? SP_LOG_WARN : SP_LOG_ERROR), \ 7 sp_log_msgf(feature, ((is_simulation || !drop) ? SP_LOG_WARN : SP_LOG_ERROR), \
diff --git a/src/sp_utils.c b/src/sp_utils.c
index 64de467..b045f61 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -44,7 +44,7 @@ void sp_log_msgf(char const* const restrict feature, int level, int type,
44 } 44 }
45 45
46 switch (SPCFG(log_media)) { 46 switch (SPCFG(log_media)) {
47 case SP_SYSLOG: { 47 case SP_LOG_SYSLOG: {
48 const char* error_filename = zend_get_executed_filename(); 48 const char* error_filename = zend_get_executed_filename();
49 int syslog_level = (level == E_ERROR) ? LOG_ERR : LOG_INFO; 49 int syslog_level = (level == E_ERROR) ? LOG_ERR : LOG_INFO;
50 int error_lineno = zend_get_executed_lineno(TSRMLS_C); 50 int error_lineno = zend_get_executed_lineno(TSRMLS_C);
@@ -58,7 +58,7 @@ void sp_log_msgf(char const* const restrict feature, int level, int type,
58 } 58 }
59 break; 59 break;
60 } 60 }
61 case SP_ZEND: 61 case SP_LOG_ZEND:
62 default: 62 default:
63 zend_error(level, "[snuffleupagus][%s][%s][%s] %s", client_ip, feature, 63 zend_error(level, "[snuffleupagus][%s][%s][%s] %s", client_ip, feature,
64 logtype, msg); 64 logtype, msg);