Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
e74f7fd8
Commit
e74f7fd8
authored
Sep 01, 1998
by
Niels Möller
Browse files
New conventions for the return values from abstract_read-functions.
Rev: src/abstract_io.h:1.3
parent
6b970606
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/abstract_io.h
View file @
e74f7fd8
...
...
@@ -11,6 +11,16 @@
struct
abstract_read
;
typedef
int
(
*
abstract_read_f
)(
struct
abstract_read
*
closure
,
UINT8
*
buffer
,
UINT32
length
);
/* A read-function returning n means:
*
* n > 0: n bytes were read successfully.
* n = 0: No more data available, without blocking.
* n = -1: Read failed.
* n = -2: EOF.
*/
#define A_FAIL -1
#define A_EOF -2
struct
abstract_read
{
abstract_read_f
read
;
...
...
@@ -26,6 +36,9 @@ struct read_handler
#define READ_HANDLER(handler, read) ((handler)->handler((handler), (read)))
/* FIXME: What should writers return? Perhaps a new writer,
* analogous to read-handlers? */
struct
abstract_write
;
typedef
int
(
*
abstract_write_f
)(
struct
abstract_write
*
closure
,
struct
lsh_string
*
packet
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment