Main Page | Alphabetical List | Class List | File List | Class Members | File Members

stdio_os1.h File Reference

#include <nlibc.h>
#include <os1/defs_os1.h>
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <stdarg.h>
#include <typecodes.h>
#include <assert.h>
#include <os1/slice_stdio_os1.h>

Include dependency graph for stdio_os1.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define write_double   write_float
#define write_string(STR)   fputs((STR),stdout)
#define EOF   (-1)
#define _IOFBF   0
#define _IOLBF   1
#define _IONBF   2
#define BUFSIZ   0
#define FOPEN_MAX   __NLCC_OS1_MAX_FILES__
#define FILENAME_MAX   4095
#define L_tmpnam   20
#define TMP_MAX   238328
#define SEEK_SET   0
 Seek from beginning of file.

#define SEEK_CUR   1
 Seek from current position.

#define SEEK_END   2
 Seek from end of file.

#define _fputs(str, stream, sep)
#define putc(C, STR)   fputc(C, STR)
#define tfread(PTR, NMEMB, STREAM)   __tfread(__typecode(*PTR),PTR,NMEMB,STREAM)
#define tfwrite(PTR, NMEMB, STREAM)   __tfwrite(__typecode(*PTR),PTR,NMEMB,STREAM)
#define __IOPUT_INIT
#define __IOPUT(ITYPE, CTYPE)
#define fputf(VAL, STREAM)   fputd(VAL, STREAM)
#define putf(VAL, STREAM)   putd(VAL, STREAM)
#define __IOPUTA(CTS, ITYPE, BS)
#define printf(ARGS...)   fprintf(stdout, ##ARGS)
#define vprintf(FMT, ARG)   vfprintf(stdout, (FMT), (ARG))
#define scanf(ARGS...)   fscanf(stdin, ##ARGS)

Typedefs

typedef int fpos_t
typedef __nlcc_file_struct FILE

Functions

void write_int (int i)
void write_int_array (int *ip, int size)
void write_float (float f)
void write_float_array (float *fp, int size)
void write_double_array (double *fp, int size)
void write_complex (complex c)
void write_complex_array (complex *cp, int size)
void write_vector (vector v)
void write_vector_array (vector *vp, int size)
int remove (const char *filename)
int rename (const char *old, const char *new)
FILEtmpfile (void)
char * tmpnam (char *s)
int fflush (FILE *stream)
FILEfopen (const char *path, const char *mode)
int fclose (FILE *stream)
FILEfreopen (const char *restrict filename, const char *restrict mode, FILE *restrict stream)
void setbuf (FILE *restrict stream, char *restrict buf)
int setvbuf (FILE *restrict stream, char *restrict buf, int mode, size_t size)
long _fsetpos (FILE *stream, fpos_t *pos, int whence)
int fseek (FILE *stream, long offset, int whence)
void rewind (FILE *stream)
int fsetpos (FILE *stream, fpos_t *pos)
int fgetpos (FILE *stream, fpos_t *pos)
long ftell (FILE *stream)
int fputs (const char *str, FILE *stream)
int puts (const char *str)
int fputc (int c, FILE *stream)
int putchar (int c)
size_t fread (void *ptr, size_t size, size_t nmemb, FILE *stream)
size_t fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream)
size_t __tfread (int tcode, const void *ptr, size_t nmemb, FILE *stream)
size_t __tfwrite (int tcode, const void *ptr, size_t nmemb, FILE *stream)
int fputd (const double val, FILE *stream)
int putd (const double val)
int fputx (const complex val, FILE *stream)
int putx (const complex val)
int fputv (const vector val, FILE *stream)
int putv (const vector val)
int fputi (const int val, FILE *stream)
int puti (const int val)
int fputiv (const vector int val, FILE *stream)
int putiv (const vector int val)
int fputh (const int val, FILE *stream)
int fputhv (const int val, FILE *stream)
int puth (const int val)
int puthv (const int val)
int fputia (const int *ptr, int len, FILE *stream)
int fputiva (const int *ptr, int len, FILE *stream)
int fputxa (const complex *ptr, int len, FILE *stream)
int fputva (const vector *ptr, int len, FILE *stream)
int fputda (const double *ptr, int len, FILE *stream)
int fputua (const unsigned *ptr, int len, FILE *stream)
int fputha (const int *ptr, int len, FILE *stream)
int fputhva (const int *ptr, int len, FILE *stream)
int putia (const int *ptr, int len)
int putiva (const int *ptr, int len)
int putxa (const complex *ptr, int len)
int putva (const vector *ptr, int len)
int putda (const double *ptr, int len)
int putua (const unsigned *ptr, int len)
int putha (const int *ptr, int len)
int puthva (const int *ptr, int len)
int fgetd (double *ptr, FILE *stream)
int getd (double *ptr)
int fgetx (complex *ptr, FILE *stream)
int getx (complex *ptr)
int fgetv (vector *ptr, FILE *stream)
int getv (vector *ptr)
int fgeti (int *ptr, FILE *stream)
int geti (int *ptr)
int fprintf (FILE *stream, const char *format,...)
int vfprintf (FILE *restrict stream, const char *restrict format, va_list ap)
int fscanf (FILE *restrict stream, const char *restrict format,...)
void clearerr (FILE *stream)
int feof (FILE *stream)
int ferror (FILE *stream)
void perror (const char *s)
int fileno (FILE *stream)


