1*bcd9f837Suwe /* $NetBSD: winprintf.c,v 1.4 2006/01/18 01:06:37 uwe Exp $ */
29173eae7Such
39173eae7Such /*-
49173eae7Such * Copyright (c) 1999 Shin Takemura.
59173eae7Such * All rights reserved.
69173eae7Such *
79173eae7Such * This software is part of the PocketBSD.
89173eae7Such *
99173eae7Such * Redistribution and use in source and binary forms, with or without
109173eae7Such * modification, are permitted provided that the following conditions
119173eae7Such * are met:
129173eae7Such * 1. Redistributions of source code must retain the above copyright
139173eae7Such * notice, this list of conditions and the following disclaimer.
149173eae7Such * 2. Redistributions in binary form must reproduce the above copyright
159173eae7Such * notice, this list of conditions and the following disclaimer in the
169173eae7Such * documentation and/or other materials provided with the distribution.
179173eae7Such * 3. All advertising materials mentioning features or use of this software
189173eae7Such * must display the following acknowledgement:
199173eae7Such * This product includes software developed by the PocketBSD project
209173eae7Such * and its contributors.
219173eae7Such * 4. Neither the name of the project nor the names of its contributors
229173eae7Such * may be used to endorse or promote products derived from this software
239173eae7Such * without specific prior written permission.
249173eae7Such *
259173eae7Such * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
269173eae7Such * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
279173eae7Such * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
289173eae7Such * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
299173eae7Such * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
309173eae7Such * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
319173eae7Such * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
329173eae7Such * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
339173eae7Such * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
349173eae7Such * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
359173eae7Such * SUCH DAMAGE.
369173eae7Such *
379173eae7Such */
38*bcd9f837Suwe #include <winbase.h>
399173eae7Such
409173eae7Such int
win_printf(LPWSTR lpszFmt,...)419173eae7Such win_printf(LPWSTR lpszFmt, ...)
429173eae7Such {
439173eae7Such int count;
449173eae7Such va_list ap;
459173eae7Such wchar_t buffer[2048];
469173eae7Such
479173eae7Such va_start(ap, lpszFmt);
489173eae7Such count = wvsprintf(buffer, lpszFmt, ap);
499173eae7Such va_end(ap);
509173eae7Such if (count > 0) {
519173eae7Such OutputDebugStringW(buffer);
529173eae7Such }
539173eae7Such return count;
549173eae7Such }
55