Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <STDIO.H>
Link against: estlib.lib

_FSTDIO

_FSTDIO

Description

[Top]


__need_size_t

__need_size_t

Description

[Top]


__SLBF

__SLBF 0x0001

Description

[Top]


__SNBF

__SNBF 0x0002

Description

[Top]


__SRD

__SRD 0x0004

Description

[Top]


__SWR

__SWR 0x0008

Description

[Top]


__SRW

__SRW 0x0010

Description

[Top]


__SEOF

__SEOF 0x0020

Description

[Top]


__SERR

__SERR 0x0040

Description

[Top]


__SMBF

__SMBF 0x0080

Description

[Top]


__SAPP

__SAPP 0x0100

Description

[Top]


__SSTR

__SSTR 0x0200

Description

[Top]


__SOPT

__SOPT 0x0400

Description

[Top]


__SNPT

__SNPT 0x0800

Description

[Top]


__SOFF

__SOFF 0x1000

Description

[Top]


__SMOD

__SMOD 0x2000

Description

[Top]


_IOFBF

_IOFBF 0

Description

The following three definitions are for ANSI C, which took them from System V, which stupidly took internal interface macros and made them official arguments to setvbuf(FILE *,char *,int,size_t)setvbuf(FILE *,char *,int,size_t), without renaming them. Hence, these ugly _IOxxx names are *supposed* to appear in user code.

Although these happen to match their counterparts above, the implementation does not rely on that (so these could be renumbered).

[Top]


_IOLBF

_IOLBF 1

Description

[Top]


_IONBF

_IONBF 2

Description

[Top]


NULL

NULL 0L

Description

[Top]


BUFSIZ

BUFSIZ 1024

Description

[Top]


EOF

EOF (-1)

Description

[Top]


FOPEN_MAX

FOPEN_MAX 20

Description

[Top]


FILENAME_MAX

FILENAME_MAX 256

Description

[Top]


P_tmpdir

P_tmpdir "/System/temp/"

Description

[Top]


WIDEP_tmpdir

WIDEP_tmpdir L"/System/temp/"

Description

[Top]


L_tmpnam

L_tmpnam 34

Description

[Top]


SEEK_SET

SEEK_SET 0

Description

[Top]


SEEK_CUR

SEEK_CUR 1

Description

[Top]


SEEK_END

SEEK_END 2

Description

[Top]


TMP_MAX

TMP_MAX 26

Description

[Top]


stdin

stdin (__stdin())

Description

[Top]


stdout

stdout (__stdout())

Description

[Top]


stderr

stderr (__stderr())

Description

[Top]


Typedef fpos_t

typedef _fpos_t fpos_t;

Description

[Top]


Typedef FILE

typedef struct __sFILE FILE;

Description

[Top]


__stdin(void)

IMPORT_C FILE* __stdin(void);

Description

Function interface to the "constants" stdin. These functions guarantee to return a fixed value, so that it will be possible to use expressions such as if (fp != stdout) fclose(fp); with complete confidence. Unfortunately it will rule out initialising global variables with stdin/stdout/stderr, as in the common idiom:

static FILE *log = stderr;

This isn't currently possible with EPOC32.

Return value

__sFILE__sFILE *

[Top]


__stdout(void)

IMPORT_C FILE* __stdout(void);

Description

Function interface to the "constants" stdout See __stdin

Return value

__sFILE__sFILE *

[Top]


__stderr(void)

IMPORT_C FILE* __stderr(void);

Description

Function interface to the "constants" stderr See __stdin

Return value

__sFILE__sFILE *

[Top]


tmpfile(void)

IMPORT_C FILE* tmpfile(void);

Description

Open a temporary file. Creates a temporary binary file for update. The filename is unique to avoid any conflict with existing files.

Return value

__sFILE__sFILE *

file pointer (stream) to the temporary file created. If the file can not be created a NULL pointer is returned.

[Top]


tmpnam(char *)

IMPORT_C char* tmpnam(char *);

Description

Generate a unique temporary filename.

Parameters

char *

Pointer to an array of bytes, where the proposed tempname will be stored.

Return value

char *

A pointer to the string containing the proposed name for a temporary file. If NULL was specified as the buffer this points to an internal buffer that will be overwritten the next time this function is called, otherwise it returns the buffer parameter. If an error occurs this function returns NULL.

[Top]


wtmpnam(wchar_t *)

