+%option nounput never-interactive
+
%{
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (c) 2001-2002 by Hiroyuki Yamamoto & The Sylpheed Claws Team.
+ * Copyright (c) 2001-2007 by Hiroyuki Yamamoto & The Claws Mail Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <string.h>
#include <glib.h>
+#include "codeconv.h"
#include "matcher.h"
#include "matcher_parser_lex.h"
+
+#ifndef YYSTYPE
#include "matcher_parser_parse.h"
+#endif
#define MAX_STR_CONST 512
-#define YY_NO_UNPUT 1
static char string_buf[MAX_STR_CONST];
static char *string_buf_ptr;
%%
+"in" return MATCHER_IN;
+
/*
* a keyword consists of alpha and underscore
* characters, possibly preceded by a tilde (~)
/* get out of the state: string ends. */
BEGIN(0);
*string_buf_ptr = '\0';
+ if (!g_utf8_validate(string_buf, -1, NULL)) {
+ gchar *tmp = conv_codeset_strdup(string_buf, conv_get_locale_charset_str(), CS_INTERNAL);
+ if (tmp) {
+ strcpy(string_buf, tmp);
+ g_free(tmp);
+ }
+ }
yylval.str = string_buf;
return MATCHER_STRING;
}
yylval.str = yytext;
return MATCHER_INTEGER;
}
+rulename {
+ return MATCHER_RULENAME;
+ }
+disabled {
+ return MATCHER_DISABLED;
+ }
+account {
+ return MATCHER_ACCOUNT;
+ }
+enabled {
+ return MATCHER_ENABLED;
+ }
%%