7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
54
55
56
57
58
59
60
61
62
63
64
|
* platform-specific code is found in the *.platform.h
* files.
*/
#include <k/str.h>
#include <k/type.h>
#include <k/mem.h>
typedef enum kiostream_kind {
kiostream_closed,
// this kiostream cannot be written to
kiostream_file,
// this kiostream represents a file
kiostream_sock,
................................................................................
// UNIX, IP, or otherwise
kiostream_term,
// this socket is being used to communicate
// directly with a human being
kiostream_ansi,
// like kiostream_term, but can also understand
// ANSI control codes
kiostream_other
// no fuckin idea
} kiostream_kind;
typedef struct kiostream {
kiostream_kind kind;
#include "kiostream.platform.h"
................................................................................
kiocond_fail, // action failed - unspecified reason
kiocond_fail_closed_stream, // action failed because stream is closed
} kiocond;
kiocond kiosend(kiochan, ksraw, sz*); // send data to a channel
kiocond kiorecv(kiochan, ksraw*); // receive data from a channel
kmptr kiorecvall(kiochan, kmcell*, kmkind); // automatically allocate a bufer for a channel
// kmkind is only used if kmcell* is NULL
kiocond kiocon(kiochan, kiochan); // connect one channel to another
#endif
|
|
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
* platform-specific code is found in the *.platform.h
* files.
*/
#include <k/str.h>
#include <k/type.h>
#include <k/mem.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum kiostream_kind {
kiostream_closed,
// this kiostream cannot be written to
kiostream_file,
// this kiostream represents a file
kiostream_sock,
................................................................................
// UNIX, IP, or otherwise
kiostream_term,
// this socket is being used to communicate
// directly with a human being
kiostream_ansi,
// like kiostream_term, but can also understand
// ANSI control codes
kiostream_pipe,
// this kiostream sends or receives data to
// another running process
kiostream_other
// no fuckin idea
} kiostream_kind;
typedef struct kiostream {
kiostream_kind kind;
#include "kiostream.platform.h"
................................................................................
kiocond_fail, // action failed - unspecified reason
kiocond_fail_closed_stream, // action failed because stream is closed
} kiocond;
kiocond kiosend(kiochan, ksraw, sz*); // send data to a channel
kiocond kiorecv(kiochan, ksraw*); // receive data from a channel
kmptr kiorecvall(kiochan, kmcell*, kmkind); // automatically allocate a bufer for a channel
// kmkind is only used if kmcell* is null
kiocond kiocon(kiochan, kiochan); // connect one channel to another
#ifdef __cplusplus
}
#endif
#endif
|