IMPORT_C wchar_t* wtmpnam(wchar_t *);

Description

Parameters

wchar_twchar_t *

Return value

wchar_twchar_t *

[Top]


fclose(FILE *)

IMPORT_C int fclose(FILE *);

Description

Close a stream. Close the file associated with the specified stream after flushing all buffers associated with it.

Parameters

__sFILE__sFILE *

Pointer to FILE structure specifying the stream to be closed.

Return value

int

If the stream is successfully closed 0 is returned. If any error EOF is returned.

[Top]


fflush(FILE *)

IMPORT_C int fflush(FILE *);

Description

Flush a stream. If the given stream has been opened for writing operations the output buffer is phisically written to the file. If the stream was open for reading operations the content of the input buffer is cleared. The stream remains open after this call.

Parameters

__sFILE__sFILE *

pointer to an open file.

Return value

int

On Success, a 0 value indicates success. On Failure, EOF is returned and errno may be set.

[Top]


freopen(const char *,const char *,FILE *)

IMPORT_C FILE* freopen(const char *, const char *, FILE *);

Description

Reopen a stream with a different file and mode.

Parameters

const char *

name of the file to be opened. This paramenter must follow operating system's specifications and can include a path if the system supports it.

const char *

type of access requested.

__sFILE__sFILE *

pointer to open file that has to be reopened.

Return value

__sFILE__sFILE *

If the file has been succesfully reopened the function returns a pointer to the file. Otherwise a NULL pointer is returned.

[Top]


wfreopen(const wchar_t *,const wchar_t *,FILE *)

IMPORT_C FILE* wfreopen(const wchar_t *, const wchar_t *, FILE *);

Description

Parameters

const wchar_twchar_t *

const wchar_twchar_t *

__sFILE__sFILE *

Return value

__sFILE__sFILE *

[Top]


setbuf(FILE *,char *)

IMPORT_C void setbuf(FILE *, char *);

Description

Change stream buffering. Changes the buffer used for I/O operations with the specified stream, or, if the specified buffer is NULL it disables buffering with the stream. This function should be called once the file associated with the stream has been opened but before any input or output operation has been done. With buffered streams writing operations do not write directly to the device associated with them; the data is accumulated in the buffer and written to the device as a block. All buffers are also flushed when program terminates.

Parameters

__sFILE__sFILE *

pointer to an open file.

char *

UserUser allocated buffer. Must have a length of BUFSIZ bytes.

[Top]


setvbuf(FILE *,char *,int,size_t)

IMPORT_C int setvbuf(FILE *, char *, int, size_t);

Description

Change stream buffering. Changes the buffer to be used for I/O operations with the specified stream. Size and mode for the buffer can be specified. This function should be called once the file associated with the stream has been opened but before any input or output operation has been done. The size of the buffer is specified by the size parameter, and can be any value between 2 and 32767 in bytes, this value may be rounded down by some system due to specific alignment. buffer can be NULL.

Parameters

__sFILE__sFILE *

pointer to an open file.

char *

UserUser allocated buffer. Must have at least a size of size bytes.

int

Specifies a mode for file buffering

size_tsize_t

Return value

int

If the buffer is correctly assigned to the file a 0 value is returned. On error, a non-zero value is returned. This can be because an invalid type or size has been specified or because an error allocating memory (if NULL buffer was specified).

[Top]


fprintf(FILE *,const char *,...)

IMPORT_C int fprintf(FILE *, const char *,...);

Description

Print formatted data to a stream. Prints to the specified stream a sequence of arguments formatted as the format argument specifies.

Parameters

__sFILE__sFILE *

Pointer to an open file.

const char *

String that contains the text to be printed.

...

Return value

int

On success, the total number of characters printed is returned. On error, a negative number is returned.

[Top]


fscanf(FILE *,const char *,...)

IMPORT_C int fscanf(FILE *, const char *,...);

Description

Read formatted data from a stream. Reads data from the current position of stream and stores it into the locations given by argument(s). Locations pointed by each argument are filled with their corresponding type of value requested in the format string. There must be the same number of type specifiers in format string than arguments passed.

Parameters

__sFILE__sFILE *

Pointer to an open file.

const char *

String that can contain one or more of these item: Whitespace characters: the function will read and ignore any whitespace characters (this includes blank, newline and tab characters) encountered before the next non-whitespace character. This includes any quantity of whitespace characters (including none). Non-whitespace characters (any character not including blank, newline, tab, or any format specifier begining with character): this cause that the function read and discard any character that match the given non-whitespace character. If this character is not found the function ends returning error.

...

Return value

int

The number of items succesfully read.

[Top]


printf(const char *,...)

IMPORT_C int printf(const char *,...);

Description

Print formatted data to stdout. Prints to standard output a sequence of arguments formatted as the format argument specifies.

Parameters

const char *

String that contains the text to be printed. Optionally it can contain format tags that are substituted by the values specified in subsequent argument(s) and formatted as requested.

...

Return value

int

On success, the total number of characters printed is returned. On error, a negative number is returned.

[Top]


scanf(const char *,...)

IMPORT_C int scanf(const char *,...);

Description

Read formatted data from standard input. Reads data from the standard input and stores it into the locations given by argument(s).

Parameters

const char *

String that can contain one or more of these items: Whitespace characters: the function will read and ignore any whitespace characters (this includes blank, newline and tab characters) encountered before the next non-whitespace character. This includes any quantity of whitespace characters (including none). Non-whitespace characters (any character not including blank, newline, tab, or any format specifier begining with character): this cause that the function read and discard any character that match the given non-whitespace character. If this character is not found the function ends returning error.

...

Return value

int

On Success, the number of items succesfully read. On Failure, EOF is returned and errno may be set.

[Top]


sscanf(const char *,const char *,...)

IMPORT_C int sscanf(const char *, const char *,...);

Description

Read formatted data from string. Reads data from the buffer specified and stores it into the locations given by argument(s). Locations pointed by each argument are filled with their corresponding type of value requested in the format string.

Parameters

const char *

Buffer containing the string to be parsed for data.

const char *

String that can contain one or more of these items: Whitespace characters: the function will read and ignore any whitespace characters (this includes blank, newline and tab characters) encountered before the next non-whitespace character. This includes any quantity of whitespace characters (including none). On-whitespace characters (any character not including blank, newline, tab, or any format specifier begining with character): this cause that the function read and discard any character that match the given non-whitespace character. If this character is not found the function ends returning error. Format specifiers: A sequence of characters begining with '%' indicates that next data has to be readed and stored at the location pointed by its corresponding argument with a given format that is specified following this prototype: [*][width][modifiers]type

...

Return value

int

On Success, The number of items succesfully read. This count doesn't include any ignored fields. On Failure, returns EOF, if an error has occurred before the first assignation could be done and errno may be set.

[Top]


vfprintf(FILE *,const char *,__e32_va_list)

IMPORT_C int vfprintf(FILE *, const char *, __e32_va_list);

Description

Parameters

__sFILE__sFILE *

const char *

__e32_va_list__e32_va_list

Return value

int

[Top]


vprintf(const char *,__e32_va_list)

IMPORT_C int vprintf(const char *, __e32_va_list);

Description

Parameters

const char *

__e32_va_list__e32_va_list

Return value

int

[Top]


vsprintf(char *,const char *,__e32_va_list)

IMPORT_C int vsprintf(char *, const char *, __e32_va_list);

Description

Parameters

char *

Buffer where to store the resulting formatted string.

const char *

String that contains the text to be printed.

__e32_va_list__e32_va_list

Return value

int

On Success, the total number of characters printed is returned. On Failure, a negative number is returned.

[Top]


fgetc(FILE *)

IMPORT_C int fgetc(FILE *);

Description

Get the next character from a stream. Returns the next character of the stream and increases the file pointer to point to the following one.

Parameters

__sFILE__sFILE *

pointer to an open file.

Return value

int

The character read is returned as an int value. If the End Of File has been reached or there has been an error reading, the function returns EOF.

[Top]


fgets(char *,int,FILE *)

IMPORT_C char* fgets(char *, int, FILE *);

Description

Get a string from a stream.

Parameters

char *

pointer to a buffer where to store data read.

int

max number of bytes to be read.

__sFILE__sFILE *

pointer to an open file.

Return value

char *

On success, the string read is returned. On end-of-file or error, null pointer is returned.

[Top]


fputc(int,FILE *)

IMPORT_C int fputc(int, FILE *);

Description

Write character to stream.

Parameters

int

Character to be written. The function casts the int parameter to its unsigned char equivalent before writing it.

__sFILE__sFILE *

pointer to an open file.

Return value

int

If there are no errors the written character is returned. If an error occurs, EOF is returned.

[Top]


fputs(const char *,FILE *)

IMPORT_C int fputs(const char *, FILE *);

Description

Write string to a stream. Writes string to the current position of the given stream. On error the function returns EOF.

Parameters

const char *

Null-terminated string to be written.

__sFILE__sFILE *

pointer to an open file.

Return value

int

[Top]


getc(FILE *)

IMPORT_C int getc(FILE *);

Description

Parameters

__sFILE__sFILE *

Return value

int

[Top]


getchar(void)

IMPORT_C int getchar(void);

Description

Get the next character from stdin.Returns the next character from the standard input.

Return value

int

On Success, the character read is returned as an int. On Failure, returns EOF, if the 'End Of File' is reached or there has been an error reading and errno may be set.

[Top]


gets(char *)

IMPORT_C char* gets(char *);

Description

Get a string from stdin. Reads characters from stdin and stores them into buffer until a newline ( ) or EOF character is encountered.

Parameters

char *

Return value

char *

On success, the buffer parameter is returned. On end-of-file or error, a null pointer is returned.

[Top]


putc(int,FILE *)

IMPORT_C int putc(int, FILE *);

Description

Parameters

int

__sFILE__sFILE *

Return value

int

[Top]


putchar(int)

IMPORT_C int putchar(int);

Description

Write character to standard output. Writes character to the current position in the standard output and increases the file pointer to point to next character. This routine cooresponds to: putc(character,stdout).

Parameters

int

Character to be written.

Return value

int

On Success, returns the written character. On Failure, EOF is returned and errno may be set.

[Top]


puts(const char *)

IMPORT_C int puts(const char *);

Description

Outputs a string to stdout. Copies the string to standard output stream and appends a new line character ( ).

Parameters

const char *

Return value

int

On Success, a non-negative value is returned. On Failure, EOF value is returned and errno may be set.

[Top]


ungetc(int,FILE *)

IMPORT_C int ungetc(int, FILE *);

Description

Parameters

int

__sFILE__sFILE *

Return value

int

[Top]


fread(void *,size_t,size_t,FILE *)

IMPORT_C size_t fread(void *, size_t _size, size_t _n, FILE *);

Description

Read block of data from a stream. Read count number of items each one with a size of size bytes from the stream and stores it in the specified buffer. Stream's postion indicator is increased by the number of bytes readed. Total amount of bytes read is (size x count).

Parameters

void *

Pointer to the destination structure with a minimum size of (size*count) bytes.

size_tsize_t _size

Size in bytes of each item to be read.

size_tsize_t _n

Number of items, each one with a size of size bytes.

__sFILE__sFILE *

pointer to an open file.

Return value

size_tsize_t

The total number of items readed is returned.

[Top]


fwrite(const void *,size_t,size_t,FILE *)

IMPORT_C size_t fwrite(const void *, size_t _size, size_t _n, FILE *);

Description

Parameters

const void *

size_tsize_t _size

size_tsize_t _n

__sFILE__sFILE *

Return value

size_tsize_t

[Top]


fgetpos(FILE *,fpos_t *)

IMPORT_C int fgetpos(FILE *, fpos_t *);

Description

Get position in a stream.

Parameters

__sFILE__sFILE *

pointer to an open file.

fpos_tfpos_t *

pointer to a fpos_t object where the position will be stored.

Return value

int

0 value indicates success. non-zero value indicates error.

[Top]


fseek(FILE *,long,int)

IMPORT_C int fseek(FILE *, long, int);

Description

Parameters

__sFILE__sFILE *

long

int

Return value

int

[Top]


fsetpos(FILE *,const fpos_t *)

IMPORT_C int fsetpos(FILE *, const fpos_t *);

Description

Reposition file pointer to a saved location.

Parameters

__sFILE__sFILE *

Pointer to an open file.

const fpos_tfpos_t *

Position value obtained from a previous call to fgetpos that indicates the position of the file pointer at that moment.

Return value

int

If successful the function returns 0. Otherwise it returns nonzero and sets the global variable errno to a non-zero value.

[Top]


ftell(FILE *)

IMPORT_C long ftell(FILE *);

Description

Return the current position in a stream. Returns the current position pointed by the position indicator of the stream. When a file has been opened in binary mode the value obtained corresponds to the number of bytes from the beginning of the file. In files opened in text-mode this is not granted because of carriage-return translations under that mode.

Parameters

__sFILE__sFILE *

