Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

stdio.h File Reference


Detailed Description

File and other IO functions.

This library contains functions for file system operations and formatting input and output data. The file system has been adapted from TINI's Java Runtime Environment to be able to be called from a C program.

The file system must reside in contiguous memory. Pages in the file system are 256-byte blocks (on 256-byte boundaries).

Maximum File System Size

The maximum size(15MB), of the file system is likely to be far beyond the needs of most/any applications. The file system's memory manager has several overhead blocks used to maintain information on block allocation. The number of overhead blocks cannot exceed 255 blocks (65280 bytes).

Overhead Bytes

Assuming we use the usual 'numfd' vlaue of 8 open file descriptors, 65280-(11*256)-5-(8*26) = 62251 max bytes are available for a free list. This yields a maximimum file system size of just over 15MB, although not all the space can be utilized by file data due to file system overhead.

Example of File System Memory Usage: 64KB Available

We have 64KB of memory available for file system space and we use 'numfd' of 8 open file descriptors, that is 256 blocks of size 256 bytes. Initalized via finit(8, 256, start_address). To determine the amount of data space this allows we subtract the overhead blocks from 64KB 65536-(11*256)-5-(8*26) leaving 62507 bytes for the free list and the file data. We need 1 byte per free page, so 62507/256 = 244.16 means one page/block is needed to hold the free list, leaving us with 243 blocks for file system data. 243 blocks is 62208 bytes of available file space, but not all can be used due to internal fragmentation of the file system. File system sectors are allocated in 768 bytes chunks with 512 bytes of data and 256 bytes of filesystem overhead. So the maximum useable file space is (62208/768)*512 = 41472 bytes.

Example of File System Memory Usage: 128KB of Storage Required

Our application requires that we have 128KB of file system space. Again we will use 8 open file descriptors. 128KB normaly means 131072 bytes. Due to internal fragmentation we require (131072/512)*768 = 196608 bytes. This means we require 768 free blocks of file space. 768 blocks require 3 blocks for the free list. As previously the 5 magic bytes and the open file descriptor space come to 213 bytes, this equates to 1 block. 768+11+3+1 = 783. To initalize the file system for our requirements: finit(8, 783, start_address).

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

Warning:
Some functions in this library are NOT multi-process safe--that is, if you call the same method from two different processes at the same time, the parameters to the function may be destroyed, yielding unpredictable results. Consult each individual funtion's documentation for details on which functions are multi-process safe.

#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  file_structure

Defines

#define FS_VERSION   10
#define NULL   ((void *) 0)
#define FILE_FLAGS_EOF   1
#define FILE_FLAGS_TEMP   2
#define FILE_TYPE_TINIFS   1
#define FILENAME_MAX   255
#define FOPEN_MAX   8
#define L_tmpnam   20
#define SEEK_CUR   0x5555
#define SEEK_END   0x5556
#define SEEK_SET   0x5557
#define TMP_MAX   10
#define EOF   -1
#define P_tmpdir   "temp"

Typedefs

typedef unsigned int size_t
typedef unsigned int off_t
typedef long fpos_t
typedef file_structure FILE

Functions

void clearerr (FILE *f_handle)
 Clear the error indicators for a file stream.
int fclose (FILE *f_handle)
 Closes the file stream.
int feof (FILE *f_handle)
 Checks to see if this stream has reached the end of the file.
int ferror (FILE *f_handle)
 Gets the error indicator for the file stream.
int fgetc (FILE *f_handle)
 Gets the next unsigned character from the file stream.
int fgetpos (FILE *f_handle, fpos_t *position)
 Gets the current value of the file position indicator.
char * fgets (char *string, int num, FILE *f_handle)
 Reads a string from the file stream.
FILEfopen (const char *filename, const char *mode)
 Opens the specified file.
int fputc (int ch, FILE *f_handle)
 Writes a character to a file stream.
int fputs (const char *str, FILE *f_handle)
 Writes a string to a file stream.
size_t fread (void *ptr, size_t size, size_t num, FILE *f_handle)
 Read a number of bytes from a file stream.
FILEfreopen (const char *newfilename, const char *mode, FILE *old_handle)
 Associates an open stream with a different file.
int fseek (FILE *f_handle, long int offset, int tag)
 Sets the file position indicator.
