1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: ubl_Api.h 4 5 Copyright (C)2010 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 17231 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef UBL_API_H_ 17 #define UBL_API_H_ 18 19 #include<nn/fs.h> 20 #include<nn/fnd.h> 21 #include<nn/Result.h> 22 23 namespace nn { 24 namespace ubl { 25 26 /*=======================================================================* 27 関数プロトタイプ宣言 28 *=======================================================================*/ 29 30 /*!--------------------------------------------------------------------------* 31 @brief UBLライブラリを初期化します 32 33 あらかじめSDカードスロットにSDカードを差しておく必要があります。 34 SDカードがなくても動作しますが、ブラックリストの更新内容は保存されません。 35 36 @return なし 37 *---------------------------------------------------------------------------*/ 38 void Initialize( void ); 39 40 /*!--------------------------------------------------------------------------* 41 Name: Finalize 42 43 @brief UBLライブラリを終了します 44 *---------------------------------------------------------------------------*/ 45 void Finalize( void ); 46 47 /*!--------------------------------------------------------------------------* 48 @brief ローカルブラックリストをクリアーした後、SDカードに書き出します 49 50 @return クリアー処理に対する戻り値が返ります 51 *---------------------------------------------------------------------------*/ 52 nn::Result Clear( void ); 53 54 /*!--------------------------------------------------------------------------* 55 @brief 指定IDがブラックリストに存在するか調べます 56 57 titleIdが0でかつdataIdがNULLの時はローカルブラックリストを検索し、 58 それ以外の場合はグローバルブラックリストを検索します。 59 60 @param[in] authorId 検索する作者ID 61 @param[in] titleId 検索するタイトルID 62 @param[in] dataId 検索するUGCデータID 63 64 @return trueなら見つかった、falseなら見つからなかった 65 *---------------------------------------------------------------------------*/ 66 bool IsExist( u64 authorId , u32 titleId , u8 *dataId); 67 68 /*!--------------------------------------------------------------------------* 69 @brief ローカルブラックリストに登録されている作者の総数を返します 70 71 @return ローカルブラックリストに登録されている作者の総数 72 *---------------------------------------------------------------------------*/ 73 u32 GetTotalLocalUser( void ); 74 75 /*!--------------------------------------------------------------------------* 76 @brief グローバル作者ブラックリストに登録されている作者の総数を返します 77 78 @return グローバル作者ブラックリストに登録されている作者の総数 79 *---------------------------------------------------------------------------*/ 80 u32 GetTotalGlobalUser( void ); 81 82 /*!--------------------------------------------------------------------------* 83 @brief グローバルデータブラックリストに登録されているデータの総数を返します 84 85 @return グローバルデータブラックリストに登録されているデータの総数 86 *---------------------------------------------------------------------------*/ 87 u32 GetTotalGlobalData( void ); 88 89 /*!--------------------------------------------------------------------------* 90 @brief CTR本体のユニークIDを返します 91 92 @return CTR本体のユニークID 93 *---------------------------------------------------------------------------*/ 94 u64 GetUserId( void ); 95 96 /*!--------------------------------------------------------------------------* 97 @brief ユーザー名を取得します 98 99 @param[out] name 取得したユーザ名を格納するメモリへのポインタ 100 101 @return ユーザー名にNGワードが含まれている場合にはtrue 102 *---------------------------------------------------------------------------*/ 103 bool GetUserName( wchar_t *name ); 104 105 /*!--------------------------------------------------------------------------* 106 @brief ハッシュデータを取得します 107 108 @param[in] inputBuffer 入力データへのポインタ 109 @param[in] inputSize 入力データのサイズ 110 @param[out] hashData 取得したハッシュデータを格納するメモリへのポインタ 111 *---------------------------------------------------------------------------*/ 112 void GetHashValue( u8 *inputBuffer , size_t inputSize ,u8 *hashData); 113 114 /*!--------------------------------------------------------------------------* 115 @brief 指定されたIDと日時をローカルブラックリストに登録し、SDカードに書きます 116 117 @param[in] id 登録するID 118 @param[in] dt 登録日時 119 120 @return 登録処理に対する戻り値が返ります 121 *---------------------------------------------------------------------------*/ 122 nn::Result Entry( u64 id, nn::fnd::DateTime *dt ); 123 124 } // end of namespace ubl 125 } // end of namespace nn 126 127 #endif /* UBL_API_H_ */ 128