My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
sw_syslibc.h File Reference
#include <sw_types.h>

Go to the source code of this file.

Functions

int f_open (const unsigned char *name, int flags,...)
 f_open-function shall open the file whose pathname is the string pointed to by filename, and associates a stream with it More...
 
int f_read (int file, unsigned char *ptr, int len)
 f_read - Reads an array of count elements from an inputstream More...
 
int f_write (int file, unsigned char *ptr, int len)
 f_write - Writes an array of count elements to an outputstream More...
 
long f_lseek (int file, long offset, int flags)
 f_lseek - Sets the position indicator associated with the stream to a new position More...
 
int f_close (int file)
 f_close - function will flushes the stream pointed to by filepointer More...
 
int f_remove (const char *rm_p)
 f_remove - Deletes the file whose name is specified in filename More...
 

Function Documentation

int f_close ( int  file)

f_close - function will flushes the stream pointed to by filepointer

Parameters
file- The file descriptor of the file
Returns
- If the stream is successfully closed, a zero value is returned. On failure, EOF is returned
long f_lseek ( int  file,
long  offset,
int  flags 
)

f_lseek - Sets the position indicator associated with the stream to a new position

Parameters
file- The file descriptor of the file
offset- Number of bytes to offset from origin
flags- Position used as reference for the offset value
Returns
- If successful, the function returns zero. Otherwise, it returns non-zero value
int f_open ( const unsigned char *  name,
int  flags,
  ... 
)

f_open-function shall open the file whose pathname is the string pointed to by filename, and associates a stream with it

Parameters
name- string containing the name of the file to be opened
flags- integer containing a file access mode value
....
Returns
- Upon successful completion, fopen() shall return a pointer to the object controlling the stream. Otherwise, a null pointer shall be returned
Parameters
name- string containing the name of the file to be opened
flags- integer containing a file access mode value
...
Returns
Upon successful completion, fopen() shall return a pointer to the object controlling the stream. Otherwise, a null pointer shall be returned
int f_read ( int  file,
unsigned char *  ptr,
int  len 
)

f_read - Reads an array of count elements from an inputstream

Parameters
file- The file descriptor of the file
ptr- Pointer to a block of memory with a size of at least (size*count) bytes
len- Number of elements, each one with a size of size bytes
Returns
- The total number of elements successfully read is returned if this number differs from the count parameter, either a reading error occurred or the end-of-file was reached while reading. In both cases, -1 is returned
int f_remove ( const char *  rm_p)

f_remove - Deletes the file whose name is specified in filename

Parameters
rm_p- string containing the name of the file to be deleted
Returns
- if the file is successfully deleted, a zero value is returned. On failure, a non-zero value is returned
int f_write ( int  file,
unsigned char *  ptr,
int  len 
)

f_write - Writes an array of count elements to an outputstream

Parameters
file- The file descriptor of the file
ptr- Pointer to a FILE object that specifies an output stream
len- Number of elements, each one with a size of size bytes
Returns
- The total number of elements successfully written is returned. If this number differs from the count parameter -1 is returned