/*---------------------------------------------------------------------------* Project: Horizon File: fnd_DetailList.h Copyright (C)2009 Nintendo Co., Ltd. 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. $Rev: 12449 $ *---------------------------------------------------------------------------*/ #ifndef NN_FND_DETAIL_FND_DETAIL_LIST_H_ #define NN_FND_DETAIL_FND_DETAIL_LIST_H_ #include #include #include #include #ifdef __cplusplus namespace nn { namespace fnd { namespace detail { /// @cond /*---------------------------------------------------------------------------* Name: NN_OS_INIT_LIST Description: リスト構造体を初期化するためのマクロです。実際の初期化には、 NNSFndInitList()関数により行われます。 このマクロでは、指定された構造体名とNNSFndLink型メンバ変数名 から、offsetofマクロを使ってオフセットを求め、NNSFndInitList 関数に渡しています。 Arguments: list: リンク構造体へのポインタ。 structName: リストに繋げたいオブジェクトの構造体名。 linkName: このオブジェクトのリンクに使用されるNNSFndLink型 のメンバ変数名。 Returns: なし。 *---------------------------------------------------------------------------*/ #define NN_OS_INIT_LIST(list, structName, linkName) \ InitList(list, offsetof(structName, linkName)) /*---------------------------------------------------------------------------* 関数プロトタイプ。 *---------------------------------------------------------------------------*/ void InitList( NNSFndList* list, u16 offset); void AppendListObject( NNSFndList* list, void* object); void PrependListObject( NNSFndList* list, void* object); void InsertListObject( NNSFndList* list, void* target, void* object); void RemoveListObject( NNSFndList* list, void* object); void* GetNextListObject( const NNSFndList* list, const void* object); void* GetPrevListObject( const NNSFndList* list, const void* object); void* GetNthListObject( const NNSFndList* list, u16 index); /*---------------------------------------------------------------------------* Name: GetListSize Description: 引数で指定されたリストに登録されているオブジェクトの数を 取得します。 Arguments: list リスト構造体へのポインタ。 Returns: 指定されたリストに登録されているオブジェクトの数を返します。 *---------------------------------------------------------------------------*/ inline u16 GetListSize( const NNSFndList* list ) { NN_TASSERT_( list ); return list->numObjects; } /* NN_OS_LIST_H_ */ /// @endcond }}} // namespace nn::os #endif // __cplusplus #endif