1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     os_UtilityCTR.cpp
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #include <nw/types.h>
19 #include <nn/dbg/dbg_Result.h>
20 #include <nn/dbg/dbg_Break.h>
21 
22 #include <cstdio>
23 #include <cstdarg>
24 #include <cstring>
25 
26 namespace nw {
27 namespace os {
28 namespace internal {
29 
30 /*!--------------------------------------------------------------------------*
31   Name:        VPrintf
32 
33   @brief       引数リスト指定で書式付き文字列を出力します。
34 
35   @param[in]   fmt     出力文字列フォーマット
36   @param[in]   vlist   可変長引数リスト
37 
38   @return      None.
39  *---------------------------------------------------------------------------*/
40 NW_WEAK_SYMBOL void
VPrintf(const char * fmt,std::va_list vlist)41 VPrintf(const char *fmt, std::va_list vlist)
42 {
43     nndbgDetailVPrintf(fmt, vlist);
44 }
45 
46 } // namespace internal
47 
48 /*!--------------------------------------------------------------------------*
49   Name:        Halt
50 
51   @brief       プログラムを異常終了します。
52 
53   @return      None.
54  *---------------------------------------------------------------------------*/
55 void
Halt()56 Halt()
57 {
58     (void)nn::dbg::Break();
59 }
60 
61 /*!--------------------------------------------------------------------------*
62   Name:        VSNPrintf
63 
64   @brief       引数リスト指定で、与えられたバッファへ書式付き文字列を出力します。
65 
66   @param[out]  dst
67   @param[in]   len
68   @param[in]   fmt     出力文字列フォーマット
69   @param[in]   vlist   可変長引数リスト
70 
71   @return      出力文字列の文字列長 ('\0'を除く)
72  *---------------------------------------------------------------------------*/
73 int
VSNPrintf(char * dst,size_t len,const char * fmt,std::va_list vlist)74 VSNPrintf(char* dst, size_t len, const char* fmt, std::va_list vlist)
75 {
76     return vsnprintf(dst, len, fmt, vlist);
77 }
78 
79 }  // namespace os
80 }  // namespace nw
81