[INTERPRETER]
* NEW: GB.Stream.Eof() is a new API that returns if there is something to read on a stream, by taking the 'Line Input' internal buffer into account. [GB.NET.CURL] * NEW: Now the Read event is raised again and again while there is something to read. git-svn-id: svn://localhost/gambas/trunk@5554 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
9c829d258e
commit
f79bde1d6a
3 changed files with 5 additions and 2 deletions
|
@ -187,13 +187,14 @@ void CURL_raise_connect(void *_object)
|
|||
|
||||
void CURL_raise_read(void *_object)
|
||||
{
|
||||
int len = GB.StringLength(THIS->data);
|
||||
GB.Raise(THIS, EVENT_READ, 0);
|
||||
if (THIS->data && GB.StringLength(THIS->data) != len)
|
||||
|
||||
if (!GB.Stream.Eof(&THIS->stream))
|
||||
{
|
||||
GB.Ref(THIS);
|
||||
GB.Post(CURL_raise_read, (intptr_t)THIS);
|
||||
}
|
||||
|
||||
GB.Unref(POINTER(&_object));
|
||||
}
|
||||
|
||||
|
|
|
@ -273,6 +273,7 @@ const void *const GAMBAS_Api[] =
|
|||
(void *)GB_StreamRead,
|
||||
(void *)GB_StreamWrite,
|
||||
(void *)STREAM_get_readable,
|
||||
(void *)STREAM_eof,
|
||||
|
||||
(void *)STRING_start_len,
|
||||
(void *)STRING_end,
|
||||
|
|
|
@ -1102,6 +1102,7 @@ typedef
|
|||
int (*Read)(GB_STREAM *stream, void *addr, int len);
|
||||
int (*Write)(GB_STREAM *stream, void *addr, int len);
|
||||
int (*GetReadable)(GB_STREAM *stream, int *len);
|
||||
bool (*Eof)(GB_STREAM *stream);
|
||||
}
|
||||
Stream;
|
||||
|
||||
|
|
Loading…
Reference in a new issue