Define Documentation

#define __IOPUT ITYPE,
CTYPE   ) 
 

Value:

asm("\n\t!! begin fput"#CTYPE"()");\
        asm("\t$io_start\n"\
            "\t$io_fd( 0.%1 )\n"\
            "\t$io_put"#ITYPE"( 0x0.%2 )\n"\
            "\t$io_end\n"\
            "\tlmtr %0 $MEM_SYS_RVAL\n"\
            : "=r" (sys_rval) : "r" (stream->fd), "r" (&val) );\
\
        retval = 0;\
        where (sys_rval.lo) {\
                stream->err = 1;\
                retval = -1;\
        }\
        asm("\t!! end fput"#CTYPE"()\n");\
        return retval

Definition at line 1560 of file stdio_os1.h.

Referenced by fputd(), fputh(), fputhv(), fputi(), fputiv(), fputv(), and fputx().

#define __IOPUT_INIT
 

Value:

int retval;\
        vector int sys_rval;\
\
        _Pragma("localmem");\
\
NAME
fputd - write a single double value to a formatted stream
putd - write a single double value to a stdin
fputx - write a single complex value to a formatted stream
putx - write a single complex value to a stdin
fputv - write a single vector value to a formatted stream
putv - write a single vector value to a stdin
fputi - write a single int value to a formatted stream
puti - write a single int value to a stdin
fputiv - write a single vector int value to a formatted stream
putiv - write a single vector int value to a stdin
fputh - write a single int value as hex to a formatted stream
puth - write a single int value as hex to a stdin
fputiv - write a single vector int value as hex to a formatted stream
putiv - write a single vector int value as hex to a stdin
SYNOPSIS
int fputd(const double val, FILE *stream);
int putd(const double val);
int fputx(const complex val, FILE *stream);
int putx(const complex val);
int fputv(const vector val, FILE *stream);
int putv(const vector val);
int fputi(const int val, FILE *stream);
int puti(const int val);
int fputiv(const int val, FILE *stream);
int putiv(const int val);
int fputh(const int val, FILE *stream);
int puth(const int val);
int fputhv(const vector int val, FILE *stream);
int puthv(const vector int val);

Definition at line 1553 of file stdio_os1.h.

Referenced by fputd(), fputda(), fputh(), fputha(), fputhv(), fputhva(), fputi(), fputia(), fputiv(), fputiva(), fputua(), fputv(), fputva(), fputx(), and fputxa().

#define __IOPUTA CTS,
ITYPE,
BS   ) 
 

Value:

asm("\n\t!! begin fput"#CTS"a()");\
        asm("\t$io_start\n"\
            "\t$io_fd( 0.%1 )\n"\
            "\t\\equl $cmd   $SYS_IOCMD_GWR\n"\
            "\t\\equl $fmt   <$SYS_IOFMT_"#ITYPE">\n"\
            "\t\\equl $sep   <$SYS_IOPSEP_NL .or. $SYS_IOWSEP_SPACE>\n"\
            "\t\\equl $dev   $SYS_IODEV_MEM\n"\
            "\t\\equl $bs    "#BS"\n"\
            "\t\\equl $rdflg $SYS_IORDFLG_NOP\n"\
            "\t$io_packet($cmd, <$fmt .or. $sep>, $rdflg, $dev, 0.%2, $bs, 0.%3)\n"\
            "\t$io_end\n"\
            "\tlmtr %0 $MEM_SYS_RVAL\n"\
            : "=r" (sys_rval)\
            : "r" (stream->fd), "r" (len), "r" (ptr) );\
\
        retval = 0;\
        where (sys_rval.lo) {\
                stream->err = 1;\
                retval = -1;\
        }\
        asm("\t!! end fput"#CTS"a()\n");\
        return retval

Definition at line 1643 of file stdio_os1.h.

Referenced by fputda(), fputha(), fputhva(), fputia(), fputiva(), fputua(), fputva(), and fputxa().

#define _fputs str,
stream,
sep   ) 
 

Value:

int retval;                                                             \
  vector int sys_rval;                                                  \
                                                                        \
  if(! stream->fd) {                                                    \
    return EOF;                                                         \
  }                                                                     \
                                                                        \
  asm("\t$io_start\n"                                                   \
      "\t$io_fd( 0.%1 )\n"                                              \
      "\t\\equl $cmd    $SYS_IOCMD_GWR\n"                               \
      "\t\\equl $fmtsep <$SYS_IOFMT_VARSTR .or. %2>\n"                  \
      "\t\\equl $dev    $SYS_IODEV_MEM\n"                               \
      "\t\\equl $l      0\n"                                            \
      "\t\\equl $bs     $SYS_IOBS_V\n"                                  \
      "\t\\equl $rdflg  $SYS_IORDFLG_NOP\n"                             \
      "\t$io_packet($cmd, $fmtsep, $rdflg, $dev, $l, $bs, 0.%3)\n"      \
      "\t$io_end\n"                                                     \
      "\tlmtr %0 $MEM_SYS_RVAL\n"                                       \
      : "=r" (sys_rval) : "r" (stream->fd), "I" (sep), "r" (str));      \
                                                                        \
  retval = 0;                                                           \
  where (sys_rval.lo) {                                                 \
    retval = EOF;                                                       \
    stream->err = 1;                                                    \
    errno = sys_rval.hi;                                                \
  }                                                                     \
                                                                        \
  return retval;
NAME
fputc, fputs, putc, putchar, puts - output of characters and strings
SYNOPSIS
#include <stdio.h>

int fputc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int putc(int c, FILE *stream);
int putchar(int c);
int puts(const char *s);
DESCRIPTION
fputc() writes the character c, cast to an unsigned char, to stream.
fputs() writes the string s to stream, without its trailing '\0'.
putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once.
putchar(c); is equivalent to putc(c,stdout).
puts() writes the string s and a trailing newline to stdout.
Calls to the functions described here can be mixed with each other and with calls to other output functions from the stdio library for the same output stream.
RETURN VALUE
fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error.
puts() and fputs() return a non - negative number on success, or EOF on error.

Definition at line 1139 of file stdio_os1.h.

Referenced by fputs(), and puts().

#define _IOFBF   0
 

Yields the value of the mode argument to "int setvbuf(...)" to indicate full buffering

Definition at line 408 of file stdio_os1.h.

#define _IOLBF   1
 

Yields the value of the mode argument to "int setvbuf(...)" to indicate line buffering

Definition at line 415 of file stdio_os1.h.

#define _IONBF   2
 

Yields the value of the mode argument to "int setvbuf(...)" to indicate no buffering

Definition at line 422 of file stdio_os1.h.

#define BUFSIZ   0
 

It expands to an integer constant expression that is the size of the buffer used by the setbuf function

Definition at line 429 of file stdio_os1.h.

#define EOF   (-1)
 

EOF expands to an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file, that is, no more input from a stream;

Definition at line 376 of file stdio_os1.h.

Referenced by fputc().

#define FILENAME_MAX   4095
 

It yields the maximum size array of characters that you must provide to hold a filename. A filename is a string whose contents meet the requirements of the target environment for naming files.

Definition at line 445 of file stdio_os1.h.

#define FOPEN_MAX   __NLCC_OS1_MAX_FILES__
 

It yields the maximum number of files that the target environment permits to be simultaneously open

Definition at line 436 of file stdio_os1.h.

#define fputf VAL,
STREAM   )     fputd(VAL, STREAM)
 

Definition at line 1577 of file stdio_os1.h.

#define L_tmpnam   20
 

It yields the number of characters that the target environment requires for representing temporary filenames created by char *tmpnam(...)

Definition at line 452 of file stdio_os1.h.

#define printf ARGS...   )     fprintf(stdout, ##ARGS)
 

NAME
fprintf - generates formatted text
SYNOPSIS
#include <stdio.h>

int fprintf(FILE * restrict stream, const char * restrict format, ...)
int printf(const char * restrict format, ...)

#include <stdarg.h>

int vfprintf(FILE * restrict stream, const char * restrict format, va_list ap)
int vprintf(const char * restrict format, va_list ap)
DESCRIPTION
This function generates a formatted text under the control of the format format and any additional arguments, and writes each generated character to the stream stream or to stdout (in case of printf()).
RETURN
It returns the number of characters generated or returns a negative value if the function sets the error indicator for the stream
apeNEXT IMPLEMENTATION:
Mostly done, no array extensions yet

Definition at line 1854 of file stdio_os1.h.

Referenced by write_int().

#define putc C,
STR   )     fputc(C, STR)
 

