CoreFW  Diff

Differences From Artifact [80dfac9647]:

To Artifact [768e2d2979]:


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
#ifndef __COREFW_STREAM_H__
#define __COREFW_STREAM_H__

#include <unistd.h>

#include "class.h"
#include "object.h"


struct cfw_stream_ops {
	ssize_t (*read)(void*, void*, size_t);
	bool (*write)(void*, const void*, size_t);
	bool (*eof)(void*);
	void (*close)(void*);
};

typedef struct CFWStream {
	CFWObject obj;
	struct cfw_stream_ops *ops;


} CFWStream;

extern CFWClass *cfw_stream;
extern ssize_t cfw_stream_read(void*, void*, size_t);

extern bool cfw_stream_write(void*, const void*, size_t);
extern bool cfw_stream_write_string(void*, const char*);
extern bool cfw_stream_eof(void*);
extern void cfw_stream_close(void*);
#endif







>











>
>




>





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
#ifndef __COREFW_STREAM_H__
#define __COREFW_STREAM_H__

#include <unistd.h>

#include "class.h"
#include "object.h"
#include "string.h"

struct cfw_stream_ops {
	ssize_t (*read)(void*, void*, size_t);
	bool (*write)(void*, const void*, size_t);
	bool (*eof)(void*);
	void (*close)(void*);
};

typedef struct CFWStream {
	CFWObject obj;
	struct cfw_stream_ops *ops;
	char *cache;
	size_t cache_len;
} CFWStream;

extern CFWClass *cfw_stream;
extern ssize_t cfw_stream_read(void*, void*, size_t);
extern CFWString* cfw_stream_read_line(void*);
extern bool cfw_stream_write(void*, const void*, size_t);
extern bool cfw_stream_write_string(void*, const char*);
extern bool cfw_stream_eof(void*);
extern void cfw_stream_close(void*);
#endif