Beispiel #1
0
/// report libmng error information 
void ReportLibmngError (iObjectRegistry *object_reg, mng_handle hMNG, const char* msg)
{
  mng_int8     severity;
  mng_chunkid  chunkname;
  mng_uint32   chunkseq;
  mng_int32    extra1;
  mng_int32    extra2;
  mng_pchar    errortext;

  mng_getlasterror (hMNG, &severity, &chunkname, &chunkseq, &extra1, 
    &extra2, &errortext);

  Report (object_reg, CS_REPORTER_SEVERITY_WARNING,
    "%s: %s (severity %" PRId8 ", chunkname %.8" PRIx32 ", chunkseq %" PRIu32 ", %.8" PRIx32 ", %.8" PRIx32 ")",
    msg, errortext, severity, chunkname, chunkseq, extra1, extra2);
}
Beispiel #2
0
static void handle_read_error(PluginInstance *This, mng_retcode rv)
{
	mng_int8     iSeverity;
	mng_chunkid  iChunkname;
	mng_uint32   iChunkseq;
	mng_int32    iExtra1;
	mng_int32    iExtra2;
	mng_pchar    zErrortext;

#ifdef MNGPLG_TRACE
	fprintf(tracefile,"returned: %d\n",rv);
#endif

	switch(rv) {
	case MNG_NOERROR: case MNG_NEEDTIMERWAIT:
		break;

	case MNG_NEEDMOREDATA:
		if(This->loadstate>=STATE_LOADED) {
			set_error(This,"Unexpected end of file");
		}
		else {
			This->needresume=1;
		}
		break;

	case MNG_INVALIDSIG:
		set_error(This,"Invalid or missing MNG file (maybe a 404 Not Found error)");
		break;

	default:

		mng_getlasterror(This->mng, &iSeverity,&iChunkname,&iChunkseq,&iExtra1,
			&iExtra2,&zErrortext);

		if(zErrortext) {
			set_error(This,"Error reported by libmng (%d)\r\n\r\n%s",(int)rv,zErrortext);
		}
		else {
			set_error(This,"Error %d reported by libmng",(int)rv);
		}
	}
}
Beispiel #3
0
//---------------------------------------------------------------------------
void  __fastcall TMainForm::MNGError( mng_handle hMNG, String SHMsg )
{
// get extended info 
mng_uint32  iErrorcode;
mng_uint8   iSeverity;
mng_chunkid iChunkname;
mng_uint32  iChunkseq;
mng_int32   iExtra1;
mng_int32   iExtra2;
mng_pchar   zErrortext;
char        szFormatStr[ 256 ];

  iErrorcode = mng_getlasterror( hMNG, &iSeverity, &iChunkname,
                          &iChunkseq, &iExtra1, &iExtra2,
                          &zErrortext);

  wsprintf( szFormatStr,
    "Error = %d; Severity = %d; Chunknr = %d; Extra1 = %d",
    (int)iErrorcode, (int)iSeverity, (int)iChunkseq, (int)iExtra1
  );

  MsgBoxStop( SHMsg + "\n\n" +  String( zErrortext ) + "\n\n" + String( szFormatStr ) );
}