projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add unlimited flood priv
[ircu2.10.12-pk.git]
/
ircd
/
ircd_lexer.l
diff --git
a/ircd/ircd_lexer.l
b/ircd/ircd_lexer.l
index d44f106fe38d4cd79ab857a44701271d003e571b..eee4c75061b2d052c808126fbc5c6132976d3839 100644
(file)
--- a/
ircd/ircd_lexer.l
+++ b/
ircd/ircd_lexer.l
@@
-26,6
+26,7
@@
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "config.h"
+#include "fileio.h"
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_string.h"
#include "ircd.h"
#include "ircd_alloc.h"
#include "ircd_string.h"
@@
-148,6
+149,7
@@
static struct lexer_token {
{ "tb", TBYTES },
{ "terabytes", TBYTES },
{ "unlimit_query", TPRIV_UNLIMIT_QUERY },
{ "tb", TBYTES },
{ "terabytes", TBYTES },
{ "unlimit_query", TPRIV_UNLIMIT_QUERY },
+ { "unlimit_flood", TPRIV_UNLIMIT_FLOOD },
{ "walk_lchan", TPRIV_WALK_LCHAN },
{ "wide_gline", TPRIV_WIDE_GLINE },
{ "whox", TPRIV_WHOX },
{ "walk_lchan", TPRIV_WALK_LCHAN },
{ "wide_gline", TPRIV_WIDE_GLINE },
{ "whox", TPRIV_WHOX },
@@
-185,22
+187,44
@@
find_token(char *token)
return tok ? tok->value : 0;
}
return tok ? tok->value : 0;
}
-void
+static FBFILE *lexer_input;
+
+#undef YY_INPUT
+#define YY_INPUT(buf, res, size) res = (fbgets(buf, size, lexer_input) ? strlen(buf) : 0)
+
+int
init_lexer(void)
{
init_lexer(void)
{
-
yyin = f
open(configfile, "r");
- if (
yyin
== NULL)
+
lexer_input = fb
open(configfile, "r");
+ if (
lexer_input
== NULL)
{
#ifdef YY_FATAL_ERROR
YY_FATAL_ERROR("Could not open the configuration file.");
#else
fprintf(stderr, "Could not open the configuration file.");
#endif
{
#ifdef YY_FATAL_ERROR
YY_FATAL_ERROR("Could not open the configuration file.");
#else
fprintf(stderr, "Could not open the configuration file.");
#endif
+ return 0;
}
#ifdef YY_NEW_FILE
YY_NEW_FILE;
#endif
lineno = 1;
}
#ifdef YY_NEW_FILE
YY_NEW_FILE;
#endif
lineno = 1;
+ return 1;
+}
+
+void deinit_lexer(void)
+{
+ if (lexer_input != NULL)
+ {
+ fbclose(lexer_input);
+ lexer_input = NULL;
+ }
+}
+
+int
+yywrap(void)
+{
+ return 1;
}
%}
}
%}