int fseeko (FILE *f_handle, off_t offset, int tag)
 Sets the file position indicator.
int fsetpos (FILE *f_handle, const fpos_t *position)
 Sets the file position indicator.
long ftell (FILE *f_handle)
 Gets the file position indicator.
off_t ftello (FILE *f_handle)
 Gets the file position indicator.
void flockfile (FILE *f_handle)
 Gets exclusive access to a file.
int ftrylockfile (FILE *f_handle)
 Tries to get exclusive accress to a file.
void funlockfile (FILE *f_handle)
 Release exclusive access on a file.
size_t fwrite (const void *ptr, size_t size, size_t num, FILE *f_handle)
 Write a number of bytes to a file stream.
int getc (FILE *f_handle)
 Gets the next unsigned character from the file stream.
int putc (int value, FILE *f_handle)
 Writes a character to a file stream.
int remove (const char *filename)
 Removes a file from the file system.
int rename (const char *oldname, const char *newname)
 Renames a file.
void rewind (FILE *f_handle)
 Resets the file position indicator for a stream.
char * tempnam (const char *dirname, const char *pfx)
 Generates a path/filename that can be used for a temporary file.
FILEtmpfile (void)
 Generates a stream to a temporary file.
char * tmpnam (char *nametarget)
 Generates a uniqe temporary filename.
int fflush (FILE *f_handle)
 Flushes the buffers for a file stream.
int fcleaninit (char numfd, int numblocks, void *start_address)
 Initializes the file system to a blank state.
int finit (char numfd, int numblocks, void *start_address)
 Initializes the file system.
int fexists (char *filename)
 Tests for the existence of a file.
void * fopen_fd (const char *filename, const char *mode)
 Helper function that opens a file descriptor.
unsigned int freadbytes (void *buffer, int length, FILE *stream)
 Reads bytes into a buffer from a file stream.
unsigned int fwritebytes (void *buffer, int length, FILE *stream)
 Writes bytes to a file stream.
unsigned long getfreefsram ()
 Gets the amount of free space in the file system.
int mkdir (char *dirname)
 Creates a directory.
char _getkey (void)
 Keil-provided function.
char getchar (void)
 Keil-provided function.
char ungetchar (char)
 Keil-provided function.
char putchar (char)
 Keil-provided function.
int printf (const char *,...)
 Keil-provided function.
int sprintf (char *, const char *,...)
 Keil-provided function.
int vprintf (const char *, char *)
 Keil-provided function.
int vsprintf (char *, const char *, char *)
 Keil-provided function.
char * gets (char *, int n)
 Keil-provided function.
int scanf (const char *,...)
 Keil-provided function.
int sscanf (char *, const char *,...)
 Keil-provided function.
int puts (const char *)
 Keil-provided function.
unsigned int filesystem_version (void)
 Returns the version number of this file system library.


Define Documentation

#define EOF   -1
 

Define for end-of-file.

#define FILE_FLAGS_EOF   1
 

Definition for file flag. Denotes that the end of the file has been reached for this file.

See also:
FILE

#define FILE_FLAGS_TEMP   2
 

Definition for file flag. Denotes that this is a temporary file.

See also:
FILE

#define FILE_TYPE_TINIFS   1
 

Type for the file. Currently, this file system only supports the TINI File System type.

See also:
FILE

#define FILENAME_MAX   255
 

Maximum size in bytes of the longest filename string that the implementation guarantees can be opened.

See also:
fopen

#define FOPEN_MAX   8
 

Number of streams which the implementation guarantees can be open simultaneously.

See also:
fopen

#define FS_VERSION   10
 

Version number associated with this header file. Should be the same as the version number returned by the filesystem_version function.

See also:
filesystem_version

#define L_tmpnam   20
 

Maximum size of character array to hold tmpnam output.

See also:
tmpnam

#define NULL   ((void *) 0)
 

Definition for a null pointer.

#define P_tmpdir   "temp"
 

Default directory that temporary file names will be built into.

See also:
tmpnam

#define SEEK_CUR   0x5555
 

Seek offset is from the current location in the file.

Warning:
Option currently not supported.
See also:
fseek

fseeko

#define SEEK_END   0x5556
 

Seek offset is from the end of the file.

Warning:
Option currently not supported.
See also:
fseek

fseeko

#define SEEK_SET   0x5557
 

Seek offset is from the beginning of the file.

See also:
fseek

fseeko

#define TMP_MAX   10
 

Maximum number of guaranteed unique file names that can be created by the tmpnam function.

See also:
tmpnam


Typedef Documentation

typedef struct file_structure FILE
 

Type definition for a C file object.

typedef long fpos_t
 

Type definition for the position in a file.

typedef unsigned int off_t
 

Type definition for the offset in a file.

typedef unsigned int size_t
 

Type definition for the amount of data to be written or read.


Function Documentation

char _getkey void   ) 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

void clearerr FILE f_handle  ) 
 

Clear the error indicators for a file stream.

Clears the error and end-of-file indicators for a file stream.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle file handle to file to clear error flag for

int fcleaninit char  numfd,
int  numblocks,
void *  start_address
 

Initializes the file system to a blank state.

Initializes the file system. This method (or finit) must be called every time the DS80C400 boots up and wants to use the file system. Starts with a blank file system automatically.

Note that the init_rom function must be called before the file system is initialized.

This function is safe to be called from multiple processes at the same time.

Parameters:
numfd Maximum number of file descriptors that can be open at one time in the system.
numblocks Number of 256-byte blocks available to the file system.
start_address Starting address of the memory allocated for the file system. The bounds of the memory allocated for the file system are then from start_address to (start_address + 256 * numblocks + File System and Memory Manager overhead). Refer to top of this file for examples of file system memory usage.
Returns:
Non-zero, since the file system memory had to be erased.
See also:
init_rom [in the initialization library]

finit

int fclose FILE f_handle  ) 
 

Closes the file stream.

Closes the stream associated with f_handle. In the TINI File System, there are no buffers, so this function has nothing to flush before closing.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of file to close
Returns:
Always 0
See also:
fopen

int feof FILE f_handle  ) 
 

Checks to see if this stream has reached the end of the file.

Tests the end-of-stream indicator for this file stream.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle to file to check end-of-file condition for
Returns:
Non-zero if the end of the file has been reached, otherwise 0

int ferror FILE f_handle  ) 
 

Gets the error indicator for the file stream.

Gets the current error indicator for the file stream.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle to file to get current error code for
Returns:
Current error code for file denoted by f_handle. 0 means no error.

int fexists char *  filename  ) 
 

Tests for the existence of a file.

Checks to see if the file filename exists in this file system.

This function is safe to be called from multiple processes at the same time.

Parameters:
filename File to check for the existence of.
Returns:
0 if the file exists, non-zero if it does not exist.

int fflush FILE f_handle  ) 
 

Flushes the buffers for a file stream.

The TINI File System has no buffers (data is read and written directly on the file system, since it resides in XDATA). Therefore, this function only clears the error flag.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle File handle to flush output buffers for
Returns:
0 on success.

int fgetc FILE f_handle  ) 
 

Gets the next unsigned character from the file stream.

Returns the next unsigned character (if available) from the file stream (converted to an int), advancing the file position pointer.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of the file we will read from
Returns:
The next character from the file, or EOF if the end of file has been reached
See also:
getc

feof

fputc

int fgetpos FILE f_handle,
fpos_t position
 

Gets the current value of the file position indicator.

Puts the current value of the file position indicator into the location position. The value in position after the function call is to be used for resetting the stream to this position using a later call to fsetpos.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
f_handle handle to file to get current position for
position pointer to location for position information
Returns:
Always 0
See also:
fsetpos

ftell

char* fgets char *  string,
int  num,
FILE f_handle
 

Reads a string from the file stream.

Reads at most num-1 characters from the file stream. Will not return any data read after a newline character (which is included) or the end of the file. A null character is appended to the data read.

Note that the implementation of this method is not efficient. For more efficient reading of data, use the fread function.

This function is safe to be called from multiple processes at the same time.

Parameters:
string buffer to write string data to
num read a maximum of (num-1) bytes, leaving 1 for a terminating 0
f_handle handle to file to read from
Returns:
Input pointer string, or NULL if EOF or errors were encountered. Data will be written as 0-terminated string to string
See also:
fread

fputs

feof

unsigned int filesystem_version void   ) 
 

Returns the version number of this file system library.

Returns:
Version number of this FILESYSTEM library.

int finit char  numfd,
int  numblocks,
void *  start_address
 

