ZEDA  1.6.18
Data Structures | Macros | Typedefs | Functions
zeda_stream.h File Reference

generalized I/O stream. More...

#include <zeda/zeda_misc.h>
Include dependency graph for zeda_stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  __zstream
 

Macros

#define zStreamRewind(s)   (*(s)->rewind)( (s) )
 set the current position to the head of a stream. More...
 
#define zStreamSeek(s, p)   (*(s)->seek)( (s), (p) )
 set the current position to the specified location in a stream. More...
 
#define zStreamTell(s)   (*(s)->tell)( (s) )
 tell the current position in a stream. More...
 
#define zStreamRead(s, d, u, n)   (*(s)->read)( (s), (d), (u), (n) )
 read n data from the current position of s, and copy it to the memory pointed by d. u is the size of a data cell. More...
 
#define zStreamWrite(s, m, u, n)   (*(s)->write)( (s), (m), (u), (n) )
 write n data stored at m to the current position of s. s is the size of a data cell. More...
 
#define zStreamClose(s)   (*(s)->close)( (s) )
 close a stream. More...
 

Typedefs

typedef struct __zstream zStream
 

Functions

void zStreamAttachFile (zStream *str, FILE *fp)
 attach a file to a stream. More...
 
void zStreamAttachMem (zStream *str, byte *mem, size_t size)
 attach a memory space to a stream. More...
 
zStreamzStreamOpenFile (zStream *str, char filename[], char *mode)
 open a file and attach to a stream. More...
 
zStreamzStreamOpenMem (zStream *str, size_t size)
 allocate a memory space and attach to a stream. More...
 

Detailed Description

generalized I/O stream.

Author
Zhidao

This module is not available in the kernel space, since it requires the file pointer.