source: SVN/cambria/redboot/packages/devs/eth/intel/npe/common/current/include/IxOsPrintf.h @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 2.7 KB
Line 
1/**
2 * @file IxOsPrintf.h
3 *
4 * @brief this file contains the API of the @ref IxOsServices component
5 *
6 * @par
7 * IXP400 SW Release version 2.3
8 *
9 * -- Copyright Notice --
10 *
11 * @par
12 * Copyright (c) 2001-2005, Intel Corporation.
13 * All rights reserved.
14 *
15 * @par
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 *    notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 *    notice, this list of conditions and the following disclaimer in the
23 *    documentation and/or other materials provided with the distribution.
24 * 3. Neither the name of the Intel Corporation nor the names of its contributors
25 *    may be used to endorse or promote products derived from this software
26 *    without specific prior written permission.
27 *
28 *
29 * @par
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 *
43 * @par
44 * -- End of Copyright Notice --
45 */
46
47#include "IxTypes.h"
48
49#ifndef IxOsPrintf_H
50
51#ifndef __doxygen_hide
52#define IxOsPrintf_H
53#endif /* __doxygen_hide */
54
55#ifdef __wince
56
57#ifndef IX_USE_SERCONSOLE
58
59static int
60ixLogMsg(
61    char *pFormat, 
62    ...
63    )
64{   
65#ifndef IN_KERNEL
66    static WCHAR    pOutputString[256]; 
67        static char     pNarrowStr[256];
68    int             returnCnt = 0; 
69    va_list ap;
70   
71    pOutputString[0] = 0; 
72        pNarrowStr[0] = 0;     
73   
74    va_start(ap, pFormat);
75
76        returnCnt = _vsnprintf(pNarrowStr, 256, pFormat, ap);
77
78    MultiByteToWideChar(
79            CP_ACP, 
80            MB_PRECOMPOSED, 
81            pNarrowStr, 
82            -1, 
83            pOutputString, 
84            256
85            ); 
86
87    OutputDebugString(pOutputString);
88
89    return returnCnt; 
90#else
91    return 0; 
92#endif
93}
94#define printf ixLogMsg
95
96#endif /* IX_USE_SERCONSOLE */
97
98#endif /* __wince */
99
100/**
101 * @} IxOsPrintf
102 */
103
104#endif /* IxOsPrintf_H */
Note: See TracBrowser for help on using the repository browser.