TwlIPL/include/sysmenu/errorLog.h
aoki_ryoma 977ce6540a エラーログのフォーマットを大幅に変更。
printf的なフリーフォーマットの書き込み用の関数を追加。
エントリサイズを256byteに変更。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2187 b08762b0-b915-fc4b-9d8c-17b2551a87ff
2008-08-19 06:31:45 +00:00

85 lines
2.2 KiB
C

/*---------------------------------------------------------------------------*
Project: TwlIPL - ErrorLog
File: errorLog.h
Copyright **** Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef __SYSM_ERRORLOG__
#define __SYSM_ERRORLOG__
#include <twl.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef SDK_ARM9
/*-- type definition ----------------------------*/
// 日付データとかを除いた、自由フォーマットで書き込めるサイズ
// このサイズを超えた文字列は切り捨てられます
#define ERRORLOG_STR_LENGTH 204
// 既に書き込まれたエラーログを表現するためのエントリ
typedef struct ErrorLogEntry{
// ランチャからの呼び出しかどうか
BOOL isBroken;
BOOL isLauncherError;
// エラーのタイムスタンプ
int year;
int month;
int day;
char week[4]; // 曜日の3文字表現
int hour;
int minute;
int second;
// ---- isLauncherError = TRUEの時のデータ ----
// エラーコード
int errorCode;
// ---- isLauncherError = FALSEの時のデータ ----
char *errorStr;
} ErrorLogEntry;
typedef struct ErrorLogWork{
// メモリ確保用関数
void* (*Alloc) ( u32 ) ;
void (*Free) ( void* ) ;
// エラーログエントリ保持用変数
ErrorLogEntry *entry;
// エラーログのエントリ数
int numEntry;
// エラーログのファイルポインタ
FSFile file;
} ErrorLogWork;
/*-- function prototype -------------------------*/
extern BOOL ERRORLOG_Write( u64 errorCode );
extern BOOL ERRORLOG_Printf( const char *fmt, ... );
extern BOOL ERRORLOG_Init( void* (*AllocFunc) (u32) , void (*FreeFunc) (void*) );
extern void ERRORLOG_End( void );
extern int ERRORLOG_GetNum() ;
extern const ErrorLogEntry* ERRORLOG_Read( int idx );
#endif // SDK_ARM9
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif