NWDPAccessorData

Contains public fields of the structure returned by NWDPLibInit


Structure

typedef struct {  
nuint32 libError;
nuint32 otherError;
nuint32 otherError2;
pnstr8 otherErrorStrPtr;
pNWDPErrorReturn otherNDPSErrorReturnPtr;
nuint32 errorLine;
pnstr8 errorModule;
NWDPOidRef wellKnownOidRefs;
pNWDPCommonAccessorData cADBPtr;
} NWDPAccessorData, N_FAR *pNWDPAccessorData;


Header File

nwdp_lib.h


Fields

libError

Specifies the error category code as described in nwdp_err.h. The error category code identifies the library containing the routine.


otherError

Specifies either an error code returned from a subordinate library or other numbers whose meaning is clarified by libError.


otherError2

Specifies either an optional second error code returned from a subordinate library or other numbers whose meaning is clarified by libError.


otherErrorStrPtr

Points to either an optional string error message returned from a subordinate library or other string data whose meaning is clarified by libError.


otherNDPSErrorReturnPtr

Points to an extended error from the NDPSM and is valid only if the libError field contains NWDP_LE_OTHER_NDPS_ERROR_RETURN.


errorLine

Specifies the line number within the library module (see errorModule below) where the error was reported. This is only valid when using the N_DEBUG version of the library.


errorModule

Specifies the library module where the error was reported. This field in conjunction with the errorLine gives sufficient debugging information to determine the reason for receiving the error code. This is only valid when using the N_DEBUG version of the library.


wellKnownOidRefs

Contains a pointer to OID references which are permanently allocated within the library. These can be "borrowed" by the application writer by using the macros defined in nwdp_wko.ogh which contain the "r" or "p" prefix in their names ("r" is for an NWDPOidRef and "p" is for a pNWDPOID).


cADBPtr

Contains the Common Accessor Data Block Pointer. This field refers to several items of data which have only one instance which is shared by multiple accessorRefs. The following fields are made public for the convenience of the library user:

NWDPLocalToUnicodeHandleMac
NWDPUnicodeToLocalHandleMac
NWDPMonocaseHandleMac


Remarks

The condition codes are stored in the structure pointed to by NWDPAccessorRef. The publicly available fields of the NWDPAccessorData structure should be accessed through the following defines:

#define NWDPLibErrorMac(accessorRef) (((NWDPAccessorData *)accessorRef)->libError)
#define NWDPOtherErrorMac(accessorRef) (((NWDPAccessorData *)accessorRef)->otherError)
#define NWDPOtherError2Mac(accessorRef) (((NWDPAccessorData *)accessorRef)->otherError2)
#define NWDPOtherErrorStrMac(accessorRef) (((NWDPAccessorData *)accessorRef)->otherErrorStr)
#define NWDPErrorModuleMac(accessorRef) (((NWDPAccessorData *)accessorRef)->errorModule)
#define NWDPErrorLineMac(accessorRef) (((NWDPAccessorData *)accessorRef)->errorLine)

The errorModule and errorLine fields are always available, but might not contain significant data if the debug version of a library subset or DLL is not invoked. These fields are initialized by the NWDPLibInit function to contain NULL and 0 (zero) respectively. If any other value is found, it is the result of a debug library or DLL attempting to return an error condition.

The libError field is always valid and contains either a pertinent library error code or an "other" error category. Error categories indicate that the error occurred in a call to an underlying library. The library containing the routine is identified by the error category code and the actual error from the library is stored in the otherError fields. If the libError field does not contain an error category code, the otherError field contains no valid data.

The otherError field is valid if the NWDP_EC_CATEGORY_MASK (0x01000000) bit is set in the libError field. If the NWDP_EC_CATEGORY2_MASK (0x02000000) bit is set in the libError field, the otherError2 field is also valid, indicating the subordinate library also returned a second error value. If the NWDP_EC_CATEGORYSTR_MASK (0x04000000) bit is set along with the NWDP_EC_CATEGORY_MASK (0x01000000) bit, the otherErrorStrPtr field points to a null-terminated explanation string returned from the subordinate library.

This string might also be pertinent information instead of an error string. For example, if the libError field contains NWDP_EC_STDIO and the otherError2 field contains the platform specific code for a file open failure, then the otherErrorStrPtr string might optionally contain the name of the file that could not be opened.