blob: 7a6d79ffd00e4808ee301813e3fe4093ddca7546 (
plain) (
blame)
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
61
|
/* The Stream class definition -- libwww
STREAM OBJECT DEFINITION
A Stream object is something which accepts a stream of text.
The creation methods will vary on the type of Stream Object. All creation
methods return a pointer to the stream type below.
As you can see, but the methods used to write to the stream and close it are
pointed to be the object itself.
*/
#ifndef HTSTREAM_H
#define HTSTREAM_H
#ifndef HTUTILS_H
#include <HTUtils.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _HTStream HTStream;
/*
These are the common methods of all streams. They should be
self-explanatory.
*/
typedef struct _HTStreamClass {
const char *name; /* Just for diagnostics */
void (*_free) (HTStream *me);
void (*_abort) (HTStream *me, HTError e);
void (*put_character) (HTStream *me, char ch);
void (*put_string) (HTStream *me, const char *str);
void (*put_block) (HTStream *me, const char *str, int len);
} HTStreamClass;
/*
Generic Error Stream
The Error stream simply signals an error on all output methods.
This can be used to stop a stream as soon as data arrives, for
example from the network.
*/
extern HTStream *HTErrorStream(void);
#ifdef __cplusplus
}
#endif
#endif /* HTSTREAM_H */
|