1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Conditional Config: add support for <, >, <= and >= in @if $SOMETHING ...

And also don't require double quotes on the right hand side.

So you now use something like: @if $MAXCONNECTIONS >= 1024
This commit is contained in:
Bram Matthys
2026-03-22 19:15:35 +01:00
parent 2346aa3977
commit 100abaa82d
3 changed files with 77 additions and 21 deletions
+2
View File
@@ -1650,6 +1650,7 @@ struct AuthConfig {
*/
typedef enum ConfigIfCondition { IF_DEFINED=1, IF_VALUE=2, IF_MODULE_LOADED=3, IF_MODULE_EXISTS=4, IF_MINIMUM_VERSION=5, IF_FILE_EXISTS=6} ConfigIfCondition;
typedef enum CompareOp { COMPARE_EQ=0, COMPARE_NE=1, COMPARE_GT=2, COMPARE_GE=3, COMPARE_LT=4, COMPARE_LE=5 } CompareOp;
struct ConditionalConfig
{
@@ -1657,6 +1658,7 @@ struct ConditionalConfig
int priority; /**< Preprocessor level. Starts with 1, then 2, 3, .. */
ConfigIfCondition condition; /**< See ConfigIfCondition, one of: IF_* */
int negative; /**< For ! conditions */
CompareOp compare_op; /**< Only for IF_VALUE */
char *name; /**< Name of the variable or module */
char *opt; /**< Only for IF_VALUE */
};