I have tried with all the possible combinations of
backslashes.
The main problem is that it does not give error message
but it just does not scan the file properly.
The output i get after running
test.exe < test1.h is different from test.exe
d:\tmp\test1.h
Regards,
Rameshwari
From: Thurn, Martin [mailto:[EMAIL PROTECTED]
Sent: Monday, October 17, 2005 6:30 PM
To: Vedpathak, Rameshwari IN BLR SISL
Subject: RE: Is there any problem if absolute path is given as input whilehandling multiple inout files
It probably has to do with the backslashes.
For starters, read the man page for fopen, check for failure, check the error
code.
- - Martin
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vedpathak, Rameshwari IN BLR SISL
Sent: Monday, October 17, 2005 07:55
To: [email protected]
Subject: Is there any problem if absolute path is given as input whilehandling multiple inout filesHi all,I have written a parser which gets all the function declarations present in a C header file.This parser should handle multiple input header files. i have wrriten a code for this. it works perfectly if i give the inputs to it as just the header filenames without the fule path i.e. in following way:test.exe test1.h test2.h or test.exe test1.hbut the moment i give absolute path in below way,test.exe d:\tmp\out\test1.hit does not scan the full file, it does not give error but does not scan the file in proper way. And i am not able to debug why its is happening like this.It works if i run in normal way i.e. test.exe < d:\tmp\out\test1.hbelow is the code which i have written to handle multiple input files.main(int argc, char *argv[])
{
FILE *inputFile;
char *tmpFile;
numOfFiles = argc - 1;
openFile();
fileList = argv+1;
currentFile = 0;
if (argc == 2)
{
strcpy(tmpFile, argv[1]);
//inputFile = fopen(argv[1], "r");
printf("tmpFile: %s", tmpFile);
inputFile = fopen(tmpFile, "r");
yyin = inputFile;
currentFile = 1;
}
if (argc > 2)
{
yywrap();
}
yyparse();
closeFile();
}int yywrap()
{
FILE *inputFile;
strcpy(typeNames[0], "");
while(currentFile < numOfFiles)
{
inputFile = fopen(fileList[currentFile], "r");
yyin = inputFile;
break;
}
if ((currentFile) == numOfFiles)
return 1;
else
{ currentFile++;
return 0;
}
}
Can anyone please help.If absolute path is given is there any probelm????Regards,Rameshwari
_______________________________________________ Help-flex mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-flex