Definition at line 1203 of file stdio_os1.h.

Referenced by putchar().

#define putf VAL,
STREAM   )     putd(VAL, STREAM)
 

Definition at line 1578 of file stdio_os1.h.

#define scanf ARGS...   )     fscanf(stdin, ##ARGS)
 

NAME
fscanf() - scans formatted text
SYNOPSIS
#include <stdio.h>

int fscanf(FILE * restrict stream, const char * restrict format, ...)
int scanf(const char * restrict format, ...)
DESCRIPTION
This function scans formatted text under the control of the format format and any additional arguments. It obtains each scanned character from the stream stream.
RETURN VALUE
It returns the number of input items matched and assigned, or it returns EOF if the function does not store values before it sets the end-of-file or error indicator for the stream.

Definition at line 2040 of file stdio_os1.h.

#define SEEK_CUR   1
 

Seek from current position.

Definition at line 993 of file stdio_os1.h.

#define SEEK_END   2
 

Seek from end of file.

Definition at line 994 of file stdio_os1.h.

#define SEEK_SET   0
 

Seek from beginning of file.

NAME
fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream
SYNOPSIS
#include <stdio.h>

int fseek(FILE *stream, long offset, int whence);
long ftell(FILE *stream);
void rewind(FILE *stream);
int fgetpos(FILE *stream, fpos_t *pos);
int fsetpos(FILE *stream, fpos_t *pos);
DESCRIPTION
The fseek function sets the file position indicator for the stream pointed to by stream. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. A successful call to the fseek function clears the end-of-file indicator for the stream and undoes any effects of the ungetc(3) function on the same stream.
The ftell function obtains the current value of the file position indicator for the stream pointed to by stream.
The rewind function sets the file position indicator for the stream pointed to by stream to the beginning of the file. It is equivalent to:
  (void)fseek(stream, 0L, SEEK_SET)
