[Nexus-developers] Two changes to napi for v4

Akeroyd, FA (Freddie) F.A.Akeroyd at rl.ac.uk
Wed May 24 18:39:27 BST 2006


> 
>  1. Include stdint.h and define its types. Since configure.ac already
> checks for it, it would not be hard to include. There would also need
to
> be a small change to pkg-config to pick it up as well. The code to be
> added is:
> <code>
> // use STDINT if possible, otherwise define the types here
> #ifdef HAVE_STDINT_H
> #include <stdint.h>
> #else
> typedef signed char             int8_t;
> typedef short int               int16_t;
> typedef int                     int32_t;
> typedef unsigned char           uint8_t;
> typedef unsigned short int      uint16_t;
> typedef unsigned int            uint32_t;
> #endif
> </code>
> This is a safer way of dealing with sized types.
> 
Seems reasonable to me

>  2. Provide a way to turn off printing error messages to the console.
It
> is preferred to do so at runtime, but I will understand if it is a
> compile time decision. The error messages are all funneled through the
> function "NXNXNXReportError" which is also aliased to
"NXIReportError".
> It could be turned on or off in a non-thread safe manner (using a
static
> variable) to localize the changes.
> 
You can use NXMSetError() to replace the current error reporting
function with a local one that does nothing, though to save on
complexity for the user it is probably worth us having

NXMDisableErrorReporting()
NXMEnableErrorReporting()

Which respectively "replace with a null operation" and "restore the
previous" error reporting functions.

Freddie




More information about the NeXus-developers mailing list