kgio.git  about / heads / tags
kinder, gentler I/O for Ruby
blob 9056cef8baef5393b472837aae8817abbb69ad09 993 bytes (raw)
$ git show 2.4-stable:ext/kgio/kgio.h	# shows this blob on the CLI

 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 KGIO_H
#define KGIO_H

#include <ruby.h>
#ifdef HAVE_RUBY_IO_H
#  include <ruby/io.h>
#else
#  include <rubyio.h>
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <assert.h>
#include <netdb.h>

#include "ancient_ruby.h"
#include "nonblock.h"
#include "my_fileno.h"

struct io_args {
	VALUE io;
	VALUE buf;
	char *ptr;
	long len;
	int fd;
};

void init_kgio_wait(void);
void init_kgio_read_write(void);
void init_kgio_accept(void);
void init_kgio_connect(void);
void init_kgio_autopush(void);
void init_kgio_poll(void);

void kgio_autopush_accept(VALUE, VALUE);
void kgio_autopush_recv(VALUE);
void kgio_autopush_send(VALUE);

VALUE kgio_call_wait_writable(VALUE io);
VALUE kgio_call_wait_readable(VALUE io);
#if defined(HAVE_RB_THREAD_BLOCKING_REGION) && defined(HAVE_POLL)
#  define USE_KGIO_POLL
#endif /* USE_KGIO_POLL */

#endif /* KGIO_H */

git clone git://yhbt.net/kgio.git
git clone https://yhbt.net/kgio.git