00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef __TLERROR_H__
00018 #define __TLERROR_H__
00019 
00020 #include "tlVision.h"
00021 
00022 
00023 
00024 enum tl_errors { 
00025   TL_NO_ERROR, 
00026   TL_ERROR, 
00027   TL_ERROR_INVALID_FORMAT,
00028   TL_ERROR_GEOMETRY, 
00029   TL_ERROR_NULL_POINTER,
00030   TL_ERROR_INDEX_OUT_OF_BOUNDS,
00031   TL_ERROR_MAX_REACHED,
00032   TL_ERROR_ALLOCATION_FAILED,
00033   TL_ERROR_NOT_IMPLEMENTED, 
00034   TL_ERROR_FILE_IO, 
00035   TL_ERROR_FILE_NOT_FOUND_OR_CORRUPT, 
00036   TL_ERROR_NOT_REQUIRED,
00037   TL_ERROR_NOT_FOUND, 
00038   TL_ERROR_NOT_AVAILABLE, 
00039   TL_ERROR_NOT_IN_IMAGE,
00040   TL_ERROR_STACK_OVERFLOW, 
00041   TL_ERROR_TIMEOUT,
00042   TL_ERROR_THREAD,
00043   TL_ERROR_TIMER,
00044   TL_ERROR_RESOURCE_NOT_AVAILABLE,
00045   TL_ERROR_CONFIG_FAILED,
00046   TL_ERROR_GRAB_FAILED,
00047   TL_ERROR_HIGHRES_INCOMPATIBLE,
00048   TL_ERROR_NA
00049 };
00050 
00051 #define tl_errno (*tl_errno_location())
00052 #define TL_ERROR_MSG(msg)       { if (tlVerbose) { cout << msg << endl;} }
00053 #define TL_ERRNO_MSG(msg,errno) { (tl_errno = errno); if (tlVerbose > 0) {tlError (msg); }}
00054 
00055 
00056 int *tl_errno_location ();
00057 void tl_errno_destructor (void *);
00058 void tl_errno_once ();
00059 
00060 
00061 void tlError ();
00062 void tlError (const char *str);
00063 void tlError (int errno);
00064 void tlError (int errno, const char *str);
00065 char *tlErrorGetString (int errno);
00066 char *tlErrorGetString (int errno);
00067 
00068 #endif