except that the error indicator for the stream is also cleared (see clearerr(3)).

Definition at line 992 of file stdio_os1.h.

#define tfread PTR,
NMEMB,
STREAM   )     __tfread(__typecode(*PTR),PTR,NMEMB,STREAM)
 

NAME
tfread, tfwrite - type dependent binary stream input/output
SYNOPSIS
#include <stdio.h>

size_t tfread( (type *) ptr, size_t nmemb, FILE *stream);

size_t tfwrite ( const (type *) ptr, size_t nmemb, FILE *stream);
DESCRIPTION
The function tfread reads nmemb elements of data from the stream pointed to by stream, storing them at the location given by ptr.
The function tfwrite writes nmemb elements of data to the stream pointed to by stream, obtaining them from the location given by ptr.
The type of data is obtained by dereferencing the pointer *ptr.
RETURN VALUE
tfread and tfwrite return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero).
tfread does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred.
WARNING
The pointer ptr must be a pointer on the following data types: float, double, int, unsigned, complex, vector, vfloat vint, vuint. Otherwise an assertion error occurs.
BUG
If for tfread() the end-of-file is reached, no data are read and the return value is 0.

Definition at line 1385 of file stdio_os1.h.

#define tfwrite PTR,
NMEMB,
STREAM   )     __tfwrite(__typecode(*PTR),PTR,NMEMB,STREAM)
 

Definition at line 1451 of file stdio_os1.h.

#define TMP_MAX   238328
 

It yields the minimum number of distinct filenames created by char tmpnam(...).

Definition at line 459 of file stdio_os1.h.

#define vprintf FMT,
ARG   )     vfprintf(stdout, (FMT), (ARG))
 

Definition at line 1855 of file stdio_os1.h.

#define write_double   write_float
 

Definition at line 137 of file stdio_os1.h.

#define write_string STR   )     fputs((STR),stdout)
 

Definition at line 367 of file stdio_os1.h.


Typedef Documentation

typedef __nlcc_file_struct FILE
 

FILE is an object type capable of recording all the information needed to control a stream, including its file position indicator, a pointer to its associated buffer (if any), an error indicator that records whether a read/write error has occurred, and an end-of-file indicator that records whether the end of the file has been reached;

Definition at line 400 of file stdio_os1.h.

Referenced by mfgetdi(), mfgeti(), mfgetx(), mfputd(), mfputda(), mfputh(), mfputhv(), mfputi(), mfputia(), mfputiv(), mfputu(), mfputva(), mfputx(), mfputxa(), and tmpfile().

typedef int fpos_t
 

The type fpos_t is an object type of an object that you declare to hold the value of a file-position indicator stored by fsetpos and accessed by int fgetpos(...).

Definition at line 386 of file stdio_os1.h.

Referenced by fseek(), and rewind().


Function Documentation

size_t __tfread int  tcode,
const void *  ptr,
size_t  nmemb,
FILE stream
 

size_t __tfwrite int  tcode,
const void *  ptr,
size_t  nmemb,
FILE stream
 

long _fsetpos FILE stream,
fpos_t pos,
int  whence
[inline]
 

Definition at line 998 of file stdio_os1.h.

References EBADF, EINVAL, __nlcc_file_struct::err, errno, __nlcc_file_struct::fd, SEEK_CUR, SEEK_END, and SEEK_SET.

Referenced by fseek(), fsetpos(), and rewind().

void clearerr FILE stream  ) 
 

NAME
clearerr, feof, ferror, fileno - check and reset stream status
SYNOPSIS
#include <stdio.h>

void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
DESCRIPTION
The function clearerr clears the end-of-file and error indicators for the stream pointed to by stream.
The function feof tests the end-of-file indicator for the stream pointed to by stream, returning non-zero if it is set. The end-of-file indicator can only be cleared by the function clearerr.
The function ferror tests the error indicator for the stream pointed to by stream, returning non-zero if it is set. The error indicator can only be reset by the clearerr function.
ERRORS
These functions should not fail and do not set the external variable errno.

int fclose FILE stream  ) 
 

NAME
fclose - close a stream
SYNOPSIS
#include <stdio.h>

int fclose(FILE *stream);
DESCRIPTION
The fclose function dissociates the named stream from its underlying file or set of functions. If the stream was being used for output, any buffered data is written first, using fflush(3).
RETURN VALUE
Upon successful completion 0 is returned. Otherwise, EOF is returned and the global variable errno is set to indicate the error. In either case any further access (including another call to fclose()) to the stream results in undefined behaviour.

int feof FILE stream  ) 
 

int ferror FILE stream  )  [inline]
 

int fflush FILE stream  ) 
 

NAME
fflush - writes any buffered output to the file
SYNOPSIS
#include <stdio.h>

int fflush(FILE *stream)
DESCRIPTION
This function writes any buffered output to the file associated with the stream stream. If stream is a null pointer, fflush writes any buffered output to all files opened for output.
RETURN
It returns zero if successful; otherwise, it returns EOF.
apeNEXT IMPLEMENTATION
Implementation possible

Definition at line 628 of file stdio_os1.h.

int fgetd double *  ptr,
FILE stream
 

NAME
fgetd - read a single double value from a formatted stream
getd - read a single double value from a stdin
fgetx - read a single complex value from a formatted stream
getx - read a single complex value from a stdin
fgetv - read a single vector value from a formatted stream
getv - read a single vector value from a stdin
fgeti - read a single int value from a formatted stream
geti - read a single int value from a stdin
SYNOPSIS
int fgetd( double *ptr, FILE *stream);
int getd( double *ptr );
int fgetx( complex *ptr, FILE *stream);
int getx( complex *ptr );
int fgetv( vector *ptr, FILE *stream);
int getv( vector *ptr );
int fgeti( int *ptr, FILE *stream);
int geti( int *ptr );

int fgeti int *  ptr,
FILE stream
 

int fgetpos FILE stream,
fpos_t pos
 

int fgetv vector ptr,
FILE stream
 

int fgetx complex *  ptr,
FILE stream
 

int fileno FILE stream  )  [inline]
 

NAME
fileno
SYNOPSIS
int fileno( FILE *stream);
DESCRIPTION
The function fileno examines the argument stream and returns its integer descriptor.

Definition at line 2235 of file stdio_os1.h.

References __nlcc_file_struct::fd.

FILE* fopen const char *  path,
const char *  mode
 

NAME
fopen - open a stream
SYNOPSIS
#include <stdio.h>

FILE *fopen(const char *filename, const char *mode);
DESCRIPTION
The fopen() function opens the file whose pathname is the string pointed to by filename, and associates a stream with it.
The argument mode points to a string beginning with one of the following sequences (Additional characters may follow these sequences.):
r
Open text file for reading. The stream is positioned at the beginning of the file.

r+
Open for reading and writing. The stream is positioned at the beginning of the file.

w
Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.

w+
Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.

a
Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file.

a+
Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file.

RETURN VALUE
Upon successful completion fopen returns a FILE pointer. Otherwise, NULL is returned and the global variable errno is set to indicate the error.

int fprintf FILE stream,
const char *  format,
... 
 

int fputc int  c,
FILE stream
[inline]
 

Definition at line 1186 of file stdio_os1.h.

References EOF, and fputs().

int fputd const double  val,
FILE stream
[inline]
 

Definition at line 1581 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by putd().

int fputda const double *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1684 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putda().

int fputh const int  val,
FILE stream
[inline]
 

Definition at line 1626 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by puth().

int fputha const int *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1692 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putha(), and puthva().

int fputhv const int  val,
FILE stream
[inline]
 

