Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

fileoutputstream.c File Reference

#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "fileoutputstream.h"
#include "xmlcpg.h"

Compounds

struct  xmlcpgFILEOUTPUTSTREAM

Functions

xmlcpgFileOutputStreamxmlcpgnewFileOutputStreamFILE (FILE *f)
 Creates a new file output stream with a FILE stream.

xmlcpgFileOutputStreamxmlcpgnewFileOutputStreamString (const char *name)
 Creates a new file output stream with a file name.

xmlcpgFileOutputStreamxmlcpgnewFileOutputStreamFD (int fd)
 Creates a new file output stream with a file descriptor.

void xmlcpgdeleteFileOutputStream (xmlcpgFileOutputStream *os)
 Destroys the output stream.

int xmlcpgisFileOutputStream (const xmlcpgFileOutputStream *os)
 Tells if the the object is a file output stream.

int xmlcpggetFileOutputStreamFD (const xmlcpgFileOutputStream *os)
 Gets the file output stream file descriptor.

int xmlcpggetFileOutputStreamEOS (const xmlcpgFileOutputStream *os)
 Tests the end of stream indicator of the output stream.

int xmlcpgflushFileOutputStream (xmlcpgFileOutputStream *os)
 Flushes the output stream.

int xmlcpgwriteFileOutputStreamChar (xmlcpgFileOutputStream *os, int c)
 Writes a character to the output stream.

int xmlcpgwriteFileOutputStream (xmlcpgFileOutputStream *os, const void *ptr, int nb)
 Writes some bytes of data to the location pointed by ptr.

int xmlcpgcloseFileOutputStream (xmlcpgFileOutputStream *os)
 Closes the output stream.

int xmlcpggetFileOutputStreamError (const xmlcpgFileOutputStream *os)
 Tests the error indicator of the output stream.

const char * xmlcpggetFileOutputStreamErrorString (const xmlcpgFileOutputStream *os)
 Gets the string describing the error.


Function Documentation

int xmlcpgcloseFileOutputStream xmlcpgFileOutputStream   os
 

Closes the output stream.

Parameters:
os  the output stream.
Returns:
0 upon successful completion, -1 is returned otherwise.

void xmlcpgdeleteFileOutputStream xmlcpgFileOutputStream   os
 

Destroys the output stream.

The stream must be closed before with the xmlcpgcloseFileOutputStream function.

Parameters:
os  the output stream.

int xmlcpgflushFileOutputStream xmlcpgFileOutputStream   os
 

Flushes the output stream.

Parameters:
os  the output stream.
Returns:
0 on successful completion, -1 is returned otherwise.

int xmlcpggetFileOutputStreamEOS const xmlcpgFileOutputStream   os
 

Tests the end of stream indicator of the output stream.

Parameters:
os  the output stream.
Returns:
a non-zero if it is set or if os is not an output stream.

int xmlcpggetFileOutputStreamError const xmlcpgFileOutputStream   os
 

Tests the error indicator of the output stream.

Parameters:
os  the output stream.
Returns:
a non-zero if an error occured.

const char* xmlcpggetFileOutputStreamErrorString const xmlcpgFileOutputStream   os
 

Gets the string describing the error.

Parameters:
os  the output stream.
Returns:
the error string.

int xmlcpggetFileOutputStreamFD const xmlcpgFileOutputStream   os
 

Gets the file output stream file descriptor.

Parameters:
os  the file output stream.
Returns:
the file descriptor or -1 if os is not a file output stream or NULL.

int xmlcpgisFileOutputStream const xmlcpgFileOutputStream   os
 

Tells if the the object is a file output stream.

Parameters:
os  the file output stream.
Returns:
0 if os is NULL or not a file output stream, non-zero otherwise.

xmlcpgFileOutputStream* xmlcpgnewFileOutputStreamFD int    fd
 

Creates a new file output stream with a file descriptor.

Parameters:
fd  the file descriptor.
Returns:
the new file output stream or NULL otherwise.

xmlcpgFileOutputStream* xmlcpgnewFileOutputStreamFILE FILE *    f
 

Creates a new file output stream with a FILE stream.

Parameters:
f  the FILE stream.
Returns:
the new file output stream or NULL otherwise.

xmlcpgFileOutputStream* xmlcpgnewFileOutputStreamString const char *    name
 

Creates a new file output stream with a file name.

Parameters:
name  the file name.
Returns:
the new file output stream or NULL otherwise.

int xmlcpgwriteFileOutputStream xmlcpgFileOutputStream   os,
const void *    ptr,
int    nb
 

Writes some bytes of data to the location pointed by ptr.

Parameters:
os  the output stream.
ptr  the bytes location.
nb  the number of bytes to write.
Returns:
the number of bytes written or 0 on end of stream or -1 on error.

int xmlcpgwriteFileOutputStreamChar xmlcpgFileOutputStream   os,
int    c
 

Writes a character to the output stream.

Parameters:
os  the output stream.
c  the character to write.
Returns:
the character written as an unsigned char cast to an int or -1 on error.


Generated on Tue Nov 11 14:59:47 2003 for xmlcpg by doxygen1.2.18