Return value

long

On success, the current file pointer position is returned. If an error occurs -1 is returned.

[Top]


rewind(FILE *)

IMPORT_C void rewind(FILE *);

Description

Repositions the file pointer to the beginning of a stream. Sets the file pointer associated with the stream to the beginning of the file.

Parameters

__sFILE__sFILE *

[Top]


clearerr(FILE *)

IMPORT_C void clearerr(FILE *);

Description

Reset error indicators. Reset error and EOF indicators of the given stream.

Parameters

__sFILE__sFILE *

pointer to an open file.

[Top]


feof(FILE *)

IMPORT_C int feof(FILE *);

Description

Check if End Of File has been reached.

Parameters

__sFILE__sFILE *

pointer to an open file.

Return value

int

A non-zero value is returned in the case that the position indicator reached the End Of File in the last input operation with the specified stream, otherwise 0 is returned.

[Top]


ferror(FILE *)

IMPORT_C int ferror(FILE *);

Description

Check for errors.

Parameters

__sFILE__sFILE *

Return value

int

If there were no errors a 0 value is returned. Otherwise a non-zero value is returned .

[Top]


perror(const char *)

IMPORT_C void perror(const char *);

Description

Parameters

const char *

[Top]


fopen(const char *,const char *)

IMPORT_C FILE* fopen(const char *_name, const char *_type);

Description

Open a file. Opens the file which name is stored in the filename string and returns a pointer to the file (stream). Operations allowed to the file returned are defined by the mode parameter.

Parameters

const char *_name

name of the file to be opened. This paramenter must follow operating system's specifications and can include a path if the system supports it.

const char *_type

type of access requested

Return value

__sFILE__sFILE *

If the file has been succesfully opened the function will return a pointer to the file. Otherwise a NULL pointer is returned.

[Top]


wfopen(const wchar_t *,const wchar_t *)

IMPORT_C FILE* wfopen(const wchar_t *_name, const wchar_t *_type);

Description

Parameters

const wchar_twchar_t *_name

const wchar_twchar_t *_type

Return value

__sFILE__sFILE *

[Top]


sprintf(char *,const char *,...)

IMPORT_C int sprintf(char *, const char *,...);

Description

Print formatted data to a string. Writes a sequence of arguments to the given buffer formatted as the format argument specifies.

Parameters

char *

Buffer where to store the resulting formatted string.

const char *

String that contains the text to be printed.

...

Return value

int

On Success, the total number of characters printed is returned. On Failure, a negative number is returned.

[Top]


fileno(FILE *)

IMPORT_C int fileno(FILE *);

Description

Routines in POSIX 1003.1.

Parameters

__sFILE__sFILE *

Return value

int

[Top]


fdopen(int,const char *)

IMPORT_C FILE* fdopen(int, const char *);

Description

This function associates a stream with an open file descriptor. A stream is a pointer to a FILE structure that contains information about a file. A stream permits user-controlled buffering and formatted input and output.

Parameters

int

The open file descriptor on which to open a stream.

const char *

The access mode for the stream.

Return value

__sFILE__sFILE *

a FILE pointer to the control block for the new stream.

[Top]


wfdopen(int,const wchar_t *)

IMPORT_C FILE* wfdopen(int, const wchar_t *);

Description

A wide-character version of fdopen(int,const char *)fdopen(int,const char *)

Parameters

int

const wchar_twchar_t *

Return value

__sFILE__sFILE *

[Top]


_cleanup(void)

IMPORT_C void _cleanup(void);

Description

Performs cleanup

[Top]


popen3(const char *,const char *,char **,int)

IMPORT_C int popen3(const char *cmd, const char *mode, char **envp, int fids[3]);

Description

Gives access to the client's stdin.

Parameters

const char *cmd

const char *mode

char **envp

int fids

Return value

int

On Success, returns a pointer to an open stream, used to read or write to the pipe. On Failure, return a null pointer.

[Top]


wpopen3(const wchar_t *,const wchar_t *,wchar_t **,int)

IMPORT_C int wpopen3(const wchar_t *cmd, const wchar_t *mode, wchar_t **envp, int fids[3]);

Description

A wide-character version of popen3(const char *,const char *,char **,int)popen3(const char *,const char *,char **,int).

Parameters

const wchar_twchar_t *cmd

const wchar_twchar_t *mode

wchar_twchar_t **envp

int fids

Return value

int