Definition at line 1631 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by puthv().

int fputhva const int *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1696 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

int fputi const int  val,
FILE stream
[inline]
 

Definition at line 1608 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by puti().

int fputia const int *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1668 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putia().

int fputiv const vector int  val,
FILE stream
[inline]
 

Definition at line 1617 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by putiv().

int fputiva const int *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1672 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putiva().

int fputs const char *  str,
FILE stream
[inline]
 

Definition at line 1170 of file stdio_os1.h.

References _fputs.

Referenced by fputc().

int fputua const unsigned *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1688 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putua().

int fputv const vector  val,
FILE stream
[inline]
 

Definition at line 1599 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by putv().

int fputva const vector ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1680 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putva().

int fputx const complex  val,
FILE stream
[inline]
 

Definition at line 1590 of file stdio_os1.h.

References __IOPUT, and __IOPUT_INIT.

Referenced by putx().

int fputxa const complex *  ptr,
int  len,
FILE stream
[inline]
 

Definition at line 1676 of file stdio_os1.h.

References __IOPUT_INIT, and __IOPUTA.

Referenced by putxa().

size_t fread void *  ptr,
size_t  size,
size_t  nmemb,
FILE stream
 

NAME
fread, fwrite - binary stream input/output
SYNOPSIS
#include <stdio.h>

size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);

size_t fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream);

DESCRIPTION
The function fread reads nmemb elements of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr.
The function fwrite writes nmemb elements of data, each size bytes long, to the stream pointed to by stream, obtaining them from the location given by ptr.
RETURN VALUE
fread and fwrite return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero).
fread does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred.
apeNEXT IMPLEMENTATION
On apeNEXT the total number of bytes for reading and writing must be a multiple of 16. An assertion error occurs if this is not the case. For binary stream i/o of specific types tfwrite()/tfread() can be used.
BUG
If for fread() the end-of-file is reached, no data are read and the return value is 0.

FILE* freopen const char *restrict  filename,
const char *restrict  mode,
FILE *restrict  stream
 

NAME
freopen - closes and reopens a file
SYNOPSIS
#include <stdio.h>

FILE *freopen(const char * restrict filename,
const char * restrict mode, FILE * restrict stream)
DESCRIPTION
This function closes the file associated with the stream stream (as the case if calling fclose); then it opens the file with the filename filename and associates the file with the stream stream (as the case if calling fopen(filename, mode)).
RETURN
It returns stream if the open is successful; otherwise, it returns a null pointer.
apeNEXT IMPLEMENTATION
NOT implemented yet

int fscanf FILE *restrict  stream,
const char *restrict  format,
... 
 

int fseek FILE stream,
long  offset,
int  whence
[inline]
 

Definition at line 1041 of file stdio_os1.h.

References _fsetpos(), and fpos_t.

int fsetpos FILE stream,
fpos_t pos
[inline]
 

Definition at line 1059 of file stdio_os1.h.

References _fsetpos(), and SEEK_SET.

long ftell FILE stream  ) 
 

size_t fwrite const void *  ptr,
size_t  size,
size_t  nmemb,
FILE stream
 

int getd double *  ptr  ) 
 

int geti int *  ptr  ) 
 

int getv vector ptr  ) 
 

int getx complex *  ptr  ) 
 

void perror const char *  s  ) 
 

NAME
perror, errno - print system error messages
SYNOPSIS
#include <stdio.h>
void perror(const char *s);

#include <errno.h>
int errno;
DESCRIPTION
perror() produces a message on the standard error output (file descriptor 2), describing the last error encountered during a call to a system or library function. The argument string s is printed first, then a colon and a blank, then the message and a newline. (However, if s is a null pointer or points to a null string, the colon is not printed.) To be of most use, the argument string should include the name of the program that incurred the error. The error number is taken from the external variable errno, (see intro(2)), which is set when errors occur but not cleared when non- erroneous calls are made.

int putchar int  c  )  [inline]
 

Definition at line 1207 of file stdio_os1.h.

References putc, and stdout.

int putd const double  val  )  [inline]
 

Definition at line 1586 of file stdio_os1.h.

References fputd(), and stdout.

int putda const double *  ptr,
int  len
[inline]
 

Definition at line 1716 of file stdio_os1.h.

References fputda(), and stdout.

int puth const int  val  )  [inline]
 

Definition at line 1636 of file stdio_os1.h.

References fputh(), and stdout.

int putha const int *  ptr,
int  len
[inline]
 

Definition at line 1724 of file stdio_os1.h.

References fputha(), and stdout.

int puthv const int  val  )  [inline]
 

Definition at line 1640 of file stdio_os1.h.

References fputhv(), and stdout.

