-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchan.c
More file actions
49 lines (40 loc) · 906 Bytes
/
chan.c
File metadata and controls
49 lines (40 loc) · 906 Bytes
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
#include "chan.h"
#include "supervisor.h"
#include "common.h"
#include <sys/types.h>
#include <sys/stat.h>
#define HANDLE_NULL ((chan_t) 0x0000000000000000ull)
#define HANDLE_MAGIC_MASK ((chan_t) 0xFF00000000000000ull)
#define HANDLE_MAGIC_BITS ((chan_t) 0xBB00000000000000ull)
/*
static inline bool handle_check_magic(const chan_t ch)
{
return (ch & HANDLE_MAGIC_MASK) != HANDLE_MAGIC_BITS;
}
static inline size_t handle_remove_magic(const chan_t ch)
{
return (size_t) (ch ^ HANDLE_MAGIC_BITS);
}
static inline chan_t handle_put_magic(const size_t idx)
{
return (chan_t) idx | HANDLE_MAGIC_BITS;
}
*/
#define MAX_CHANS ((size_t) 4096)
chan_t chan_new(void)
{
return HANDLE_NULL;
}
/*
bool chan_open(const chan_t ch, const char *const name)
{
}
bool chan_readline(const chan_t ch, const char **line)
{
}
*/
bool chan_del(const chan_t ch)
{
(void) ch;
return false;
}