Initializes the file system.

Initializes the file system. This method (or fcleaninit) must be called every time the DS80C400 boots up and wants to use the file system. If the file system does not exist or is corrupted, it will erase and start with a blank file system. Also, if any of the parameters given to finit do not match how the file system was previously initialized, the file system will erase and start blank.

Note that the init_rom function must be called before the file system is initialized.

This function is safe to be called from multiple processes at the same time.

Parameters:
numfd Maximum number of file descriptors that can be open at one time in the system.
numblocks Number of 256-byte blocks available to the file system.
start_address Starting address of the memory allocated for the file system. The bounds of the memory allocated for the file system are then from start_address to (start_address + 256 * numblocks + File System and Memory Manager overhead). Refer to top of this file for examples of file system memory usage.
Returns:
0 if the file system previously existed and was restored. Non-zero if the file system memory had to be erased.
See also:
init_rom [in the initialization library]

fcleaninit

void flockfile FILE f_handle  ) 
 

Gets exclusive access to a file.

Sleeps until exclusive access to a file is available. Note that locks cannot be nested. A nested lock will be released on the very first call to funlockfile, and not the matching call.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of file to acquire exclusive access for
See also:
ftrylockfile

funlockfile

FILE* fopen const char *  filename,
const char *  mode
 

Opens the specified file.

Opens the file specified and associates a stream with it. Files can be opened in read, write, or append mode.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
filename name of the file to get a handle for
mode - If mode[0] == 'r', open a reading file stream. If mode[0] == 'a', open a writing stream for appending. If mode[0] == 'w', open a writing stream for a blank file.
Returns:
handle to the file, or NULL on failure
See also:
freopen

fclose

void* fopen_fd const char *  filename,
const char *  mode
 

Helper function that opens a file descriptor.

Helper function that opens a file descriptor. File descriptors are not immediately useful to any C library function. Applications should use the fopen function to open a file.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
filename Name of the file to get a descriptor for. The data pointed to by filename must stay consistent for the duration of the use of the file descriptor. The fopen method avoids this limitation by creating a copy of the name data.
mode Read/Write/Append mode string
Returns:
pointer to a file descriptor
See also:
fopen

int fputc int  ch,
FILE f_handle
 

Writes a character to a file stream.

Writes the specified character (converted from an int) to a file stream, advancing the file position indicator.

This function is safe to be called from multiple processes at the same time.

Parameters:
ch character that will be written to the file f_handle
f_handle handle of the file we will write character to
Returns:
Character written if successful, else EOF
See also:
fgetc

putc

int fputs const char *  str,
FILE f_handle
 

Writes a string to a file stream.

Writes a null-terminated string to a file stream. The terminating character is not written.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
str null-terminated string to write to a file
f_handle handle to file to write string to
Returns:
number of bytes written, or EOF on failure
See also:
fgets

fwrite

size_t fread void *  ptr,
size_t  size,
size_t  num,
FILE f_handle
 

Read a number of bytes from a file stream.

Reads a block of data from a file stream. This function allows you to read num elements of size size. However, note that this function always behaves as if it had been called by:

       fread(ptr, 1, size*num, f_handle);
 

This function is safe to be called from multiple processes at the same time.

Parameters:
ptr pointer to buffer to read data into
size size of each element to be read
num number of elements to read
f_handle handle to file to read from
Returns:
number of elements read
See also:
fgetc

fwrite

unsigned int freadbytes void *  buffer,
int  length,
FILE stream
 

Reads bytes into a buffer from a file stream.

Reads a specified number of bytes into a buffer from a file stream. This function is used by fread as a helper function. It may safely be used from user applications, although it is not a standard file reading function (is not part of an ANSI-C standard library).

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
buffer Location to read data into
length Number of bytes to read
stream File to read data from
Returns:
Number of bytes read, or EOF if the end of file is reached.
See also:
fread

fwritebytes

FILE* freopen const char *  newfilename,
const char *  mode,
FILE old_handle
 

Associates an open stream with a different file.

Closes the file associated with old_handle and opens a stream to the file newfilename.

This function is safe to be called from multiple processes at the same time.

Parameters:
newfilename name of file to open
mode mode to open newfilename in (see fopen for details)
old_handle file handle to flush and close
Returns:
Handle to file newfilename, or NULL if the file could not be opened.
See also:
fopen

