1 /*---------------------------------------------------------------------------*
2 Project: NintendoWare
3 File: os_UtilityCTR.cpp
4
5 Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. 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 $Revision: 13145 $
14 *---------------------------------------------------------------------------*/
15
16 #include <nw/types.h>
17 #include <nn/dbg/dbg_Result.h>
18 #include <nn/dbg/dbg_Break.h>
19
20 #include <cstdio>
21 #include <cstdarg>
22 #include <cstring>
23
24 namespace nw {
25 namespace os {
26 namespace internal {
27
28 /*!--------------------------------------------------------------------------*
29 Name: VPrintf
30
31 @brief 引数リスト指定で書式付き文字列を出力します。
32
33 @param[in] fmt 出力文字列フォーマット
34 @param[in] vlist 可変長引数リスト
35
36 @return None.
37 *---------------------------------------------------------------------------*/
38 void
VPrintf(const char * fmt,std::va_list vlist)39 VPrintf(const char *fmt, std::va_list vlist)
40 {
41 nndbgDetailVPrintf(fmt, vlist);
42 }
43
44 } // namespace internal
45
46 /*!--------------------------------------------------------------------------*
47 Name: Halt
48
49 @brief プログラムを異常終了します。
50
51 @return None.
52 *---------------------------------------------------------------------------*/
53 void
Halt()54 Halt()
55 {
56 (void)nn::dbg::Break();
57 }
58
59 /*!--------------------------------------------------------------------------*
60 Name: VSNPrintf
61
62 @brief 引数リスト指定で、与えられたバッファへ書式付き文字列を出力します。
63
64 @param[out] dst
65 @param[in] len
66 @param[in] fmt 出力文字列フォーマット
67 @param[in] vlist 可変長引数リスト
68
69 @return 出力文字列の文字列長 ('\0'を除く)
70 *---------------------------------------------------------------------------*/
71 int
VSNPrintf(char * dst,size_t len,const char * fmt,std::va_list vlist)72 VSNPrintf(char* dst, size_t len, const char* fmt, std::va_list vlist)
73 {
74 return vsnprintf(dst, len, fmt, vlist);
75 }
76
77 } // namespace os
78 } // namespace nw
79