
Hi, when reading a module the parser reads imported definitions from other modules. Unfortunately it does not seem to bother or complain if this module does not exist but it simply uses default values.
Is there a way to make libsmi complain about missing imported modules or to check if all imports where successful? This might be simple but I am just not seeing it...
Thanks a lot!
Henning

Henning Eggers wrote:
when reading a module the parser reads imported definitions from other modules. Unfortunately it does not seem to bother or complain if this module does not exist but it simply uses default values.
Is there a way to make libsmi complain about missing imported modules or to check if all imports where successful? This might be simple but I am just not seeing it...
You can register your own error handler with smiSetErrorHandler(), see lib/error.c to get a clue how this can be done. Then your error handler can handle ERR_MODULE_NOT_FOUND (or other errors related to unresolved identifiers) according to your needs.
Unfortunately, the error.c code is still missing a lot of error "tag" definitions, and it was probably a bad choice to pass such a tag string instead of the error id to the error handler. So, I guess, for now, you will probably have to add tags in the library code for the errors you want to handle and maybe in a future release the error handler interface will change slightly.
participants (2)
-
Frank Strauß
-
Henning Eggers