diff options
Diffstat (limited to 'lib/libipsec/policy_token.l')
-rw-r--r-- | lib/libipsec/policy_token.l | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l index 11e0c06..ced57b3 100644 --- a/lib/libipsec/policy_token.l +++ b/lib/libipsec/policy_token.l @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: policy_token.l,v 1.11 2000/12/01 10:08:29 sakane Exp $ */ +/* $KAME: policy_token.l,v 1.13 2003/05/09 05:19:55 sakane Exp $ */ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. @@ -46,11 +46,7 @@ #include <unistd.h> #include <errno.h> -#ifndef __NetBSD__ #include "y.tab.h" -#else -#include "policy_parse.h" -#endif #define yylval __libipsecyylval /* XXX */ int yylex(void); @@ -133,16 +129,26 @@ unique { yylval.num = IPSEC_LEVEL_UNIQUE; return(LEVEL); } %% void __policy__strbuffer__init__(char *); +void __policy__strbuffer__free__(void); + +static YY_BUFFER_STATE strbuffer; void __policy__strbuffer__init__(msg) char *msg; { - YY_BUFFER_STATE yyb; - - yyb = (YY_BUFFER_STATE)yy_scan_string(msg); - yy_switch_to_buffer(yyb); + if (yy_current_buffer) + yy_delete_buffer(yy_current_buffer); + strbuffer = (YY_BUFFER_STATE)yy_scan_string(msg); + yy_switch_to_buffer(strbuffer); return; } +void +__policy__strbuffer__free__() +{ + yy_delete_buffer(strbuffer); + + return; +} |