Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

error.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _ERROR_H   1
#define __ASSERT_FUNCTION   __PRETTY_FUNCTION__
#define fail_neg(eval)   real_fail_neg (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
#define fail_null(eval)   real_fail_null (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
#define fail_if(eval)   real_fail_if (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)

Functions

void real_fail_neg (int eval, const char *eval_str, const char *func, const char *file, int line)
void real_fail_null (const void *eval, const char *eval_str, const char *func, const char *file, int line)
 error handler for NULL result codes
void real_fail_if (bool eval, const char *eval_str, const char *func, const char *file, int line)
void sigpipe_clear ()
int sigpipe_get ()


Define Documentation

#define __ASSERT_FUNCTION   __PRETTY_FUNCTION__
 

Definition at line 33 of file error.h.

#define _ERROR_H   1
 

Definition at line 22 of file error.h.

#define fail_if eval   )     real_fail_if (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
 

Definition at line 38 of file error.h.

Referenced by AVIFile::GetDVFrame(), AVIFile::GetDVFrameInfo(), RawHandler::GetFrame(), AVIFile::getFrame(), AVIFile::GetFrameInfo(), RIFFFile::ParseChunk(), RIFFFile::ParseList(), AVIFile::ParseList(), RIFFFile::ParseRIFF(), AVIFile::PrintDirectoryEntryData(), RIFFFile::ReadChunk(), RIFFFile::WriteChunk(), and RIFFFile::WriteRIFF().

#define fail_neg eval   )     real_fail_neg (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
 

Definition at line 36 of file error.h.

Referenced by AVC::AVC(), AVIFile::GetDVFrame(), AVIFile::GetDVFrameInfo(), AVIFile::getFrame(), AVIFile::GetFrameInfo(), AVIFile::getStreamFormat(), RIFFFile::ParseChunk(), RIFFFile::ParseList(), AVIFile::ParseList(), AVIFile::PrintDirectoryEntryData(), RIFFFile::ReadChunk(), showScenesThread(), RIFFFile::WriteChunk(), and RIFFFile::WriteRIFF().

#define fail_null eval   )     real_fail_null (eval, #eval, __ASSERT_FUNCTION, __FILE__, __LINE__)
 

Definition at line 37 of file error.h.

Referenced by AVIHandler::Create(), and AVIHandler::Open().


Function Documentation

void real_fail_if bool  eval,
const char *  eval_str,
const char *  func,
const char *  file,
int  line
 

Definition at line 88 of file error.cc.

00089 {
00090     if ( eval == true )
00091     {
00092 
00093         string exc;
00094         ostringstream sb;
00095 
00096         sb << file << ":" << line << ": In function \"" << func << "\": condition \"" << eval_str << "\" is true";
00097         if ( errno != 0 )
00098             sb << endl << file << ":" << line << ": errno: " << errno << " (" << strerror( errno ) << ")";
00099         sb << ends;
00100         exc = sb.str();
00101         cerr << exc << endl;
00102         throw exc;
00103     }
00104 }

void real_fail_neg int  eval,
const char *  eval_str,
const char *  func,
const char *  file,
int  line
 

Definition at line 47 of file error.cc.

00048 {
00049     if ( eval < 0 )
00050     {
00051         string exc;
00052         ostringstream sb;
00053 
00054         sb << file << ":" << line << ": In function \"" << func << "\": \"" << eval_str << "\" evaluated to " << eval;
00055         if ( errno != 0 )
00056             sb << endl << file << ":" << line << ": errno: " << errno << " (" << strerror( errno ) << ")";
00057         sb << ends;
00058         exc = sb.str();
00059         cerr << exc << endl;
00060         throw exc;
00061     }
00062 }

void real_fail_null const void *  eval,
const char *  eval_str,
const char *  func,
const char *  file,
int  line
 

error handler for NULL result codes

Whenever this is called with a NULL argument, it will throw an exception. Typically used with functions like malloc() and new().

Definition at line 72 of file error.cc.

00073 {
00074     if ( eval == NULL )
00075     {
00076 
00077         string exc;
00078         ostringstream sb;
00079 
00080         sb << file << ":" << line << ": In function \"" << func << "\": " << eval_str << " is NULL" << ends;
00081         exc = sb.str();
00082         cerr << exc << endl;
00083         throw exc;
00084     }
00085 }

void sigpipe_clear  ) 
 

Definition at line 54 of file main.c.

References sigpipe.

Referenced by PCMExport::CloseAudio(), WAVExport::CloseAudio(), DvEncoderVideoPipePGM::CloseVideo(), DvEncoderVideoPipeYUV::CloseVideo(), KinoMJPEGVideoPipe::CloseVideo(), WAVExport::OpenAudio(), DvEncoderVideoPipePGM::OpenVideoPipe(), DvEncoderVideoPipeYUV::OpenVideoPipe(), KinoMJPEGVideoPipe::OpenVideoPipe(), PCMExport::OutputAudioFrame(), WAVExport::OutputAudioFrame(), DvEncoderVideoPipePGM::OutputVideoFrame(), DvEncoderVideoPipeYUV::OutputVideoFrame(), KinoDeinterlacedMJPEGVideoPipe::OutputVideoFrame(), and KinoMJPEGVideoPipe::OutputVideoFrame().

00055 {
00056     sigpipe = 0;
00057 }

int sigpipe_get  ) 
 

Definition at line 59 of file main.c.

References sigpipe.

Referenced by PCMExport::CloseAudio(), WAVExport::CloseAudio(), DvEncoderVideoPipePGM::CloseVideo(), DvEncoderVideoPipeYUV::CloseVideo(), KinoMJPEGVideoPipe::CloseVideo(), PCMExport::OpenAudio(), WAVExport::OpenAudio(), DvEncoderVideoPipePGM::OpenVideoPipe(), DvEncoderVideoPipeYUV::OpenVideoPipe(), KinoMJPEGVideoPipe::OpenVideoPipe(), PCMExport::OutputAudioFrame(), WAVExport::OutputAudioFrame(), DvEncoderVideoPipePGM::OutputVideoFrame(), DvEncoderVideoPipeYUV::OutputVideoFrame(), KinoDeinterlacedMJPEGVideoPipe::OutputVideoFrame(), and KinoMJPEGVideoPipe::OutputVideoFrame().

00060 {
00061     return sigpipe;
00062 }


Generated on Sun Mar 11 22:11:56 2007 for Kino by  doxygen 1.4.2