fclose

int fseek FILE f_handle,
long int  offset,
int  tag
 

Sets the file position indicator.

Sets the file position indicator for a file stream. Note that the only currently supported value for tag is SEEK_SET, meaning that the value offset wil always be interpreted as the offset from the beginning of the file.

After a call to fseek, the end-of-file indicator for the file stream is reset.

This function behaves the same as fseeko. The only difference is that fseeko accepts an offset parameter of type off_t.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
f_handle handle of file to set posision for
offset offset to set for file position
tag only SEEK_SET is supported
Returns:
Always 0.
See also:
ftell

fseeko

fsetpos

int fseeko FILE f_handle,
off_t  offset,
int  tag
 

Sets the file position indicator.

Sets the file position indicator for a file stream. Note that the only currently supported value for tag is SEEK_SET, meaning that the value offset wil always be interpreted as the offset from the beginning of the file.

After a call to fseeko, the end-of-file indicator for the file stream is reset.

This function behaves the same as fseek. The only difference is that fseek accepts an offset parameter of type long int.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of file to set posision for
offset offset to set for file position
tag only SEEK_SET is supported
Returns:
Always 0.
See also:
ftello

fseek

fsetpos

int fsetpos FILE f_handle,
const fpos_t position
 

Sets the file position indicator.

Sets a stream's file position indicator from the position information pointed to by position. The value in position should have been obtained by a call to fgetpos. If successful, this function will also clear the end-of-file indicator for the stream.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
f_handle handle of file we will set the position for
position position in the file to set
Returns:
Always 0
See also:
fgetpos

fseek

long ftell FILE f_handle  ) 
 

Gets the file position indicator.

Gets the file position indicator for the specified file. This is the number of characters from the beginning of the file.

This function behaves the same as ftello. The only difference is that ftello returns a value of type off_t.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of file to get current position of
Returns:
Current position in file, or -1L on failure.
See also:
fseek

ftello

fgetpos

off_t ftello FILE f_handle  ) 
 

Gets the file position indicator.

Gets the file position indicator for the specified file. This is the number of characters from the beginning of the file.

This function behaves the same as ftell. The only difference is that ftell returns a value of type long.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of file to get current position of
Returns:
Current position in file, or -1L on failure.
See also:
fseek

ftello

fgetpos

int ftrylockfile FILE f_handle  ) 
 

Tries to get exclusive accress to a file.

Obtains exclusive access to a file if it is available. Otherwise, returns without waiting for exclusive access. Note that locks cannot be nested. A nested lock will be released on the very first call to funlockfile, and not the matching call.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle to file we will try to get exclusive access to
Returns:
0 if the file was locked, non-zero if someone else has the lock
See also:
flockfile

funlockfile

void funlockfile FILE f_handle  ) 
 

Release exclusive access on a file.

Releases exclusive access that was earlier acquired on this file using flockfile or ftrylockfile. Note that locks cannot be nested. This function will release all locks that the current thread/process have on the file.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle to file to release exclusive access for
See also:
flockfile

ftrylockfile

size_t fwrite const void *  ptr,
size_t  size,
size_t  num,
FILE f_handle
 

Write a number of bytes to a file stream.

Writes a block of data to a file stream. This function allows you to write num elements of size size. However, note that this function always behaves as if it had been called by:

       fwrite(ptr, 1, size*num, f_handle);
 

This function is safe to be called from multiple processes at the same time.

Parameters:
ptr pointer to buffer of data to be written
size size of each element to be written
num number of elements to write
f_handle handle to file to write to
Returns:
number of elements written
See also:
fputc

fread

unsigned int fwritebytes void *  buffer,
int  length,
FILE stream
 

Writes bytes to a file stream.

Writes the specified number of bytes to a file stream. This function is used by fwrite as a helper function. It may safely be used from user applications, although it is not a standard file writing function (is not part of an ANSI-C standard library).

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
buffer Location to write data from
length Number of bytes to write
stream File to write data to
Returns:
Number of bytes written, or EOF if an error occurred
See also:
fwrite

freadbytes

int getc FILE f_handle  ) 
 

Gets the next unsigned character from the file stream.

