少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
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
50
 
#ifndef __MONO_METADATA_FDHANDLE_H__
#define __MONO_METADATA_FDHANDLE_H__
 
#include <config.h>
#include <glib.h>
 
#include "utils/refcount.h"
 
typedef enum {
    MONO_FDTYPE_FILE,
    MONO_FDTYPE_CONSOLE,
    MONO_FDTYPE_PIPE,
    MONO_FDTYPE_SOCKET,
    MONO_FDTYPE_COUNT
} MonoFDType;
 
typedef struct {
    MonoRefCount ref;
    MonoFDType type;
    gint fd;
} MonoFDHandle;
 
typedef struct {
    void (*close) (MonoFDHandle *fdhandle);
    void (*destroy) (MonoFDHandle *fdhandle);
} MonoFDHandleCallback;
 
void
mono_fdhandle_register (MonoFDType type, MonoFDHandleCallback *callback);
 
void
mono_fdhandle_init (MonoFDHandle *fdhandle, MonoFDType type, gint fd);
 
void
mono_fdhandle_insert (MonoFDHandle *fdhandle);
 
gboolean
mono_fdhandle_try_insert (MonoFDHandle *fdhandle);
 
gboolean
mono_fdhandle_lookup_and_ref (gint fd, MonoFDHandle **fdhandle);
 
void
mono_fdhandle_unref (MonoFDHandle *fdhandle);
 
gboolean
mono_fdhandle_close (gint fd);
 
#endif /* __MONO_METADATA_FDHANDLE_H__ */