mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
wip on intellisense (again)
This commit is contained in:
parent
9841e2186a
commit
7642710155
18 changed files with 242 additions and 52 deletions
|
@ -36,25 +36,28 @@ struct IoctlPtmGet {
|
|||
char theduxname[16];
|
||||
char workername[16];
|
||||
};
|
||||
enum FdKind {
|
||||
kFdEmpty,
|
||||
kFdFile,
|
||||
kFdSocket,
|
||||
kFdProcess,
|
||||
kFdConsole,
|
||||
kFdSerial,
|
||||
kFdZip,
|
||||
kFdEpoll,
|
||||
};
|
||||
|
||||
struct Fd {
|
||||
int64_t handle;
|
||||
int64_t extra;
|
||||
int kind;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
struct Fds {
|
||||
size_t f; // lowest free slot
|
||||
size_t n; // monotonic capacity
|
||||
struct Fd {
|
||||
int64_t handle;
|
||||
int64_t extra;
|
||||
enum FdKind {
|
||||
kFdEmpty,
|
||||
kFdFile,
|
||||
kFdSocket,
|
||||
kFdProcess,
|
||||
kFdConsole,
|
||||
kFdSerial,
|
||||
kFdZip,
|
||||
kFdEpoll,
|
||||
} kind;
|
||||
unsigned flags;
|
||||
} * p;
|
||||
struct Fd * p;
|
||||
struct Fd __init_p[OPEN_MAX];
|
||||
};
|
||||
|
||||
|
@ -76,7 +79,7 @@ forceinline bool __isfdopen(int fd) {
|
|||
return 0 <= fd && fd < g_fds.n && g_fds.p[fd].kind != kFdEmpty;
|
||||
}
|
||||
|
||||
forceinline bool __isfdkind(int fd, enum FdKind kind) {
|
||||
forceinline bool __isfdkind(int fd, int kind) {
|
||||
return 0 <= fd && fd < g_fds.n && g_fds.p[fd].kind == kind;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue