aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-09-25 19:47:10 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-09-25 19:47:10 +0000
commitc963ee5ce88f1a7d0c6796f55d278dc99e737cc5 (patch)
tree15407168614751120fa1ab884ebcc68881e5aeb3 /src
parente3926bff7a90e9721bbf74c43235b037e4919507 (diff)
downloadcflow-c963ee5ce88f1a7d0c6796f55d278dc99e737cc5.tar.gz
cflow-c963ee5ce88f1a7d0c6796f55d278dc99e737cc5.tar.bz2
(yywrap): Close yyin, and clean up the buffer
(get_token): New function. Interface to yylex.
Diffstat (limited to 'src')
-rw-r--r--src/c.l14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/c.l b/src/c.l
index eb4f503..43d6066 100644
--- a/src/c.l
+++ b/src/c.l
@@ -312,13 +312,27 @@ pp_close(FILE *fp)
int
yywrap()
{
+ if (!yyin)
+ return 1;
if (preprocess_option)
pp_close(yyin);
+ else
+ fclose(yyin);
+ yyin = NULL;
+#ifdef FLEX_SCANNER
+ yy_delete_buffer(yy_current_buffer);
+#endif
delete_statics();
return 1;
}
int
+get_token()
+{
+ return yyin ? yylex() : 0;
+}
+
+int
source(char *name)
{
FILE *fp;

Return to:

Send suggestions and report system problems to the System administrator.