int puthva const int *  ptr,
int  len
[inline]
 

Definition at line 1728 of file stdio_os1.h.

References fputha(), and stdout.

int puti const int  val  )  [inline]
 

Definition at line 1613 of file stdio_os1.h.

References fputi(), and stdout.

int putia const int *  ptr,
int  len
[inline]
 

Definition at line 1700 of file stdio_os1.h.

References fputia(), and stdout.

int putiv const vector int  val  )  [inline]
 

Definition at line 1622 of file stdio_os1.h.

References fputiv(), and stdout.

int putiva const int *  ptr,
int  len
[inline]
 

Definition at line 1704 of file stdio_os1.h.

References fputiva(), and stdout.

int puts const char *  str  )  [inline]
 

Definition at line 1177 of file stdio_os1.h.

References _fputs, and stdout.

int putua const unsigned *  ptr,
int  len
[inline]
 

Definition at line 1720 of file stdio_os1.h.

References fputua(), and stdout.

int putv const vector  val  )  [inline]
 

Definition at line 1604 of file stdio_os1.h.

References fputv(), and stdout.

int putva const vector ptr,
int  len
[inline]
 

Definition at line 1712 of file stdio_os1.h.

References fputva(), and stdout.

int putx const complex  val  )  [inline]
 

Definition at line 1595 of file stdio_os1.h.

References fputx(), and stdout.

int putxa const complex *  ptr,
int  len
[inline]
 

Definition at line 1708 of file stdio_os1.h.

References fputxa(), and stdout.

int remove const char *  filename  )  [inline]
 

NAME
remove - removes the file
SYNOPSIS
#include <stdio.h>

int remove(const char *filename)
DESCRIPTION
This function removes the file 'filename' If the file is open when one wants to remove it, the result is implementation defined. After remove the the file, one cannot open it as an existing file.
RETURN
zero if successful
apeNEXT IMPLEMENTATION
NOT implemented yet

Definition at line 486 of file stdio_os1.h.

int rename const char *  old,
const char *  new
[inline]
 

NAME
rename - renames the file
SYNOPSIS
#include <stdio.h>

int rename(const char *old, const char *new)
DESCRIPTION
This function renames the file with the filename old to have the filename new. If a file with the filename new already exists, the result is implementation defined. After rename, one cannot open the file with the filename old.
RETURN
zero if successful
apeNEXT IMPLEMENTATION
NOT implemented yet

Definition at line 520 of file stdio_os1.h.

void rewind FILE stream  )  [inline]
 

Definition at line 1050 of file stdio_os1.h.

References _fsetpos(), fpos_t, and SEEK_SET.

void setbuf FILE *restrict  stream,
char *restrict  buf
[inline]
 

NAME
setbuf - sets a buffer size
SYNOPSIS
#include <stdio.h>

void setbuf(FILE * restrict stream, char * restrict buf)
DESCRIPTION
If buf is not a null pointer, setbuf calls the function setvbuf(stream, buf, __IOFBF, BUFSIZ), specifying full buffering with _IOFBF and a buffer size of BUFSIZ characters. Otherwise, it calls the function setvbuf(stream, 0, _IONBF, BUFSIZ), specifying no buffering with _IONBF.
RETURN VALUE
None
apeNEXT IMPLEMENTATION
Probably not needed

Definition at line 897 of file stdio_os1.h.

int setvbuf FILE *restrict  stream,
char *restrict  buf,
int  mode,
size_t  size
[inline]
 

NAME
setvbuf - set buffering mode
SYNOPSIS
#include <stdio.h>

int setvbuf(FILE * restrict stream, char * restrict buf, int mode, size_t size)
DESCRIPTION
This function sets the buffering mode for the stream stream according to buf, mode, and size. If buf is not a null pointer, then buf is the address of the first element of an array of char of size size that can be used as the stream buffer. Otherwise, setvbuf can allocate a stream buffer that is freed when the file is closed. For mode you must supply one of the following values:
_IOFBF -- to indicate full buffering
_IOLBF -- to indicate line buffering
_IONBF -- to indicate no buffering
RETURN VALUES
It returns zero if successful.
NOTE
We must call setvbuf after calling fopen in order to associate a file with that stream and before calling a library function that performs any other operation on the stream.
apeNEXT IMPLEMENTATION:
Possible

Definition at line 943 of file stdio_os1.h.

References size_t.

FILE* tmpfile void   )  [inline]
 

NAME
tmpfile - reates a temporary binary file
SYNOPSIS
#include <stdio.h>
FILE *tmpfile(void)
DESCRIPTION
This function creates a temporary binary file with the filename temp-name and then has the same effect as calling fopen(temp-name, "wb+"). The file temp-name is removed when the program closes it, either by calling fclose explicitly or at normal program termination.
RETURN
If the open is successful, the function returns a pointer to the object controlling the stream; otherwise, it returns a null pointer.
NOTES
The filename temp-name does not conflict with any filenames that you create.
apeNEXT IMPLEMENTATION
NOT implemented yet

Definition at line 559 of file stdio_os1.h.

References FILE.

char* tmpnam char *  s  ) 
 

NAME
tmpnam - creates unique file name
SYNOPSIS
#include <stdio.h>

char *tmpnam(char *s)
DESCRIPTION
This function creates a unique filename and returns a pointer to it. If argument is not a null pointer, then it must be the address of the first element of an array at least of size L_tmpnam. tmpnam stores temp-name in the array and returns argument. Otherwise, if argument is a null pointer, the function stores temp-name in a static-duration array and returns the address of its first element.
RETURN
It returns pointer to the created file name.
apeNEXT IMPLEMENTATION
NOT implemented yet

Definition at line 595 of file stdio_os1.h.

int vfprintf FILE *restrict  stream,
const char *restrict  format,
va_list  ap
 

void write_complex complex  c  )  [inline]
 

NAME
write_complex - write a complex to stdout
SYNOPSIS
#include <stdio.h>

void write_complex(complex c);
DESCRIPTION
write_complex() writes the complex argument v to stdout enclosed in (,) and followed by a newline.
RETURN VALUE
None

Definition at line 236 of file stdio_os1.h.

void write_complex_array complex *  cp,
int  size
[inline]
 

NAME
write_complex_array - write an array of complex values to stdout
SYNOPSIS
#include <stdio.h>

void write_complex_array(complex *cp, int size);
DESCRIPTION
write_complex_array() writes the size complex values at memory position pointed to by vp to stdout. Each value is enclosed in (,) and the array is followed by a newline.
RETURN VALUE
None

Definition at line 275 of file stdio_os1.h.

void write_double_array double *  fp,
int  size
[inline]
 

NAME
write_double_array - write an array of double values to stdout
SYNOPSIS
#include <stdio.h>

void write_double_array(double *fp, int size);
DESCRIPTION
write_double_array() writes the size double values at memory position pointed to by vp to stdout. The array is followed by a newline.
RETURN VALUE
None

Definition at line 199 of file stdio_os1.h.

void write_float float  f  )  [inline]
 

NAME
write_float, write_double - write a float or double value to stdout
SYNOPSIS
#include <stdio.h>

void write_float(float f);
void write_double(double f);
DESCRIPTION
write_float() and write_double write a low bank of the double argument f followed by a newline to stdout.
RETURN VALUE
None

Definition at line 120 of file stdio_os1.h.

void write_float_array float *  fp,
int  size
[inline]
 

NAME
write_float_array - write an array of float values to stdout
SYNOPSIS
#include <stdio.h>

void write_float_array(float *fp, int size);
DESCRIPTION
write_float_array() writes the size float values at memory position pointed to by fp to stdout. The array is followed by a newline.
RETURN VALUE
None

Definition at line 161 of file stdio_os1.h.

void write_int int  i  )  [inline]
 

NAME
write_int - write an integer value to stdout
SYNOPSIS
#include <stdio.h>

void write_int(int i);
DESCRIPTION
write_int() writes the low bank of the integer argument i followed by a newline to stdout.
RETURN VALUE
None

Definition at line 44 of file stdio_os1.h.

void write_int_array int *  ip,
int  size
[inline]
 

NAME
write_int_array - write an array of integer values to stdout
SYNOPSIS
#include <stdio.h>

void write_int_array(int *ip, int size);
DESCRIPTION
write_int_array() writes the size int values at memory position pointed to by ip to stdout. The array is followed by a newline.
RETURN VALUE
None

Definition at line 82 of file stdio_os1.h.

void write_vector vector  v  )  [inline]
 

NAME
write_vector - write a vector float to stdout
SYNOPSIS
#include <stdio.h>

void write_vector(vector v);
DESCRIPTION
write_vector() writes the vector argument v to stdout enclosed in (,) and followed by a newline.
RETURN VALUE
None

Definition at line 312 of file stdio_os1.h.

void write_vector_array vector vp,
int  size
[inline]
 

NAME
write_vector_array - write an array of vector floats to stdout
SYNOPSIS
#include <stdio.h>

void write_vector_array(vector *vp, int size);
DESCRIPTION
write_vector_array() writes the size vector values at memory position pointed to by vp to stdout. Each value is enclosed in (,) and the array is followed by a newline.
RETURN VALUE
None

Definition at line 351 of file stdio_os1.h.


Generated on Mon Feb 20 15:54:44 2006 for nlibc by doxygen 1.3.5