epoc32/include/stdapis/stdio.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 /*-
     1 /*-
     2 
     2 
     3  * © Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
       
     4  * Copyright (c) 1990, 1993
     3  * Copyright (c) 1990, 1993
     5  *	The Regents of the University of California.  All rights reserved.
     4  *	The Regents of the University of California.  All rights reserved.
     6  *
     5  *
     7  * This code is derived from software contributed to Berkeley by
     6  * This code is derived from software contributed to Berkeley by
     8  * Chris Torek.
     7  * Chris Torek.
    31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    32  * SUCH DAMAGE.
    31  * SUCH DAMAGE.
    33  *
    32  *
    34  *	@(#)stdio.h	8.5 (Berkeley) 4/29/95
    33  *	@(#)stdio.h	8.5 (Berkeley) 4/29/95
    35  * $FreeBSD: src/include/stdio.h,v 1.56 2004/06/20 10:01:30 tjr Exp $
    34  * $FreeBSD: src/include/stdio.h,v 1.56 2004/06/20 10:01:30 tjr Exp $
    36  *  © Portions copyright (c) 2005-2006  Nokia Corporation.  All rights reserved.
    35  *  Portions Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
    37  * © Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
       
    38  */
    36  */
    39 
    37 
    40 #ifndef	_STDIO_H_
    38 #ifndef	_STDIO_H_
    41 #define	_STDIO_H_
    39 #define	_STDIO_H_
    42 
    40 
    55 #endif
    53 #endif
    56 
    54 
    57 
    55 
    58 
    56 
    59 typedef	__off_t		fpos_t;
    57 typedef	__off_t		fpos_t;
       
    58 
       
    59 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
    60 typedef	__off_t		fpos64_t;
       
    61 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
    60 
    62 
    61 #ifndef _SIZE_T_DECLARED
    63 #ifndef _SIZE_T_DECLARED
    62 typedef	__size_t	size_t;
    64 typedef	__size_t	size_t;
    63 #define	_SIZE_T_DECLARED
    65 #define	_SIZE_T_DECLARED
    64 #endif
    66 #endif
   130  */
   132  */
   131 typedef	struct __sFILE {
   133 typedef	struct __sFILE {
   132 	unsigned char *_p;	/* current position in (some) buffer */
   134 	unsigned char *_p;	/* current position in (some) buffer */
   133 	int	_r;		/* read space left for getc() */
   135 	int	_r;		/* read space left for getc() */
   134 	int	_w;		/* write space left for putc() */
   136 	int	_w;		/* write space left for putc() */
   135 	short	_flags;		/* flags, below; this FILE is free if 0 */
   137 	short _flags;		/* flags, below; this FILE is free if 0 */
   136 	short	_file;		/* fileno, if Unix descriptor, else -1 */
   138 	short	_file;		/* fileno, if Unix descriptor, else -1 */
   137 	struct	__sbuf _bf;	/* the buffer (at least 1 byte, if !NULL) */
   139 	struct	__sbuf _bf;	/* the buffer (at least 1 byte, if !NULL) */
   138 	int	_lbfsize;	/* 0 or -_bf._size, for inline putc */
   140 	int	_lbfsize;	/* 0 or -_bf._size, for inline putc */
   139 
   141 
   140 	/* operations */
   142 	/* operations */
   316 IMPORT_C int	 remove(const char *);
   318 IMPORT_C int	 remove(const char *);
   317 IMPORT_C int	 rename(const char *, const char *);
   319 IMPORT_C int	 rename(const char *, const char *);
   318 IMPORT_C void	 rewind(FILE *);
   320 IMPORT_C void	 rewind(FILE *);
   319 IMPORT_C int	 scanf(const char * __restrict, ...);
   321 IMPORT_C int	 scanf(const char * __restrict, ...);
   320 IMPORT_C void	 setbuf(FILE * __restrict, char * __restrict);
   322 IMPORT_C void	 setbuf(FILE * __restrict, char * __restrict);
       
   323 
       
   324 #ifdef __SYMBIAN32__
       
   325 IMPORT_C int     set_fmode(char mode);
       
   326 IMPORT_C char     get_fmode(void);
       
   327 #endif
       
   328 
   321 IMPORT_C int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
   329 IMPORT_C int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
   322 IMPORT_C int	 sprintf(char * __restrict, const char * __restrict, ...);
   330 IMPORT_C int	 sprintf(char * __restrict, const char * __restrict, ...);
   323 IMPORT_C int	 sscanf(const char * __restrict, const char * __restrict, ...);
   331 IMPORT_C int	 sscanf(const char * __restrict, const char * __restrict, ...);
   324 IMPORT_C FILE	*tmpfile(void);
   332 IMPORT_C FILE	*tmpfile(void);
   325 IMPORT_C char	*tmpnam(char *);
   333 IMPORT_C char	*tmpnam(char *);
   328 	    va_list);
   336 	    va_list);
   329 IMPORT_C int	 vprintf(const char * __restrict, va_list);
   337 IMPORT_C int	 vprintf(const char * __restrict, va_list);
   330 IMPORT_C int	 vsprintf(char * __restrict, const char * __restrict,
   338 IMPORT_C int	 vsprintf(char * __restrict, const char * __restrict,
   331 	    va_list);
   339 	    va_list);
   332 
   340 
       
   341 
       
   342 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
   343 #define fgetpos64	fgetpos
       
   344 #define fopen64		fopen
       
   345 #define freopen64	freopen
       
   346 #define fsetpos64	fsetpos
       
   347 #define tmpfile64	tmpfile
       
   348 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
   349 
       
   350 
   333 #if __ISO_C_VISIBLE >= 1999
   351 #if __ISO_C_VISIBLE >= 1999
   334 IMPORT_C int	 snprintf(char * __restrict, size_t, const char * __restrict,
   352 IMPORT_C int	 snprintf(char * __restrict, size_t, const char * __restrict,
   335 	    ...) __printflike(3, 4);
   353 	    ...) __printflike(3, 4);
   336 IMPORT_C int	 vfscanf(FILE * __restrict, const char * __restrict, va_list)
   354 IMPORT_C int	 vfscanf(FILE * __restrict, const char * __restrict, va_list)
   337 	    __scanflike(2, 0);
   355 	    __scanflike(2, 0);
   384 IMPORT_C int	 putc_unlocked(int, FILE *);
   402 IMPORT_C int	 putc_unlocked(int, FILE *);
   385 IMPORT_C int	 putchar_unlocked(int);
   403 IMPORT_C int	 putchar_unlocked(int);
   386 #endif
   404 #endif
   387 
   405 
   388 #if __POSIX_VISIBLE >= 200112
   406 #if __POSIX_VISIBLE >= 200112
   389 int	 fseeko(FILE *, __off_t, int);
   407 IMPORT_C int	 fseeko(FILE *, __off_t, int);
   390 __off_t	 ftello(FILE *);
   408 IMPORT_C __off_t	 ftello(FILE *);
       
   409 
       
   410 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
   411 #define fseeko64	fseeko
       
   412 #define ftello64	ftello
       
   413 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
   414 
   391 #endif
   415 #endif
   392 
   416 
   393 #if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600
   417 #if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600
   394 IMPORT_C int	 getw(FILE *);
   418 IMPORT_C int	 getw(FILE *);
   395 IMPORT_C int	 putw(int, FILE *);
   419 IMPORT_C int	 putw(int, FILE *);