Google

Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

agl_ios.h File Reference

definition of all adgali features associated with ios. More...


Data Structures

struct  agl_ios
 defines an io stream. More...


type of input output

#define IOS_NULL   0
 filename.

#define IOS_FILE   1
 filename.

#define IOS_STREAM   2
 stream.

#define IOS_HANDLE   3
 handle.

#define IOS_MEMORY   4
 memory.


Defines

#define agl_ios_seek(ios, offset, whence)
 seek into the stream. More...

#define agl_ios_tell(ios)
 tell the position in the stream. More...

#define agl_ios_read(ios, buf, size, maxnum, supp)
 read the stream. More...

#define agl_ios_write(ios, buf, size, maxnum, supp)
 write into the stream. More...

#define agl_ios_close(ios)
 close the stream. More...


Functions

agl_iosagl_ios_filename (char *name, char *type)
 open a file with his filename and return an agl_ios struct pointing to it. More...

agl_iosagl_ios_fstream (FILE *file)
 create an agl_ios struct pointing to a file described with a file stream. More...

agl_iosagl_ios_fhandle (int handle)
 create an agl_ios struct pointing to a file described with a file handle. More...

agl_iosagl_ios_mem (void *mem, unsigned long size)
 create an agl_ios struct pointing to a memory zone. More...

agl_iosagl_ios_null ()
 cerate an agl_ios struct pointing to a null decriptor. More...


Variables

agl_ios agl_ios
 defines an io stream. More...


Detailed Description

this file defines all adgali features associated with ios and must be include when you use adgali this file is included by agl.h


Define Documentation

#define agl_ios_close ios
 

Value:

(agl_assert(ios != NULL), \
        ((ios)->close(ios)))
this function close the stream
Parameters:
ios   an agl_ios pointer which defines the stream
Returns:
nothing

#define agl_ios_read ios, buf, size, maxnum, supp
 

Value:

(agl_assert(ios != NULL), \
        ((ios)->read(ios, buf, size, maxnum ,supp)))
this function read the stream into a buffer
Parameters:
ios   an agl_ios pointer which defines the stream
buf   point to the read buffer. The size of this buffer should be big enough to contain size * maxnum characters
size   this is the size of one item
maxnum   this the maximum number of item to read
supp   this parameter is reserved for future use (socket for example)
Returns:
the number of items read

#define agl_ios_seek ios, offset, whence
 

Value:

(agl_assert(ios != NULL), \
        ((ios)->seek(ios, offset, whence)))
this function seek in a stream
Parameters:
ios   an agl_ios pointer which defines the stream
offset   an offset in then stream. The value could be positive or negative
whence   indicates the type of offset. see also seek(2) function.
  • SEEK_SET: force offset from the beginning of the stream
  • SEEK_CUR: force offset from the current position of the stream
  • SEEK_END: force offset from the end of the stream
Returns:
the offset from the beginning of the stream
Note:
the position of the stream could not be negative and greater than the stream size.

#define agl_ios_tell ios
 

Value:

(agl_assert(ios != NULL), \
        ((ios)->seek(ios, 0, SEEK_CUR)))
this function tell the position of the read/write pointer in the stream
Parameters:
ios   an agl_ios pointer which defines the stream
Returns:
the offset from the beginning of the stream

#define agl_ios_write ios, buf, size, maxnum, supp
 

Value:

(agl_assert(ios != NULL), \
        ((ios)->write(ios, buf, size, maxnum ,supp)))
this function write a buffer into the stream
Parameters:
ios   an agl_ios pointer which defines the stream
buf   point to the write buffer. The size of this buffer should be big enough to contain size * maxnum characters
size   this is the size of one item
maxnum   this the maximum number of item to read
supp   this parameter is reserved for future use (socket for example)
Returns:
the number of items written


Function Documentation

agl_ios* agl_ios_fhandle int handle
 

this function create an agl_ios structure pointing to a file which was previously opened by an OPEN(1) call.

Parameters:
handle   contains the handle of the file descriptor
Returns:
the agl_ios struct or NULL if an error occurs.

agl_ios* agl_ios_filename char * name,
char * type
 

this function open a file with his filename name and the mode type and return when opened an agl_ios struct pointing to it

Parameters:
name   The name of the file to open
type   Specifies how to open the file see fopen for a description
Returns:
the agl_ios struct or NULL if an error occurs.

agl_ios* agl_ios_fstream FILE * file
 

this function create an agl_ios structure pointing to a file which is described with a stream io structure file

Parameters:
file   the streaming structure pointer
Returns:
the agl_ios struct or NULL if an error occurs.

agl_ios* agl_ios_mem void * mem,
unsigned long size
 

this function create an agl_ios structure pointing a memory zone which contains the datas

Parameters:
mem   pointer to the memory zone which contains the datas
size   this is the size of the memory zone
Returns:
the agl_ios struct or NULL if an error occurs.

agl_ios* agl_ios_null
 

this function create an agl_ios structure pointing to nothing

Returns:
the agl_ios struct


Variable Documentation

struct agl_ios agl_ios
 

This structure defines io streams for adgali all the members are private. Don't use them directly


Doc generated at 6 Sep 2001 for, adgali 0.1.0 written by Stephane APIOU, © 2001 Generated by doxygen 1.2.9.1 ,