kgio.git  about / heads / tags
kinder, gentler I/O for Ruby
blob 014e4b8b9104b5b8d945ef645b89eca7fd0dfa7f 470 bytes (raw)
$ git show v2.3.0:ext/kgio/ancient_ruby.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
 
#ifndef MISSING_ANCIENT_RUBY_H
#define MISSING_ANCIENT_RUBY_H

#ifndef HAVE_RB_STR_SET_LEN
static void rb_str_set_len(VALUE str, long len)
{
	RSTRING(str)->len = len;
	RSTRING(str)->ptr[len] = '\0';
}
#endif /* ! HAVE_RB_STR_SET_LEN */

#ifndef RSTRING_PTR
#  define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif /* !defined(RSTRING_PTR) */
#ifndef RSTRING_LEN
#  define RSTRING_LEN(s) (RSTRING(s)->len)
#endif /* !defined(RSTRING_LEN) */

#endif /* MISSING_ANCIENT_RUBY_H */

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