Apply PIE to nghttpx
[platform/upstream/nghttp2.git] / third-party / mruby / mrbgems / mruby-io / include / mruby / ext / io.h
1 /*
2 ** io.h - IO class
3 */
4
5 #ifndef MRUBY_IO_H
6 #define MRUBY_IO_H
7
8 #if defined(__cplusplus)
9 extern "C" {
10 #endif
11
12 struct mrb_io {
13   int fd;   /* file descriptor, or -1 */
14   int fd2;  /* file descriptor to write if it's different from fd, or -1 */
15   int pid;  /* child's pid (for pipes)  */
16   unsigned int readable:1,
17                writable:1,
18                sync:1,
19                is_socket:1;
20 };
21
22 #define FMODE_READABLE             0x00000001
23 #define FMODE_WRITABLE             0x00000002
24 #define FMODE_READWRITE            (FMODE_READABLE|FMODE_WRITABLE)
25 #define FMODE_BINMODE              0x00000004
26 #define FMODE_APPEND               0x00000040
27 #define FMODE_CREATE               0x00000080
28 #define FMODE_TRUNC                0x00000800
29
30 #define E_IO_ERROR                 (mrb_class_get(mrb, "IOError"))
31 #define E_EOF_ERROR                (mrb_class_get(mrb, "EOFError"))
32
33 mrb_value mrb_io_fileno(mrb_state *mrb, mrb_value io);
34
35 #if defined(__cplusplus)
36 } /* extern "C" { */
37 #endif
38 #endif /* MRUBY_IO_H */