1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<HTML>
<HEAD>
<TITLE>The Stream class definition -- libwww</TITLE></HEAD>
<BODY>
<H1>Stream Object definition</H1>A Stream object is something which
accepts a stream of text.<P>
The creation methods will vary on
the type of Stream Object. All
creation methods return a pointer
to the stream type below.<P>
As you can see, but the methods used
to write to the stream and close
it are pointed to be the object itself.
<PRE>#ifndef HTSTREAM_H
#define HTSTREAM_H
#include "HTUtils.h"
typedef struct _HTStream HTStream;
</PRE>These are the common methods of all
streams. They should be self-explanatory,
except for end_document which must
be called before free. It should
be merged with free in fact: it
should be dummy for new streams.<P>
The put_block method was write, but
this upset systems whiuch had macros
for write().
<PRE>typedef struct _HTStreamClass {
char* name; /* Just for diagnostics */
void (*_free) PARAMS((
HTStream* me));
void (*abort) PARAMS((
HTStream* me,
HTError e));
void (*put_character) PARAMS((
HTStream* me,
char ch));
void (*put_string) PARAMS((
HTStream* me,
CONST char * str));
void (*put_block) PARAMS((
HTStream* me,
CONST char * str,
int len));
}HTStreamClass;
#endif /* HTSTREAM_H */
</PRE>end of HTStream.h</A></BODY>
</HTML>
|