sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: Contains the source for getws and putws sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: extern "C" sl@0: { sl@0: sl@0: EXPORT_C wchar_t* getws(wchar_t* str) sl@0: { sl@0: size_t size; sl@0: wchar_t* res = NULL; sl@0: sl@0: if(!str) sl@0: { sl@0: errno = EFAULT; sl@0: return NULL; sl@0: } sl@0: res = fgetws(str, BUFSIZ, stdin); sl@0: if(res) sl@0: { sl@0: size = wcslen (str); sl@0: if( (str[size-1] == L'\n') && (res[size-1] == L'\n') ) sl@0: { sl@0: str[size-1] = L'\0'; sl@0: res[size-1] = L'\0'; sl@0: } sl@0: } sl@0: return res; sl@0: } sl@0: sl@0: EXPORT_C int putws(wchar_t* str) sl@0: { sl@0: if(!str) sl@0: { sl@0: errno = EFAULT; sl@0: return -1; sl@0: } sl@0: return (fputws(str, stdout)); sl@0: } sl@0: sl@0: }//extern "C" sl@0: sl@0: