Re: [libsmi] Error report when there is a failure to import a file

I did this in parser-smi.y to get the line numbers:
--- parser-smi.y 20 Mar 2002 16:49:49 -0000 1.169 +++ parser-smi.y 21 Apr 2002 17:38:11 -0000 @@ -1339,6 +1340,10 @@ modulePtr = findModuleByName($3); if (!modulePtr) { modulePtr = loadModule($3); + /*XXX duplicate error, but with line # */ + if (!modulePtr) + smiPrintError(parserPtr, + ERR_MODULE_NOT_FOUND, $3); } checkImports(modulePtr, thisParserPtr);
It doesn't suppress the error that loadModule prints, so you get two copies of the MODULE_NOT_FOUND error, but it at least gives you the info.
[This patch will not apply directly due to whitespace corruption - just add the 3 or 4 lines by hand]
Bill

Thanks.
I think I will avoid the duplication problem by ignoring all cases where the "path" parameter to the error handler is NULL. This will make the OUT_OF_MEMORY to be ignored, but I don't think it will ever ocour on any decent computer.
Mark. ----- Original Message ----- From: "Bill Fenner" fenner@research.att.com To: markk5@bezeqint.net Cc: libsmi@ibr.cs.tu-bs.de Sent: Sunday, April 21, 2002 7:40 PM Subject: Re: [libsmi] Error report when there is a failure to import a file
I did this in parser-smi.y to get the line numbers:
--- parser-smi.y 20 Mar 2002 16:49:49 -0000 1.169 +++ parser-smi.y 21 Apr 2002 17:38:11 -0000 @@ -1339,6 +1340,10 @@ modulePtr = findModuleByName($3); if (!modulePtr) { modulePtr = loadModule($3);
/*XXX duplicate error, but with line # */
if (!modulePtr)
smiPrintError(parserPtr,
ERR_MODULE_NOT_FOUND,
$3);
} checkImports(modulePtr, thisParserPtr);
It doesn't suppress the error that loadModule prints, so you get two copies of the MODULE_NOT_FOUND error, but it at least gives you the info.
[This patch will not apply directly due to whitespace corruption - just add the 3 or 4 lines by hand]
Bill
!! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or
adjust
!! your settings, send a mail message to libsmi-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/libsmi.

Hi!
I've added a parserPtr argument to the loadModule() function, as you primarily suggested. Available via anonymous CVS.
-frank
participants (3)
-
Bill Fenner
-
Frank Strauss
-
Mark Kaplun