Returns the next unsigned character (if available) from the file stream (converted to an int), advancing the file position pointer. Note: This function is equivalent to fgetc.

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle of the file we will read from
Returns:
The next character from the file, or EOF if the end of file has been reached
See also:
fgetc

feof

putc

char getchar void   ) 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

unsigned long getfreefsram  ) 
 

Gets the amount of free space in the file system.

Returns the number of bytes available to the file system. Note that this number is completely independent of the amount of free RAM available from the ROM's memory manager. The TINI File System uses its own independent memory manager.

This function is safe to be called from multiple processes at the same time.

Returns:
Amount of free RAM available to the file system.

char* gets char *  ,
int  n
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int mkdir char *  dirname  ) 
 

Creates a directory.

Creates a directory with the specified directory name.

This function is safe to be called from multiple processes at the same time.

Returns:
non-zero on success, 0 on failure

int printf const char *  ,
  ...
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int putc int  value,
FILE f_handle
 

Writes a character to a file stream.

Writes the specified character (converted from an int) to a file stream, advancing the file position indicator. Note: This function is equivalent to fputc.

This function is safe to be called from multiple processes at the same time.

Parameters:
value character that will be written to the file f_handle
f_handle handle of the file we will write character to
Returns:
Character written if successful, else EOF
See also:
getc

fputc

char putchar char   ) 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int puts const char *   ) 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int remove const char *  filename  ) 
 

Removes a file from the file system.

Deletes the file specified by filename.

This function is safe to be called from multiple processes at the same time.

Parameters:
filename file name that will be deleted
Returns:
0 on success, non-zero on failure
See also:
rename

int rename const char *  oldname,
const char *  newname
 

Renames a file.

Renames the file identified by oldname to now be identified by newname.

Warning:
This function is not multi-process safe. If two processes try to call this function at the same time, its parameters may be destroyed, yielding unpredictable results.
Parameters:
oldname filename of the file that will change names
newname new name for the file called oldname
Returns:
0 on success, non-zero on failure
See also:
remove

void rewind FILE f_handle  ) 
 

Resets the file position indicator for a stream.

Sets the file position indicator for the stream to the beginning of the file. It also resets the end of file condition. This is functionally equivalent to:

     fseek(f_handle, 0, SEEK_SET);
     clearerr(f_handle);
 

This function is safe to be called from multiple processes at the same time.

Parameters:
f_handle handle to file that the streams will be reset to the beginning for
See also:
fseek

fsetpos

int scanf const char *  ,
  ...
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int sprintf char *  ,
const char *  ,
  ...
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int sscanf char *  ,
const char *  ,
  ...
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

char* tempnam const char *  dirname,
const char *  pfx
 

Generates a path/filename that can be used for a temporary file.

Generates a path/filename that can be used to create a temporary file with. The pointer that is returned is suitable to be freed using mem_free. Make sure to use the Dallas Semiconductor memory management library (rom400_mem.h) rather than the Keil memory manager to free the memory.

This function is safe to be called from multiple processes at the same time.

Parameters:
dirname Directory for temporary file name to be created for. A default directory will be used if dirname is null.
pfx Prefix to prepend to temporary file name
Returns:
Pointer to temporary file name. Use mem_free to delete the memory.
See also:
tmpnam

tmpfile

mem_free [in the memory manager library]

FILE* tmpfile void   ) 
 

Generates a stream to a temporary file.

Generates a stream to a temporary file, opened for writing/update.

This function is safe to be called from multiple processes at the same time.

Returns:
File handle to a temporary file, or NULL on failure.
See also:
tempnam

tmpnam

char* tmpnam char *  nametarget  ) 
 

Generates a uniqe temporary filename.

Capable of generating TMP_MAX unique temporary filenames. This filename is suitable for using in a call to fopen. If the name is written to a static location, then this call destroys the previous filename stored in that location.

This function is safe to be called from multiple processes at the same time.

Parameters:
nametarget Storage location for new temporary name. If NULL, the temporary name will be copied to a static location.
Returns:
Location where temporary name is stored. This may be the same as nametarget.
See also:
tempnam

tmpfile

char ungetchar char   ) 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int vprintf const char *  ,
char * 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.

int vsprintf char *  ,
const char *  ,
char * 
 

Keil-provided function.

This is a Keil-provided function. Please see Keil's documentation for information on this function. It is exported by this header file so that we can override stdio.h.


Copyright 2005 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.