MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
lt_status.h File Reference

Declaration of the LT_STATUS type and some commonly used status codes. More...

Go to the source code of this file.

Defines

Common status codes
#define LT_STS_Success   ((LT_STATUS)0)
 status code indicating success
#define LT_STS_Failure   ((LT_STATUS)1)
 status code indicating failure
#define LT_STS_Uninit   ((LT_STATUS)2)
 status code indicating unintialized variable
#define LT_STS_BadParam   ((LT_STATUS)3)
 status code indicating bad function parameter
#define LT_STS_BadContext   ((LT_STATUS)4)
 status code indicating bad calling context for function
#define LT_STS_ForeignError   ((LT_STATUS)5)
 status code indicating 3rd-party library error
#define LT_STS_NotReached   ((LT_STATUS)6)
 status code indicating unreachable code
#define LT_STS_NullPointer   ((LT_STATUS)7)
 status code indicating bad NULL pointer dereference
#define LT_STS_OutOfMemory   ((LT_STATUS)8)
 status code indicating new/malloc/calloc failed
#define LT_STS_Unimplemented   ((LT_STATUS)9)
 Status code indicating that the called function has not been implemented.
Macros for checking status codes
#define LT_SUCCESS(err)   ((err)==LT_STS_Success)
 checks return value for success status
#define LT_FAILURE(err)   ((err)!=LT_STS_Success)
 checks return value for failure status

Typedefs

typedef lt_uint32 LT_STATUS
 An integral status code.

Detailed Description

Note:
This file is C-callable.

Definition in file lt_status.h.


Define Documentation

#define LT_FAILURE (   err)    ((err)!=LT_STS_Success)

Definition at line 148 of file lt_status.h.

#define LT_STS_BadContext   ((LT_STATUS)4)

This status code indicates that the function was called in some unexpected fashion: not that there was anything wrong with the parameters per se, it's just that the world was not set up for you to make this particular call in this particular way right now -- you've violated a documented execution constraint of some sort. Examples: calling a class's member function before calling initialize(), calling decode before setting a scene or an output buffer, etc. (Contrast this with LT_STS_BadParam, which is a more specific kind of problem.)

Definition at line 94 of file lt_status.h.

#define LT_STS_BadParam   ((LT_STATUS)3)

This status code indicates that one of the parameters passed to the function was invalid, according to the documented interface rules. Examples: an integer value is out of the allowed range, or a pointer

Examples:
UsingCStream.c.

Definition at line 79 of file lt_status.h.

#define LT_STS_Failure   ((LT_STATUS)1)

This status code indicates general, nonspecific failure. Use sparingly; project-specific codes are preferred where possible.

Examples:
DecodeMrSIDBandSelection.cpp, DerivedImageFilter.cpp, DerivedImageReader.cpp, DerivedStream.cpp, SceneBuffer.cpp, and UsingCStream.c.

Definition at line 60 of file lt_status.h.

#define LT_STS_ForeignError   ((LT_STATUS)5)

This status code indicates an unknown or otherwise undiagnosable exception or error was generated by a call into a 3rd party library.

Definition at line 102 of file lt_status.h.

#define LT_STS_NotReached   ((LT_STATUS)6)

This status code is used for code that by definition should not or cannot be reached, e.g. the default case in a switch statement for which you think you've covered the full range of legal case values, where you're left with a dangling return statement. A return of LT_STS_NotReached is often preceeded by "LT_ASSERT(false)".

Definition at line 113 of file lt_status.h.

#define LT_STS_NullPointer   ((LT_STATUS)7)

This status code is used when checking a pointer to make sure that it is not NULL, prior to dereferencing it.

Definition at line 121 of file lt_status.h.

#define LT_STS_OutOfMemory   ((LT_STATUS)8)

This status code is used when allocating memory returns a NULL pointer.

Definition at line 129 of file lt_status.h.

#define LT_STS_Unimplemented   ((LT_STATUS)9)

Definition at line 135 of file lt_status.h.

#define LT_SUCCESS (   err)    ((err)==LT_STS_Success)
Examples:
DerivedImageFilter.cpp, and DerivedImageReader.cpp.

Definition at line 146 of file lt_status.h.


Typedef Documentation

This value is explicitly sized, i.e. lt_uint32 and not an "unsigned long", so it can be passed safely between pre-compiled libraries. Each LizardTech project/library is assigned ranges of values, e.g. 1000-1999, for project-specific, local usage. Values 0-100 are general, LizardTech-wide codes. Values 65000-65535 are reserved for customer use.

Definition at line 39 of file lt_status.h.