sl@0: /* sl@0: * Copyright (c) 1997-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: sl@0: * FUNCTION sl@0: * <>---create a temporary file sl@0: * INDEX sl@0: * tmpfile sl@0: * INDEX sl@0: * _tmpfile_r sl@0: * ANSI_SYNOPSIS sl@0: * #include sl@0: * FILE *tmpfile(void); sl@0: * FILE *_tmpfile_r(void *<[reent]>); sl@0: * TRAD_SYNOPSIS sl@0: * #include sl@0: * FILE *tmpfile(); sl@0: * FILE *_tmpfile_r(<[reent]>) sl@0: * char *<[reent]>; sl@0: * Create a temporary file (a file which will be deleted automatically), sl@0: * using a name generated by <>. The temporary file is opened with sl@0: * the mode <<"wb+">>, permitting you to read and write anywhere in it sl@0: * as a binary file (without any data transformations the host system may sl@0: * perform for text files). sl@0: * The alternate function <<_tmpfile_r>> is a reentrant version. The sl@0: * argument <[reent]> is a pointer to a reentrancy structure. sl@0: * RETURNS sl@0: * <> normally returns a pointer to the temporary file. If no sl@0: * temporary file could be created, the result is NULL, and <> sl@0: * records the reason for failure. sl@0: * PORTABILITY sl@0: * Both ANSI C and the System V Interface Definition (Issue 2) require sl@0: * <>. sl@0: * Supporting OS subroutines required: <>, <>, <>, sl@0: * <>, <>, <>, <>, <>, <>. sl@0: * <> also requires the global pointer <>. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: sl@0: /** sl@0: Open a temporary file. sl@0: Creates a temporary binary file for update. sl@0: The filename is unique to avoid any conflict with existing files. sl@0: @return file pointer (stream) to the temporary file created. sl@0: If the file can not be created a NULL pointer is returned. sl@0: */ sl@0: EXPORT_C FILE *tmpfile (void) sl@0: { sl@0: return _tmpfile_r (_REENT); sl@0: } sl@0: sl@0: /** sl@0: Open a temporary file. sl@0: Creates a temporary binary file for update. sl@0: The filename is unique to avoid any conflict with existing files. sl@0: @return FILE sl@0: */ sl@0: EXPORT_C FILE *_tmpfile_r (struct _reent *r) sl@0: { sl@0: return _wfopen_r(r, (wchar_t*)L"TMP:", (wchar_t*)L"wb+"); sl@0: }