/*---------------------------------------------------------------------------*
  Project:  NitroSDK - WM - libraries
  File:     wm_arm9_private.h

  Copyright 2003,2004 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.

  $Log: wm_arm9_private.h,v $
  Revision 1.6  2004/10/22 04:39:39  terui
  Changed functions that return int type as WMErrCode so that they return WMErrCode enumerator type.

  Revision 1.5  2004/10/15 14:11:11  terui
  Defined the fixed value returned when the WM_GetAllowedChannel function is not initialized.

  Revision 1.4  2004/09/23 12:34:43  seiki_masashi
  Changed wm_private.h to do include

  Revision 1.3  2004/09/11 06:09:12  yasu
  Use OS_TPrintf instead of WMi_Printf

  Revision 1.2  2004/09/11 04:13:00  terui
  Changed print for didplaying warnings so not much stack is consumed.

  Revision 1.1  2004/09/10 11:04:02  terui
  Divided wm.c, so made new upload.

  $NoKeywords: $
 *---------------------------------------------------------------------------*/

#ifndef LIBRARIES_WM_ARM9_WM_ARM9_PRIVATE_H__
#define LIBRARIES_WM_ARM9_WM_ARM9_PRIVATE_H__

#ifdef  __cplusplus
extern "C" {
#endif

/*===========================================================================*/

#include    "wm_private.h"


/*---------------------------------------------------------------------------*
    Constant Definitions
 *---------------------------------------------------------------------------*/
#define     WM_GET_ALLOWED_CHANNEL_BEFORE_INIT      0x8000


/*---------------------------------------------------------------------------*
    Macro definitions
 *---------------------------------------------------------------------------*/
#define     WM_CHECK_RESULT( res )      \
    if( ( res ) != WM_ERRCODE_SUCCESS ) \
    {                                   \
        return ( res );                 \
    }

#ifdef  SDK_DEBUG
#define WM_WARNING(...) \
    (void) ( WMi_Warning(__FILE__, __LINE__, __VA_ARGS__) )
#else
#define WM_WARNING(...)     ((void) 0)
#endif


/*---------------------------------------------------------------------------*
    Private function prototypes
 *---------------------------------------------------------------------------*/
void        WMi_SetCallbackTable( WMApiid id , WMCallbackFunc callback );
WMErrCode   WMi_SendCommand( WMApiid id , u16 paramNum , ... );
WMArm9Buf*  WMi_GetSystemWork( void );
WMErrCode   WMi_CheckStateEx( s32 paramNum , ... );
WMErrCode   WMi_CheckInitialized( void );
WMErrCode   WMi_CheckIdle( void );

#ifndef SDK_FINALROM
#define WMi_Printf      OS_TPrintf
#define WMi_Warning     OSi_TWarning
#endif


/*---------------------------------------------------------------------------*
    Inline function definitions
 *---------------------------------------------------------------------------*/
static inline WMErrCode
WMi_CheckState( u32 state )
{
    return WMi_CheckStateEx( 1 , state );
}


/*===========================================================================*/

#ifdef  __cplusplus
}       /* extern "C" */
#endif

#endif  /* LIBRARIES_WM_ARM9_WM_ARM9_PRIVATE_H__ */

/*---------------------------------------------------------------------------*
  End of file
 *---------------------------------------------------------------------------*/

