2000-05-01 05:42:38 -04:00
|
|
|
/**********************************************************************
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2008-05-31 01:55:34 -04:00
|
|
|
ruby/ruby.h -
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
$Author$
|
|
|
|
created at: Thu Jun 10 14:26:32 JST 1993
|
|
|
|
|
2008-05-31 01:55:34 -04:00
|
|
|
Copyright (C) 1993-2008 Yukihiro Matsumoto
|
2000-05-01 05:42:38 -04:00
|
|
|
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
|
2000-05-09 00:53:16 -04:00
|
|
|
Copyright (C) 2000 Information-technology Promotion Agency, Japan
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2000-05-01 05:42:38 -04:00
|
|
|
**********************************************************************/
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2008-05-31 01:55:34 -04:00
|
|
|
#ifndef RUBY_RUBY_H
|
|
|
|
#define RUBY_RUBY_H 1
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
2005-09-14 09:41:02 -04:00
|
|
|
#if 0
|
|
|
|
} /* satisfy cc-mode */
|
|
|
|
#endif
|
1999-01-19 23:59:39 -05:00
|
|
|
#endif
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2008-05-31 01:55:34 -04:00
|
|
|
#ifndef RUBY_LIB
|
2007-06-09 23:06:15 -04:00
|
|
|
#include "ruby/config.h"
|
2006-05-25 19:44:08 -04:00
|
|
|
#ifdef RUBY_EXTCONF_H
|
|
|
|
#include RUBY_EXTCONF_H
|
|
|
|
#endif
|
2008-05-31 01:55:34 -04:00
|
|
|
#endif
|
2005-07-02 04:11:24 -04:00
|
|
|
|
2005-07-25 08:29:37 -04:00
|
|
|
#define NORETURN_STYLE_NEW 1
|
|
|
|
#ifndef NORETURN
|
|
|
|
# define NORETURN(x) x
|
|
|
|
#endif
|
|
|
|
#ifndef DEPRECATED
|
|
|
|
# define DEPRECATED(x) x
|
|
|
|
#endif
|
2005-07-02 04:11:24 -04:00
|
|
|
#ifndef NOINLINE
|
|
|
|
# define NOINLINE(x) x
|
|
|
|
#endif
|
|
|
|
|
2005-09-13 07:26:42 -04:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define PRINTF_ARGS(decl, string_index, first_to_check) \
|
|
|
|
decl __attribute__((format(printf, string_index, first_to_check)))
|
|
|
|
#else
|
|
|
|
#define PRINTF_ARGS(decl, string_index, first_to_check) decl
|
|
|
|
#endif
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
# include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
1998-01-16 07:19:22 -05:00
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
# include <string.h>
|
|
|
|
#else
|
|
|
|
# include <strings.h>
|
|
|
|
#endif
|
|
|
|
|
2003-12-22 03:23:55 -05:00
|
|
|
#ifdef HAVE_INTRINSICS_H
|
|
|
|
# include <intrinsics.h>
|
|
|
|
#endif
|
|
|
|
|
2008-03-14 04:04:45 -04:00
|
|
|
#ifdef HAVE_INTTYPES_H
|
|
|
|
# include <inttypes.h>
|
|
|
|
#endif
|
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2005-12-06 02:52:18 -05:00
|
|
|
#include "defines.h"
|
|
|
|
|
2003-12-10 21:39:59 -05:00
|
|
|
#if defined(HAVE_ALLOCA_H)
|
1998-01-16 07:13:05 -05:00
|
|
|
#include <alloca.h>
|
2006-08-06 23:37:47 -04:00
|
|
|
#else
|
|
|
|
# ifdef _AIX
|
1998-01-16 07:13:05 -05:00
|
|
|
#pragma alloca
|
2006-08-06 23:37:47 -04:00
|
|
|
# endif
|
1998-01-16 07:13:05 -05:00
|
|
|
#endif
|
|
|
|
|
2002-03-22 02:26:42 -05:00
|
|
|
#if defined(__VMS)
|
|
|
|
# pragma builtins
|
|
|
|
# define alloca __alloca
|
|
|
|
#endif
|
|
|
|
|
2005-07-26 05:16:37 -04:00
|
|
|
#if SIZEOF_LONG == SIZEOF_VOIDP
|
1999-01-19 23:59:39 -05:00
|
|
|
typedef unsigned long VALUE;
|
1999-12-14 01:50:43 -05:00
|
|
|
typedef unsigned long ID;
|
2006-07-11 01:00:02 -04:00
|
|
|
# define SIGNED_VALUE long
|
2006-07-11 02:47:09 -04:00
|
|
|
# define SIZEOF_VALUE SIZEOF_LONG
|
2008-07-12 09:17:29 -04:00
|
|
|
# define PRI_VALUE_PREFIX "l"
|
2005-07-26 05:16:37 -04:00
|
|
|
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
2005-07-27 03:27:19 -04:00
|
|
|
typedef unsigned LONG_LONG VALUE;
|
|
|
|
typedef unsigned LONG_LONG ID;
|
2006-07-11 01:00:02 -04:00
|
|
|
# define SIGNED_VALUE LONG_LONG
|
|
|
|
# define LONG_LONG_VALUE 1
|
2006-07-11 02:47:09 -04:00
|
|
|
# define SIZEOF_VALUE SIZEOF_LONG_LONG
|
2008-07-12 09:17:29 -04:00
|
|
|
# define PRI_VALUE_PREFIX "ll"
|
2005-07-26 05:16:37 -04:00
|
|
|
#else
|
|
|
|
# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
|
|
|
|
#endif
|
2008-07-12 09:17:29 -04:00
|
|
|
#define PRIdVALUE PRI_VALUE_PREFIX"d"
|
|
|
|
#define PRIiVALUE PRI_VALUE_PREFIX"i"
|
|
|
|
#define PRIoVALUE PRI_VALUE_PREFIX"o"
|
|
|
|
#define PRIuVALUE PRI_VALUE_PREFIX"u"
|
|
|
|
#define PRIxVALUE PRI_VALUE_PREFIX"x"
|
|
|
|
#define PRIXVALUE PRI_VALUE_PREFIX"X"
|
|
|
|
|
|
|
|
#if SIZEOF_PTRDIFF_T == SIZEOF_INT
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_PTRDIFF_PREFIX
|
2008-07-12 09:17:29 -04:00
|
|
|
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_PTRDIFF_PREFIX "l"
|
2008-07-12 16:39:02 -04:00
|
|
|
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_PTRDIFF_PREFIX "ll"
|
2008-07-12 09:17:29 -04:00
|
|
|
#endif
|
|
|
|
#define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
|
|
|
|
#define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i"
|
|
|
|
#define PRIoPTRDIFF PRI_PTRDIFF_PREFIX"o"
|
|
|
|
#define PRIuPTRDIFF PRI_PTRDIFF_PREFIX"u"
|
|
|
|
#define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
|
|
|
|
#define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
|
|
|
|
|
|
|
|
#if SIZEOF_SIZE_T == SIZEOF_INT
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_SIZE_PREFIX
|
2008-07-12 09:17:29 -04:00
|
|
|
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_SIZE_PREFIX "l"
|
2008-07-12 16:39:02 -04:00
|
|
|
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
|
2008-07-12 09:41:42 -04:00
|
|
|
# define PRI_SIZE_PREFIX "ll"
|
2008-07-12 09:17:29 -04:00
|
|
|
#endif
|
|
|
|
#define PRIdSIZE PRI_SIZE_PREFIX"d"
|
|
|
|
#define PRIiSIZE PRI_SIZE_PREFIX"i"
|
|
|
|
#define PRIoSIZE PRI_SIZE_PREFIX"o"
|
|
|
|
#define PRIuSIZE PRI_SIZE_PREFIX"u"
|
|
|
|
#define PRIxSIZE PRI_SIZE_PREFIX"x"
|
|
|
|
#define PRIXSIZE PRI_SIZE_PREFIX"X"
|
2006-07-11 02:47:09 -04:00
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
#ifdef __STDC__
|
|
|
|
# include <limits.h>
|
|
|
|
#else
|
|
|
|
# ifndef LONG_MAX
|
|
|
|
# ifdef HAVE_LIMITS_H
|
|
|
|
# include <limits.h>
|
|
|
|
# else
|
1999-01-19 23:59:39 -05:00
|
|
|
/* assuming 32bit(2's compliment) long */
|
|
|
|
# define LONG_MAX 2147483647
|
1998-01-16 07:13:05 -05:00
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
# ifndef LONG_MIN
|
1999-01-19 23:59:39 -05:00
|
|
|
# define LONG_MIN (-LONG_MAX-1)
|
1998-01-16 07:13:05 -05:00
|
|
|
# endif
|
|
|
|
# ifndef CHAR_BIT
|
|
|
|
# define CHAR_BIT 8
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2006-07-31 02:34:10 -04:00
|
|
|
#ifdef HAVE_LONG_LONG
|
2002-03-14 01:23:46 -05:00
|
|
|
# ifndef LLONG_MAX
|
|
|
|
# ifdef LONG_LONG_MAX
|
|
|
|
# define LLONG_MAX LONG_LONG_MAX
|
|
|
|
# else
|
* bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15 03:51:31 -05:00
|
|
|
# ifdef _I64_MAX
|
|
|
|
# define LLONG_MAX _I64_MAX
|
|
|
|
# else
|
2002-03-14 01:23:46 -05:00
|
|
|
/* assuming 64bit(2's complement) long long */
|
* bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15 03:51:31 -05:00
|
|
|
# define LLONG_MAX 9223372036854775807LL
|
|
|
|
# endif
|
2002-03-14 01:23:46 -05:00
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
# ifndef LLONG_MIN
|
|
|
|
# ifdef LONG_LONG_MIN
|
|
|
|
# define LLONG_MIN LONG_LONG_MIN
|
|
|
|
# else
|
* bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15 03:51:31 -05:00
|
|
|
# ifdef _I64_MIN
|
2003-07-29 04:28:54 -04:00
|
|
|
# define LLONG_MIN _I64_MIN
|
* bignum.c, intern.h (rb_ull2big, rb_ll2big, rb_ull2inum, rb_ll2inum,
big2ull, rb_big2ull, rb_big2ll): use LONG_LONG macro instead of
long long.
* numeric.c, intern.h, ruby.h (rb_num2ll, rb_num2ull): ditto.
* ruby.h: use _I64_MAX and _I64_MIN if they are defined (for VC++).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-15 03:51:31 -05:00
|
|
|
# else
|
|
|
|
# define LLONG_MIN (-LLONG_MAX-1)
|
|
|
|
# endif
|
2002-03-14 01:23:46 -05:00
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2007-06-26 02:23:34 -04:00
|
|
|
#define FIXNUM_MAX (LONG_MAX>>1)
|
|
|
|
#define FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2006-07-11 01:00:02 -04:00
|
|
|
#define INT2FIX(i) ((VALUE)(((SIGNED_VALUE)(i))<<1 | FIXNUM_FLAG))
|
2001-05-30 05:12:34 -04:00
|
|
|
#define LONG2FIX(i) INT2FIX(i)
|
2000-02-17 02:11:22 -05:00
|
|
|
#define rb_fix_new(v) INT2FIX(v)
|
2006-07-11 01:00:02 -04:00
|
|
|
VALUE rb_int2inum(SIGNED_VALUE);
|
1999-01-19 23:59:39 -05:00
|
|
|
#define INT2NUM(v) rb_int2inum(v)
|
2001-05-02 00:22:21 -04:00
|
|
|
#define LONG2NUM(v) INT2NUM(v)
|
2000-02-17 02:11:22 -05:00
|
|
|
#define rb_int_new(v) rb_int2inum(v)
|
2006-07-11 01:00:02 -04:00
|
|
|
VALUE rb_uint2inum(VALUE);
|
1999-12-14 01:50:43 -05:00
|
|
|
#define UINT2NUM(v) rb_uint2inum(v)
|
2001-05-02 00:22:21 -04:00
|
|
|
#define ULONG2NUM(v) UINT2NUM(v)
|
2000-02-17 02:11:22 -05:00
|
|
|
#define rb_uint_new(v) rb_uint2inum(v)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2006-07-31 02:34:10 -04:00
|
|
|
#ifdef HAVE_LONG_LONG
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_ll2inum(LONG_LONG);
|
2002-03-14 01:23:46 -05:00
|
|
|
#define LL2NUM(v) rb_ll2inum(v)
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_ull2inum(unsigned LONG_LONG);
|
2002-03-14 01:23:46 -05:00
|
|
|
#define ULL2NUM(v) rb_ull2inum(v)
|
|
|
|
#endif
|
|
|
|
|
2002-03-27 00:28:00 -05:00
|
|
|
#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
|
2002-03-14 01:23:46 -05:00
|
|
|
# define OFFT2NUM(v) LL2NUM(v)
|
2006-12-04 03:06:32 -05:00
|
|
|
#elif SIZEOF_OFF_T == SIZEOF_LONG
|
|
|
|
# define OFFT2NUM(v) LONG2NUM(v)
|
2002-03-14 01:23:46 -05:00
|
|
|
#else
|
|
|
|
# define OFFT2NUM(v) INT2NUM(v)
|
|
|
|
#endif
|
|
|
|
|
2008-05-11 01:44:36 -04:00
|
|
|
#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
|
|
|
|
# define SIZET2NUM(v) ULL2NUM(v)
|
|
|
|
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
|
|
|
# define SIZET2NUM(v) ULONG2NUM(v)
|
|
|
|
#else
|
|
|
|
# define SIZET2NUM(v) UINT2NUM(v)
|
|
|
|
#endif
|
|
|
|
|
2007-02-19 08:16:12 -05:00
|
|
|
#ifndef PIDT2NUM
|
|
|
|
#define PIDT2NUM(v) LONG2NUM(v)
|
|
|
|
#endif
|
|
|
|
#ifndef NUM2PIDT
|
|
|
|
#define NUM2PIDT(v) NUM2LONG(v)
|
|
|
|
#endif
|
|
|
|
#ifndef UIDT2NUM
|
|
|
|
#define UIDT2NUM(v) LONG2NUM(v)
|
|
|
|
#endif
|
|
|
|
#ifndef NUM2UIDT
|
|
|
|
#define NUM2UIDT(v) NUM2LONG(v)
|
|
|
|
#endif
|
|
|
|
#ifndef GIDT2NUM
|
|
|
|
#define GIDT2NUM(v) LONG2NUM(v)
|
|
|
|
#endif
|
|
|
|
#ifndef NUM2GIDT
|
|
|
|
#define NUM2GIDT(v) NUM2LONG(v)
|
|
|
|
#endif
|
|
|
|
|
2006-07-12 11:54:53 -04:00
|
|
|
#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
|
2007-07-11 16:35:10 -04:00
|
|
|
#define FIX2ULONG(x) ((((VALUE)(x))>>1)&LONG_MAX)
|
2006-07-12 11:54:53 -04:00
|
|
|
#define FIXNUM_P(f) (((SIGNED_VALUE)(f))&FIXNUM_FLAG)
|
2008-04-28 01:25:03 -04:00
|
|
|
#define POSFIXABLE(f) ((f) < FIXNUM_MAX+1)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define NEGFIXABLE(f) ((f) >= FIXNUM_MIN)
|
|
|
|
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
|
|
|
|
|
2000-03-07 03:37:59 -05:00
|
|
|
#define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK)
|
|
|
|
|
2007-08-07 00:58:07 -04:00
|
|
|
#define SYMBOL_P(x) (((VALUE)(x)&~(~(VALUE)0<<RUBY_SPECIAL_SHIFT))==SYMBOL_FLAG)
|
|
|
|
#define ID2SYM(x) (((VALUE)(x)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
|
|
|
|
#define SYM2ID(x) RSHIFT((unsigned long)x,RUBY_SPECIAL_SHIFT)
|
2000-03-07 03:37:59 -05:00
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
/* special contants - i.e. non-zero and non-fixnum constants */
|
2007-07-04 21:42:09 -04:00
|
|
|
enum ruby_special_consts {
|
|
|
|
RUBY_Qfalse = 0,
|
|
|
|
RUBY_Qtrue = 2,
|
|
|
|
RUBY_Qnil = 4,
|
|
|
|
RUBY_Qundef = 6,
|
|
|
|
|
|
|
|
RUBY_IMMEDIATE_MASK = 0x03,
|
|
|
|
RUBY_FIXNUM_FLAG = 0x01,
|
|
|
|
RUBY_SYMBOL_FLAG = 0x0e,
|
2008-07-01 04:27:58 -04:00
|
|
|
RUBY_SPECIAL_SHIFT = 8
|
2007-07-04 21:42:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define Qfalse ((VALUE)RUBY_Qfalse)
|
|
|
|
#define Qtrue ((VALUE)RUBY_Qtrue)
|
|
|
|
#define Qnil ((VALUE)RUBY_Qnil)
|
|
|
|
#define Qundef ((VALUE)RUBY_Qundef) /* undefined value for placeholder */
|
|
|
|
#define IMMEDIATE_MASK RUBY_IMMEDIATE_MASK
|
|
|
|
#define FIXNUM_FLAG RUBY_FIXNUM_FLAG
|
|
|
|
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2000-09-25 05:15:08 -04:00
|
|
|
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define NIL_P(v) ((VALUE)(v) == Qnil)
|
|
|
|
|
|
|
|
#define CLASS_OF(v) rb_class_of((VALUE)(v))
|
|
|
|
|
2007-07-04 21:42:09 -04:00
|
|
|
enum ruby_value_type {
|
|
|
|
RUBY_T_NONE = 0x00,
|
|
|
|
|
2008-04-26 04:32:23 -04:00
|
|
|
RUBY_T_OBJECT = 0x01,
|
|
|
|
RUBY_T_CLASS = 0x02,
|
|
|
|
RUBY_T_MODULE = 0x03,
|
|
|
|
RUBY_T_FLOAT = 0x04,
|
|
|
|
RUBY_T_STRING = 0x05,
|
|
|
|
RUBY_T_REGEXP = 0x06,
|
|
|
|
RUBY_T_ARRAY = 0x07,
|
|
|
|
RUBY_T_HASH = 0x08,
|
|
|
|
RUBY_T_STRUCT = 0x09,
|
|
|
|
RUBY_T_BIGNUM = 0x0a,
|
|
|
|
RUBY_T_FILE = 0x0b,
|
|
|
|
RUBY_T_DATA = 0x0c,
|
|
|
|
RUBY_T_MATCH = 0x0d,
|
|
|
|
RUBY_T_COMPLEX = 0x0e,
|
|
|
|
RUBY_T_RATIONAL = 0x0f,
|
|
|
|
|
|
|
|
RUBY_T_NIL = 0x11,
|
|
|
|
RUBY_T_TRUE = 0x12,
|
|
|
|
RUBY_T_FALSE = 0x13,
|
|
|
|
RUBY_T_SYMBOL = 0x14,
|
|
|
|
RUBY_T_FIXNUM = 0x15,
|
|
|
|
|
|
|
|
RUBY_T_UNDEF = 0x1b,
|
|
|
|
RUBY_T_NODE = 0x1c,
|
|
|
|
RUBY_T_ICLASS = 0x1d,
|
2008-07-27 01:59:32 -04:00
|
|
|
RUBY_T_DEFERRED = 0x1e,
|
2008-04-26 04:32:23 -04:00
|
|
|
|
2008-07-01 04:27:58 -04:00
|
|
|
RUBY_T_MASK = 0x1f
|
2008-04-26 04:32:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define T_NONE RUBY_T_NONE
|
2007-07-04 21:42:09 -04:00
|
|
|
#define T_NIL RUBY_T_NIL
|
|
|
|
#define T_OBJECT RUBY_T_OBJECT
|
|
|
|
#define T_CLASS RUBY_T_CLASS
|
|
|
|
#define T_ICLASS RUBY_T_ICLASS
|
|
|
|
#define T_MODULE RUBY_T_MODULE
|
|
|
|
#define T_FLOAT RUBY_T_FLOAT
|
|
|
|
#define T_STRING RUBY_T_STRING
|
|
|
|
#define T_REGEXP RUBY_T_REGEXP
|
|
|
|
#define T_ARRAY RUBY_T_ARRAY
|
|
|
|
#define T_HASH RUBY_T_HASH
|
|
|
|
#define T_STRUCT RUBY_T_STRUCT
|
|
|
|
#define T_BIGNUM RUBY_T_BIGNUM
|
|
|
|
#define T_FILE RUBY_T_FILE
|
2008-04-26 04:32:23 -04:00
|
|
|
#define T_FIXNUM RUBY_T_FIXNUM
|
2007-07-04 21:42:09 -04:00
|
|
|
#define T_TRUE RUBY_T_TRUE
|
|
|
|
#define T_FALSE RUBY_T_FALSE
|
|
|
|
#define T_DATA RUBY_T_DATA
|
|
|
|
#define T_MATCH RUBY_T_MATCH
|
|
|
|
#define T_SYMBOL RUBY_T_SYMBOL
|
2008-03-15 20:23:43 -04:00
|
|
|
#define T_RATIONAL RUBY_T_RATIONAL
|
|
|
|
#define T_COMPLEX RUBY_T_COMPLEX
|
2007-07-04 21:42:09 -04:00
|
|
|
#define T_UNDEF RUBY_T_UNDEF
|
|
|
|
#define T_NODE RUBY_T_NODE
|
2008-07-27 01:59:32 -04:00
|
|
|
#define T_DEFERRED RUBY_T_DEFERRED
|
2007-07-04 21:42:09 -04:00
|
|
|
#define T_MASK RUBY_T_MASK
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#define BUILTIN_TYPE(x) (((struct RBasic*)(x))->flags & T_MASK)
|
|
|
|
|
|
|
|
#define TYPE(x) rb_type((VALUE)(x))
|
|
|
|
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 04:12:18 -04:00
|
|
|
#define RB_GC_GUARD(v) (*(volatile VALUE *)&(v))
|
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_check_type(VALUE,int);
|
1998-01-16 07:13:05 -05:00
|
|
|
#define Check_Type(v,t) rb_check_type((VALUE)(v),t)
|
2001-05-02 00:22:21 -04:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_str_to_str(VALUE);
|
|
|
|
VALUE rb_string_value(volatile VALUE*);
|
|
|
|
char *rb_string_value_ptr(volatile VALUE*);
|
|
|
|
char *rb_string_value_cstr(volatile VALUE*);
|
2001-05-11 01:24:59 -04:00
|
|
|
|
2003-06-23 02:52:39 -04:00
|
|
|
#define StringValue(v) rb_string_value(&(v))
|
2003-03-24 04:38:37 -05:00
|
|
|
#define StringValuePtr(v) rb_string_value_ptr(&(v))
|
2003-07-20 13:17:52 -04:00
|
|
|
#define StringValueCStr(v) rb_string_value_cstr(&(v))
|
2003-03-24 04:38:37 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_check_safe_obj(VALUE);
|
|
|
|
void rb_check_safe_str(VALUE);
|
2001-05-02 00:22:21 -04:00
|
|
|
#define SafeStringValue(v) do {\
|
2001-05-11 01:24:59 -04:00
|
|
|
StringValue(v);\
|
2003-03-24 04:38:37 -05:00
|
|
|
rb_check_safe_obj(v);\
|
2001-03-28 03:43:25 -05:00
|
|
|
} while (0)
|
2001-05-11 01:24:59 -04:00
|
|
|
/* obsolete macro - use SafeStringValue(v) */
|
|
|
|
#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
|
2001-05-02 00:22:21 -04:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_get_path(VALUE);
|
2004-04-07 02:30:15 -04:00
|
|
|
#define FilePathValue(v) ((v) = rb_get_path(v))
|
|
|
|
|
2007-12-09 00:12:31 -05:00
|
|
|
VALUE rb_get_path_no_checksafe(VALUE);
|
|
|
|
#define FilePathStringValue(v) ((v) = rb_get_path_no_checksafe(v))
|
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_secure(int);
|
2007-03-18 23:58:57 -04:00
|
|
|
int rb_safe_level(void);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_set_safe_level(int);
|
2006-12-31 10:02:22 -05:00
|
|
|
void rb_set_safe_level_force(int);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_secure_update(VALUE);
|
2000-01-31 22:12:21 -05:00
|
|
|
|
2006-12-31 10:02:22 -05:00
|
|
|
VALUE rb_errinfo(void);
|
|
|
|
void rb_set_errinfo(VALUE);
|
|
|
|
|
2006-07-11 02:47:09 -04:00
|
|
|
SIGNED_VALUE rb_num2long(VALUE);
|
|
|
|
VALUE rb_num2ulong(VALUE);
|
1999-08-13 01:45:20 -04:00
|
|
|
#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x))
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NUM2ULONG(x) rb_num2ulong((VALUE)x)
|
|
|
|
#if SIZEOF_INT < SIZEOF_LONG
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
long rb_num2int(VALUE);
|
2008-07-05 10:47:06 -04:00
|
|
|
#define NUM2INT(x) ((int)(FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x)))
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
long rb_fix2int(VALUE);
|
2008-07-05 10:47:06 -04:00
|
|
|
#define FIX2INT(x) ((int)rb_fix2int((VALUE)x))
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
unsigned long rb_num2uint(VALUE);
|
2008-07-05 10:47:06 -04:00
|
|
|
#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
unsigned long rb_fix2uint(VALUE);
|
2008-07-05 10:47:06 -04:00
|
|
|
#define FIX2UINT(x) ((unsigned int)rb_fix2uint(x))
|
1999-01-19 23:59:39 -05:00
|
|
|
#else
|
2002-10-29 16:35:28 -05:00
|
|
|
#define NUM2INT(x) ((int)NUM2LONG(x))
|
|
|
|
#define NUM2UINT(x) ((unsigned int)NUM2ULONG(x))
|
|
|
|
#define FIX2INT(x) ((int)FIX2LONG(x))
|
|
|
|
#define FIX2UINT(x) ((unsigned int)FIX2ULONG(x))
|
1999-01-19 23:59:39 -05:00
|
|
|
#endif
|
|
|
|
|
2006-07-31 02:34:10 -04:00
|
|
|
#ifdef HAVE_LONG_LONG
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
LONG_LONG rb_num2ll(VALUE);
|
|
|
|
unsigned LONG_LONG rb_num2ull(VALUE);
|
2002-03-14 01:23:46 -05:00
|
|
|
# define NUM2LL(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2ll((VALUE)x))
|
2004-11-14 05:06:16 -05:00
|
|
|
# define NUM2ULL(x) rb_num2ull((VALUE)x)
|
2002-03-14 01:23:46 -05:00
|
|
|
#endif
|
|
|
|
|
2006-07-31 02:34:10 -04:00
|
|
|
#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG
|
2002-03-14 01:23:46 -05:00
|
|
|
# define NUM2OFFT(x) ((off_t)NUM2LL(x))
|
|
|
|
#else
|
|
|
|
# define NUM2OFFT(x) NUM2LONG(x)
|
|
|
|
#endif
|
|
|
|
|
2008-05-11 01:44:36 -04:00
|
|
|
#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG
|
|
|
|
# define NUM2SIZET(x) ((size_t)NUM2ULL(x))
|
|
|
|
#else
|
|
|
|
# define NUM2SIZET(x) NUM2ULONG(x)
|
|
|
|
#endif
|
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
double rb_num2dbl(VALUE);
|
1999-01-19 23:59:39 -05:00
|
|
|
#define NUM2DBL(x) rb_num2dbl((VALUE)(x))
|
|
|
|
|
2001-05-02 00:22:21 -04:00
|
|
|
/* obsolete API - use StringValue() */
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
char *rb_str2cstr(VALUE,long*);
|
2001-05-02 00:22:21 -04:00
|
|
|
/* obsolete API - use StringValuePtr() */
|
1999-01-19 23:59:39 -05:00
|
|
|
#define STR2CSTR(x) rb_str2cstr((VALUE)(x),0)
|
1998-01-16 07:19:22 -05:00
|
|
|
|
2006-08-31 06:47:44 -04:00
|
|
|
#define NUM2CHR(x) (((TYPE(x) == T_STRING)&&(RSTRING_LEN(x)>=1))?\
|
|
|
|
RSTRING_PTR(x)[0]:(char)(NUM2INT(x)&0xff))
|
1999-08-13 01:45:20 -04:00
|
|
|
#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_newobj(void);
|
1998-01-16 07:13:05 -05:00
|
|
|
#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
|
2002-04-24 00:54:16 -04:00
|
|
|
#define OBJSETUP(obj,c,t) do {\
|
1998-01-16 07:13:05 -05:00
|
|
|
RBASIC(obj)->flags = (t);\
|
2000-08-09 00:32:24 -04:00
|
|
|
RBASIC(obj)->klass = (c);\
|
1999-01-19 23:59:39 -05:00
|
|
|
if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT);\
|
2002-04-24 00:54:16 -04:00
|
|
|
} while (0)
|
1999-08-13 01:45:20 -04:00
|
|
|
#define CLONESETUP(clone,obj) do {\
|
2002-09-03 01:20:14 -04:00
|
|
|
OBJSETUP(clone,rb_singleton_class_clone((VALUE)obj),RBASIC(obj)->flags);\
|
1999-01-19 23:59:39 -05:00
|
|
|
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
|
2001-07-14 11:17:19 -04:00
|
|
|
if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)clone,(VALUE)obj);\
|
1999-08-13 01:45:20 -04:00
|
|
|
} while (0)
|
2001-12-10 02:18:16 -05:00
|
|
|
#define DUPSETUP(dup,obj) do {\
|
|
|
|
OBJSETUP(dup,rb_obj_class(obj),(RBASIC(obj)->flags)&(T_MASK|FL_EXIVAR|FL_TAINT));\
|
|
|
|
if (FL_TEST(obj, FL_EXIVAR)) rb_copy_generic_ivar((VALUE)dup,(VALUE)obj);\
|
|
|
|
} while (0)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RBasic {
|
2006-07-11 02:47:09 -04:00
|
|
|
VALUE flags;
|
1999-01-19 23:59:39 -05:00
|
|
|
VALUE klass;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
|
|
|
|
2007-09-28 02:21:46 -04:00
|
|
|
#define ROBJECT_EMBED_LEN_MAX 3
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RObject {
|
|
|
|
struct RBasic basic;
|
2007-09-28 02:21:46 -04:00
|
|
|
union {
|
|
|
|
struct {
|
2008-02-25 11:18:18 -05:00
|
|
|
long numiv;
|
|
|
|
VALUE *ivptr;
|
2008-02-13 06:52:46 -05:00
|
|
|
struct st_table *iv_index_tbl; /* shortcut for RCLASS_IV_INDEX_TBL(rb_obj_class(obj)) */
|
2007-09-28 02:21:46 -04:00
|
|
|
} heap;
|
|
|
|
VALUE ary[ROBJECT_EMBED_LEN_MAX];
|
|
|
|
} as;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2007-09-28 02:21:46 -04:00
|
|
|
#define ROBJECT_EMBED FL_USER1
|
2008-02-25 11:18:18 -05:00
|
|
|
#define ROBJECT_NUMIV(o) \
|
2007-09-28 02:21:46 -04:00
|
|
|
((RBASIC(o)->flags & ROBJECT_EMBED) ? \
|
|
|
|
ROBJECT_EMBED_LEN_MAX : \
|
2008-02-25 11:18:18 -05:00
|
|
|
ROBJECT(o)->as.heap.numiv)
|
|
|
|
#define ROBJECT_IVPTR(o) \
|
2007-09-28 02:21:46 -04:00
|
|
|
((RBASIC(o)->flags & ROBJECT_EMBED) ? \
|
|
|
|
ROBJECT(o)->as.ary : \
|
2008-02-25 11:18:18 -05:00
|
|
|
ROBJECT(o)->as.heap.ivptr)
|
2008-02-13 06:52:46 -05:00
|
|
|
#define ROBJECT_IV_INDEX_TBL(o) \
|
|
|
|
((RBASIC(o)->flags & ROBJECT_EMBED) ? \
|
|
|
|
RCLASS_IV_INDEX_TBL(rb_obj_class(o)) : \
|
|
|
|
ROBJECT(o)->as.heap.iv_index_tbl)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2007-09-28 02:21:46 -04:00
|
|
|
typedef struct {
|
|
|
|
VALUE super;
|
2007-09-28 07:57:30 -04:00
|
|
|
struct st_table *iv_tbl;
|
2007-09-28 02:21:46 -04:00
|
|
|
} rb_classext_t;
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RClass {
|
|
|
|
struct RBasic basic;
|
2007-09-28 02:21:46 -04:00
|
|
|
rb_classext_t *ptr;
|
1998-01-16 07:13:05 -05:00
|
|
|
struct st_table *m_tbl;
|
2007-09-28 02:21:46 -04:00
|
|
|
struct st_table *iv_index_tbl;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2007-09-28 02:21:46 -04:00
|
|
|
#define RCLASS_IV_TBL(c) (RCLASS(c)->ptr->iv_tbl)
|
|
|
|
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
|
|
|
|
#define RCLASS_SUPER(c) (RCLASS(c)->ptr->super)
|
|
|
|
#define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
|
|
|
|
#define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m)
|
|
|
|
#define RMODULE_M_TBL(m) RCLASS_M_TBL(m)
|
|
|
|
#define RMODULE_SUPER(m) RCLASS_SUPER(m)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RFloat {
|
|
|
|
struct RBasic basic;
|
2007-11-20 06:35:12 -05:00
|
|
|
double float_value;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2007-11-20 06:35:12 -05:00
|
|
|
#define RFLOAT_VALUE(v) (RFLOAT(v)->float_value)
|
* include/ruby/ruby.h: introduce 2 macros:
RFLOAT_VALUE(v), DOUBLE2NUM(dbl).
Rename RFloat#value -> RFloat#double_value.
Do not touch RFloat#double_value directly.
* bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c,
pack.c, parse.y, process.c, random.c, sprintf.c, string.c,
time.c: apply above changes.
* ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c:
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13 11:00:53 -05:00
|
|
|
#define DOUBLE2NUM(dbl) rb_float_new(dbl)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2001-12-10 02:18:16 -05:00
|
|
|
#define ELTS_SHARED FL_USER2
|
|
|
|
|
2006-08-31 06:47:44 -04:00
|
|
|
#define RSTRING_EMBED_LEN_MAX ((sizeof(VALUE)*3)/sizeof(char)-1)
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RString {
|
|
|
|
struct RBasic basic;
|
2001-12-10 02:18:16 -05:00
|
|
|
union {
|
2006-08-31 06:47:44 -04:00
|
|
|
struct {
|
* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
fixed indents and non-C90 comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 11:26:04 -05:00
|
|
|
long len;
|
|
|
|
char *ptr;
|
|
|
|
union {
|
|
|
|
long capa;
|
|
|
|
VALUE shared;
|
|
|
|
} aux;
|
2006-08-31 06:47:44 -04:00
|
|
|
} heap;
|
2008-07-31 00:19:01 -04:00
|
|
|
char ary[RSTRING_EMBED_LEN_MAX + 1];
|
2006-08-31 06:47:44 -04:00
|
|
|
} as;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2006-08-31 06:47:44 -04:00
|
|
|
#define RSTRING_NOEMBED FL_USER1
|
2006-09-01 09:08:29 -04:00
|
|
|
#define RSTRING_EMBED_LEN_MASK (FL_USER2|FL_USER3|FL_USER4|FL_USER5|FL_USER6)
|
2006-08-31 06:47:44 -04:00
|
|
|
#define RSTRING_EMBED_LEN_SHIFT (FL_USHIFT+2)
|
|
|
|
#define RSTRING_LEN(str) \
|
|
|
|
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
|
|
|
|
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
|
|
|
|
(RSTRING_EMBED_LEN_MASK >> RSTRING_EMBED_LEN_SHIFT)) : \
|
|
|
|
RSTRING(str)->as.heap.len)
|
|
|
|
#define RSTRING_PTR(str) \
|
|
|
|
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
|
|
|
|
RSTRING(str)->as.ary : \
|
|
|
|
RSTRING(str)->as.heap.ptr)
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24 23:29:39 -04:00
|
|
|
#define RSTRING_END(str) (RSTRING_PTR(str)+RSTRING_LEN(str))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RArray {
|
|
|
|
struct RBasic basic;
|
2006-11-01 09:42:39 -05:00
|
|
|
long len;
|
2001-12-10 02:18:16 -05:00
|
|
|
union {
|
2006-11-01 09:42:39 -05:00
|
|
|
long capa;
|
|
|
|
VALUE shared;
|
|
|
|
} aux;
|
|
|
|
VALUE *ptr;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2006-11-01 09:42:39 -05:00
|
|
|
#define RARRAY_LEN(a) RARRAY(a)->len
|
|
|
|
#define RARRAY_PTR(a) RARRAY(a)->ptr
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RRegexp {
|
|
|
|
struct RBasic basic;
|
|
|
|
struct re_pattern_buffer *ptr;
|
2008-06-28 08:25:45 -04:00
|
|
|
VALUE src;
|
|
|
|
unsigned long usecnt;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2008-06-28 08:25:45 -04:00
|
|
|
#define RREGEXP_SRC(r) RREGEXP(r)->src
|
|
|
|
#define RREGEXP_SRC_PTR(r) RSTRING_PTR(RREGEXP(r)->src)
|
|
|
|
#define RREGEXP_SRC_LEN(r) RSTRING_LEN(RREGEXP(r)->src)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RHash {
|
|
|
|
struct RBasic basic;
|
2007-08-29 21:54:51 -04:00
|
|
|
struct st_table *ntbl; /* possibly 0 */
|
1998-01-16 07:13:05 -05:00
|
|
|
int iter_lev;
|
1999-01-19 23:59:39 -05:00
|
|
|
VALUE ifnone;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2007-08-29 21:54:51 -04:00
|
|
|
/* RHASH_TBL allocates st_table if not available. */
|
2007-08-29 19:12:21 -04:00
|
|
|
#define RHASH_TBL(h) rb_hash_tbl(h)
|
2007-08-29 19:16:55 -04:00
|
|
|
#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
|
|
|
|
#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
|
2007-08-29 19:12:21 -04:00
|
|
|
#define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : 0)
|
|
|
|
#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
struct RFile {
|
|
|
|
struct RBasic basic;
|
* file.c, gc.c, io.c, ruby.h, rubyio.h, win32/win32.h (rb_io_t):
renamed from OpenFile.
* ext/dl/cptr.c, ext/io/wait/wait.c, ext/openssl/ossl.h,
ext/openssl/ossl_bio.c, ext/openssl/ossl_ssl.c, ext/pty/pty.c,
ext/readline/readline.c, ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 05:30:50 -05:00
|
|
|
struct rb_io_t *fptr;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
|
|
|
|
2008-03-15 20:23:43 -04:00
|
|
|
struct RRational {
|
|
|
|
struct RBasic basic;
|
|
|
|
VALUE num;
|
|
|
|
VALUE den;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RComplex {
|
|
|
|
struct RBasic basic;
|
|
|
|
VALUE real;
|
|
|
|
VALUE image;
|
|
|
|
};
|
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RData {
|
|
|
|
struct RBasic basic;
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void (*dmark)(void*);
|
|
|
|
void (*dfree)(void*);
|
1998-01-16 07:13:05 -05:00
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DATA_PTR(dta) (RDATA(dta)->data)
|
|
|
|
|
2000-06-26 11:16:03 -04:00
|
|
|
/*
|
2005-09-14 04:30:16 -04:00
|
|
|
#define RUBY_DATA_FUNC(func) ((void (*)(void*))func)
|
2000-06-26 11:16:03 -04:00
|
|
|
*/
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
typedef void (*RUBY_DATA_FUNC)(void*);
|
2000-06-26 11:16:03 -04:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
|
2000-06-26 11:16:03 -04:00
|
|
|
|
2002-04-24 00:54:16 -04:00
|
|
|
#define Data_Wrap_Struct(klass,mark,free,sval)\
|
|
|
|
rb_data_object_alloc(klass,sval,(RUBY_DATA_FUNC)mark,(RUBY_DATA_FUNC)free)
|
2000-06-26 11:16:03 -04:00
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define Data_Make_Struct(klass,type,mark,free,sval) (\
|
1998-01-16 07:13:05 -05:00
|
|
|
sval = ALLOC(type),\
|
|
|
|
memset(sval, 0, sizeof(type)),\
|
2000-06-26 11:16:03 -04:00
|
|
|
Data_Wrap_Struct(klass,mark,free,sval)\
|
1998-01-16 07:13:05 -05:00
|
|
|
)
|
|
|
|
|
2002-04-24 00:54:16 -04:00
|
|
|
#define Data_Get_Struct(obj,type,sval) do {\
|
1998-01-16 07:13:05 -05:00
|
|
|
Check_Type(obj, T_DATA); \
|
|
|
|
sval = (type*)DATA_PTR(obj);\
|
2002-04-24 00:54:16 -04:00
|
|
|
} while (0)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2006-02-05 09:40:01 -05:00
|
|
|
#define RSTRUCT_EMBED_LEN_MAX 3
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RStruct {
|
|
|
|
struct RBasic basic;
|
2006-02-05 09:40:01 -05:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
long len;
|
|
|
|
VALUE *ptr;
|
|
|
|
} heap;
|
|
|
|
VALUE ary[RSTRUCT_EMBED_LEN_MAX];
|
|
|
|
} as;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2006-02-05 10:06:41 -05:00
|
|
|
#define RSTRUCT_EMBED_LEN_MASK (FL_USER2|FL_USER1)
|
2006-05-22 03:39:30 -04:00
|
|
|
#define RSTRUCT_EMBED_LEN_SHIFT (FL_USHIFT+1)
|
2006-02-05 09:40:01 -05:00
|
|
|
#define RSTRUCT_LEN(st) \
|
|
|
|
((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
|
2006-08-31 06:47:44 -04:00
|
|
|
(long)((RBASIC(st)->flags >> RSTRUCT_EMBED_LEN_SHIFT) & \
|
|
|
|
(RSTRUCT_EMBED_LEN_MASK >> RSTRUCT_EMBED_LEN_SHIFT)) : \
|
2006-02-05 09:40:01 -05:00
|
|
|
RSTRUCT(st)->as.heap.len)
|
|
|
|
#define RSTRUCT_PTR(st) \
|
|
|
|
((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? \
|
|
|
|
RSTRUCT(st)->as.ary : \
|
|
|
|
RSTRUCT(st)->as.heap.ptr)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2007-09-01 08:02:36 -04:00
|
|
|
#define RBIGNUM_EMBED_LEN_MAX ((sizeof(VALUE)*3)/sizeof(BDIGIT))
|
1998-01-16 07:13:05 -05:00
|
|
|
struct RBignum {
|
|
|
|
struct RBasic basic;
|
2007-09-01 08:02:36 -04:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
long len;
|
|
|
|
BDIGIT *digits;
|
|
|
|
} heap;
|
|
|
|
BDIGIT ary[RBIGNUM_EMBED_LEN_MAX];
|
|
|
|
} as;
|
1998-01-16 07:13:05 -05:00
|
|
|
};
|
2007-09-01 08:02:36 -04:00
|
|
|
#define RBIGNUM_SIGN_BIT FL_USER1
|
|
|
|
/* sign: positive:1, negative:0 */
|
|
|
|
#define RBIGNUM_SIGN(b) ((RBASIC(b)->flags & RBIGNUM_SIGN_BIT) != 0)
|
|
|
|
#define RBIGNUM_SET_SIGN(b,sign) \
|
|
|
|
((sign) ? (RBASIC(b)->flags |= RBIGNUM_SIGN_BIT) \
|
|
|
|
: (RBASIC(b)->flags &= ~RBIGNUM_SIGN_BIT))
|
|
|
|
#define RBIGNUM_POSITIVE_P(b) RBIGNUM_SIGN(b)
|
|
|
|
#define RBIGNUM_NEGATIVE_P(b) (!RBIGNUM_SIGN(b))
|
|
|
|
|
|
|
|
#define RBIGNUM_EMBED_FLAG FL_USER2
|
|
|
|
#define RBIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)
|
|
|
|
#define RBIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+3)
|
|
|
|
#define RBIGNUM_LEN(b) \
|
|
|
|
((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
|
|
|
|
(long)((RBASIC(b)->flags >> RBIGNUM_EMBED_LEN_SHIFT) & \
|
|
|
|
(RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT)) : \
|
|
|
|
RBIGNUM(b)->as.heap.len)
|
2008-05-12 00:44:13 -04:00
|
|
|
/* LSB:RBIGNUM_DIGITS(b)[0], MSB:RBIGNUM_DIGITS(b)[RBIGNUM_LEN(b)-1] */
|
2007-09-01 08:02:36 -04:00
|
|
|
#define RBIGNUM_DIGITS(b) \
|
|
|
|
((RBASIC(b)->flags & RBIGNUM_EMBED_FLAG) ? \
|
|
|
|
RBIGNUM(b)->as.ary : \
|
|
|
|
RBIGNUM(b)->as.heap.digits)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define R_CAST(st) (struct st*)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define RBASIC(obj) (R_CAST(RBasic)(obj))
|
|
|
|
#define ROBJECT(obj) (R_CAST(RObject)(obj))
|
|
|
|
#define RCLASS(obj) (R_CAST(RClass)(obj))
|
1999-01-19 23:59:39 -05:00
|
|
|
#define RMODULE(obj) RCLASS(obj)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define RFLOAT(obj) (R_CAST(RFloat)(obj))
|
|
|
|
#define RSTRING(obj) (R_CAST(RString)(obj))
|
|
|
|
#define RREGEXP(obj) (R_CAST(RRegexp)(obj))
|
|
|
|
#define RARRAY(obj) (R_CAST(RArray)(obj))
|
|
|
|
#define RHASH(obj) (R_CAST(RHash)(obj))
|
|
|
|
#define RDATA(obj) (R_CAST(RData)(obj))
|
|
|
|
#define RSTRUCT(obj) (R_CAST(RStruct)(obj))
|
|
|
|
#define RBIGNUM(obj) (R_CAST(RBignum)(obj))
|
|
|
|
#define RFILE(obj) (R_CAST(RFile)(obj))
|
2008-03-15 20:23:43 -04:00
|
|
|
#define RRATIONAL(obj) (R_CAST(RRational)(obj))
|
|
|
|
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2007-10-07 06:18:09 -04:00
|
|
|
#define FL_SINGLETON FL_USER0
|
2007-10-07 06:41:23 -04:00
|
|
|
#define FL_MARK (((VALUE)1)<<5)
|
|
|
|
#define FL_RESERVED (((VALUE)1)<<6) /* will be used in the future GC */
|
|
|
|
#define FL_FINALIZE (((VALUE)1)<<7)
|
|
|
|
#define FL_TAINT (((VALUE)1)<<8)
|
|
|
|
#define FL_EXIVAR (((VALUE)1)<<9)
|
|
|
|
#define FL_FREEZE (((VALUE)1)<<10)
|
2007-10-07 05:58:26 -04:00
|
|
|
|
|
|
|
#define FL_USHIFT 11
|
2007-10-07 06:18:09 -04:00
|
|
|
|
2007-10-07 06:41:23 -04:00
|
|
|
#define FL_USER0 (((VALUE)1)<<(FL_USHIFT+0))
|
|
|
|
#define FL_USER1 (((VALUE)1)<<(FL_USHIFT+1))
|
|
|
|
#define FL_USER2 (((VALUE)1)<<(FL_USHIFT+2))
|
|
|
|
#define FL_USER3 (((VALUE)1)<<(FL_USHIFT+3))
|
|
|
|
#define FL_USER4 (((VALUE)1)<<(FL_USHIFT+4))
|
|
|
|
#define FL_USER5 (((VALUE)1)<<(FL_USHIFT+5))
|
|
|
|
#define FL_USER6 (((VALUE)1)<<(FL_USHIFT+6))
|
|
|
|
#define FL_USER7 (((VALUE)1)<<(FL_USHIFT+7))
|
|
|
|
#define FL_USER8 (((VALUE)1)<<(FL_USHIFT+8))
|
|
|
|
#define FL_USER9 (((VALUE)1)<<(FL_USHIFT+9))
|
|
|
|
#define FL_USER10 (((VALUE)1)<<(FL_USHIFT+10))
|
|
|
|
#define FL_USER11 (((VALUE)1)<<(FL_USHIFT+11))
|
|
|
|
#define FL_USER12 (((VALUE)1)<<(FL_USHIFT+12))
|
|
|
|
#define FL_USER13 (((VALUE)1)<<(FL_USHIFT+13))
|
|
|
|
#define FL_USER14 (((VALUE)1)<<(FL_USHIFT+14))
|
|
|
|
#define FL_USER15 (((VALUE)1)<<(FL_USHIFT+15))
|
|
|
|
#define FL_USER16 (((VALUE)1)<<(FL_USHIFT+16))
|
|
|
|
#define FL_USER17 (((VALUE)1)<<(FL_USHIFT+17))
|
|
|
|
#define FL_USER18 (((VALUE)1)<<(FL_USHIFT+18))
|
|
|
|
#define FL_USER19 (((VALUE)1)<<(FL_USHIFT+19))
|
|
|
|
#define FL_USER20 (((VALUE)1)<<(FL_USHIFT+20))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2000-03-07 03:37:59 -05:00
|
|
|
#define SPECIAL_CONST_P(x) (IMMEDIATE_P(x) || !RTEST(x))
|
2000-01-04 23:41:21 -05:00
|
|
|
|
2004-10-27 05:29:26 -04:00
|
|
|
#define FL_ABLE(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) != T_NODE)
|
1998-01-16 07:13:05 -05:00
|
|
|
#define FL_TEST(x,f) (FL_ABLE(x)?(RBASIC(x)->flags&(f)):0)
|
2006-08-31 06:47:44 -04:00
|
|
|
#define FL_ANY(x,f) FL_TEST(x,f)
|
|
|
|
#define FL_ALL(x,f) (FL_TEST(x,f) == (f))
|
2000-05-12 05:07:57 -04:00
|
|
|
#define FL_SET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags |= (f);} while (0)
|
|
|
|
#define FL_UNSET(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags &= ~(f);} while (0)
|
|
|
|
#define FL_REVERSE(x,f) do {if (FL_ABLE(x)) RBASIC(x)->flags ^= (f);} while (0)
|
1998-01-16 07:13:05 -05:00
|
|
|
|
1999-01-19 23:59:39 -05:00
|
|
|
#define OBJ_TAINTED(x) FL_TEST((x), FL_TAINT)
|
|
|
|
#define OBJ_TAINT(x) FL_SET((x), FL_TAINT)
|
2000-05-12 05:07:57 -04:00
|
|
|
#define OBJ_INFECT(x,s) do {if (FL_ABLE(x) && FL_ABLE(s)) RBASIC(x)->flags |= RBASIC(s)->flags & FL_TAINT;} while (0)
|
1998-01-16 07:19:22 -05:00
|
|
|
|
2000-01-31 22:12:21 -05:00
|
|
|
#define OBJ_FROZEN(x) FL_TEST((x), FL_FREEZE)
|
|
|
|
#define OBJ_FREEZE(x) FL_SET((x), FL_FREEZE)
|
|
|
|
|
2005-10-05 12:15:16 -04:00
|
|
|
#define ALLOC_N(type,n) (type*)xmalloc2((n),sizeof(type))
|
1998-01-16 07:13:05 -05:00
|
|
|
#define ALLOC(type) (type*)xmalloc(sizeof(type))
|
2005-10-05 12:15:16 -04:00
|
|
|
#define REALLOC_N(var,type,n) (var)=(type*)xrealloc2((char*)(var),(n),sizeof(type))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
|
|
|
#define ALLOCA_N(type,n) (type*)alloca(sizeof(type)*(n))
|
|
|
|
|
|
|
|
#define MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(n))
|
|
|
|
#define MEMCPY(p1,p2,type,n) memcpy((p1), (p2), sizeof(type)*(n))
|
|
|
|
#define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n))
|
2000-09-15 02:00:30 -04:00
|
|
|
#define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n))
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_obj_infect(VALUE,VALUE);
|
2003-03-24 22:11:27 -05:00
|
|
|
|
2008-07-07 22:44:12 -04:00
|
|
|
typedef int ruby_glob_func(const char*,VALUE, void*);
|
|
|
|
void rb_glob(const char*,void(*)(const char*,VALUE,void*),VALUE);
|
2005-09-16 09:46:05 -04:00
|
|
|
int ruby_glob(const char*,int,ruby_glob_func*,VALUE);
|
|
|
|
int ruby_brace_glob(const char*,int,ruby_glob_func*,VALUE);
|
2000-05-28 22:10:22 -04:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_define_class(const char*,VALUE);
|
|
|
|
VALUE rb_define_module(const char*);
|
|
|
|
VALUE rb_define_class_under(VALUE, const char*, VALUE);
|
|
|
|
VALUE rb_define_module_under(VALUE, const char*);
|
1998-01-16 07:19:22 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_include_module(VALUE,VALUE);
|
|
|
|
void rb_extend_object(VALUE,VALUE);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_define_variable(const char*,VALUE*);
|
|
|
|
void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
|
|
|
|
void rb_define_hooked_variable(const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
|
|
|
|
void rb_define_readonly_variable(const char*,VALUE*);
|
|
|
|
void rb_define_const(VALUE,const char*,VALUE);
|
|
|
|
void rb_define_global_const(const char*,VALUE);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2001-05-02 00:22:21 -04:00
|
|
|
#define RUBY_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))func)
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_define_method(VALUE,const char*,VALUE(*)(ANYARGS),int);
|
|
|
|
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
|
|
|
|
void rb_define_global_function(const char*,VALUE(*)(ANYARGS),int);
|
1998-01-16 07:19:22 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_undef_method(VALUE,const char*);
|
|
|
|
void rb_define_alias(VALUE,const char*,const char*);
|
|
|
|
void rb_define_attr(VALUE,const char*,int,int);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_global_variable(VALUE*);
|
2006-12-31 10:02:22 -05:00
|
|
|
void rb_register_mark_object(VALUE);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_gc_register_address(VALUE*);
|
|
|
|
void rb_gc_unregister_address(VALUE*);
|
2000-02-08 03:54:01 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
ID rb_intern(const char*);
|
2006-09-02 11:05:27 -04:00
|
|
|
ID rb_intern2(const char*, long);
|
* encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.
* parse.y (pragma_encoding): encoding specification pragma.
* parse.y (rb_intern3): encoding specified symbols.
* string.c (rb_str_length): length based on characters.
for older behavior, bytesize method added.
* string.c (rb_str_index_m): index based on characters. rindex as
well.
* string.c (succ_char): encoding aware succeeding string.
* string.c (rb_str_reverse): reverse based on characters.
* string.c (rb_str_inspect): encoding aware string description.
* string.c (rb_str_upcase_bang): encoding aware case conversion.
downcase, capitalize, swapcase as well.
* string.c (rb_str_tr_bang): tr based on characters. delete,
squeeze, tr_s, count as well.
* string.c (rb_str_split_m): split based on characters.
* string.c (rb_str_each_line): encoding aware each_line.
* string.c (rb_str_each_char): added. iteration based on
characters.
* string.c (rb_str_strip_bang): encoding aware whitespace
stripping. lstrip, rstrip as well.
* string.c (rb_str_justify): encoding aware justifying (ljust,
rjust, center).
* string.c (str_encoding): get encoding attribute from a string.
* re.c (rb_reg_initialize): encoding aware regular expression
* sprintf.c (rb_str_format): formatting (i.e. length count) based
on characters.
* io.c (rb_io_getc): getc to return one-character string.
for older behavior, getbyte method added.
* ext/stringio/stringio.c (strio_getc): ditto.
* io.c (rb_io_ungetc): allow pushing arbitrary string at the
current reading point.
* ext/stringio/stringio.c (strio_ungetc): ditto.
* ext/strscan/strscan.c: encoding support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24 23:29:39 -04:00
|
|
|
ID rb_intern_str(VALUE str);
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
const char *rb_id2name(ID);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
ID rb_to_id(VALUE);
|
2007-02-05 07:28:38 -05:00
|
|
|
VALUE rb_id2str(ID);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2008-06-09 05:25:32 -04:00
|
|
|
#define CONST_ID_CACHE(result, str) \
|
2008-06-09 23:43:33 -04:00
|
|
|
{ \
|
2008-06-09 05:25:32 -04:00
|
|
|
static ID rb_intern_id_cache; \
|
|
|
|
if (!rb_intern_id_cache) \
|
2008-06-12 00:46:16 -04:00
|
|
|
rb_intern_id_cache = rb_intern2(str, strlen(str)); \
|
2008-06-09 05:25:32 -04:00
|
|
|
result rb_intern_id_cache; \
|
2008-06-09 23:43:33 -04:00
|
|
|
}
|
2008-06-09 05:25:32 -04:00
|
|
|
#define CONST_ID(var, str) \
|
2008-06-09 23:43:33 -04:00
|
|
|
do CONST_ID_CACHE(var =, str) while (0)
|
2008-01-04 12:21:53 -05:00
|
|
|
#ifdef __GNUC__
|
|
|
|
/* __builtin_constant_p and statement expression is available
|
|
|
|
* since gcc-2.7.2.3 at least. */
|
|
|
|
#define rb_intern(str) \
|
|
|
|
(__builtin_constant_p(str) ? \
|
2008-07-01 03:56:51 -04:00
|
|
|
__extension__ (CONST_ID_CACHE(/**/, str)) : \
|
2008-01-04 12:21:53 -05:00
|
|
|
rb_intern(str))
|
|
|
|
#endif
|
|
|
|
|
2008-05-31 05:28:20 -04:00
|
|
|
const char *rb_class2name(VALUE);
|
|
|
|
const char *rb_obj_classname(VALUE);
|
1998-01-16 07:19:22 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void rb_p(VALUE);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_eval_string(const char*);
|
|
|
|
VALUE rb_eval_string_protect(const char*, int*);
|
|
|
|
VALUE rb_eval_string_wrap(const char*, int*);
|
|
|
|
VALUE rb_funcall(VALUE, ID, int, ...);
|
|
|
|
VALUE rb_funcall2(VALUE, ID, int, const VALUE*);
|
|
|
|
VALUE rb_funcall3(VALUE, ID, int, const VALUE*);
|
|
|
|
int rb_scan_args(int, const VALUE*, const char*, ...);
|
2008-05-22 12:19:14 -04:00
|
|
|
VALUE rb_call_super(int, const VALUE*);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_gv_set(const char*, VALUE);
|
|
|
|
VALUE rb_gv_get(const char*);
|
|
|
|
VALUE rb_iv_get(VALUE, const char*);
|
|
|
|
VALUE rb_iv_set(VALUE, const char*, VALUE);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_equal(VALUE,VALUE);
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2008-06-09 01:18:03 -04:00
|
|
|
VALUE *rb_ruby_verbose_ptr(void);
|
|
|
|
VALUE *rb_ruby_debug_ptr(void);
|
|
|
|
#define ruby_verbose (*rb_ruby_verbose_ptr())
|
|
|
|
#define ruby_debug (*rb_ruby_debug_ptr())
|
1998-01-16 07:13:05 -05:00
|
|
|
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
PRINTF_ARGS(NORETURN(void rb_raise(VALUE, const char*, ...)), 2, 3);
|
|
|
|
PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2);
|
|
|
|
PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
|
|
|
|
NORETURN(void rb_sys_fail(const char*));
|
|
|
|
NORETURN(void rb_iter_break(void));
|
|
|
|
NORETURN(void rb_exit(int));
|
|
|
|
NORETURN(void rb_notimplement(void));
|
1998-01-16 07:13:05 -05:00
|
|
|
|
2005-09-13 07:26:42 -04:00
|
|
|
/* reports if `-w' specified */
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
PRINTF_ARGS(void rb_warning(const char*, ...), 1, 2);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 04:12:18 -04:00
|
|
|
PRINTF_ARGS(void rb_compile_warning(const char *, int, const char*, ...), 3, 4);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2);
|
2005-09-13 07:26:42 -04:00
|
|
|
/* reports always */
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 04:12:18 -04:00
|
|
|
PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
|
2007-12-21 02:33:31 -05:00
|
|
|
typedef VALUE rb_block_call_func(VALUE, VALUE, int, VALUE*);
|
|
|
|
|
2008-05-22 12:19:14 -04:00
|
|
|
VALUE rb_each(VALUE);
|
|
|
|
VALUE rb_yield(VALUE);
|
|
|
|
VALUE rb_yield_values(int n, ...);
|
|
|
|
VALUE rb_yield_values2(int n, const VALUE *argv);
|
|
|
|
VALUE rb_yield_splat(VALUE);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
int rb_block_given_p(void);
|
|
|
|
void rb_need_block(void);
|
2008-05-22 12:19:14 -04:00
|
|
|
VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
|
|
|
|
VALUE rb_block_call(VALUE,ID,int,VALUE*,VALUE(*)(ANYARGS),VALUE);
|
|
|
|
VALUE rb_rescue(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
|
|
|
|
VALUE rb_rescue2(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
|
|
|
|
VALUE rb_catch(const char*,VALUE(*)(ANYARGS),VALUE);
|
2007-12-21 06:13:53 -05:00
|
|
|
VALUE rb_catch_obj(VALUE,VALUE(*)(ANYARGS),VALUE);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
NORETURN(void rb_throw(const char*,VALUE));
|
2007-12-21 06:13:53 -05:00
|
|
|
NORETURN(void rb_throw_obj(VALUE,VALUE));
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
|
|
|
|
VALUE rb_require(const char*);
|
|
|
|
|
2006-01-22 08:34:41 -05:00
|
|
|
#ifdef __ia64
|
2005-12-27 00:40:04 -05:00
|
|
|
void ruby_init_stack(VALUE*, void*);
|
2008-04-13 23:52:27 -04:00
|
|
|
#define ruby_init_stack(addr) ruby_init_stack(addr, rb_ia64_bsp())
|
2005-12-27 00:40:04 -05:00
|
|
|
#else
|
|
|
|
void ruby_init_stack(VALUE*);
|
2008-04-13 23:52:27 -04:00
|
|
|
#endif
|
2005-12-27 00:40:04 -05:00
|
|
|
#define RUBY_INIT_STACK \
|
|
|
|
VALUE variable_in_this_stack_frame; \
|
|
|
|
ruby_init_stack(&variable_in_this_stack_frame);
|
* bignum.c: changed `foo _((boo))' to `foo(boo)`. [ruby-dev:27056]
* defines.h, dir.c, dln.h, enumerator.c, env.h, error.c, eval.c, file.c,
gc.c, hash.c, inits.c, intern.h, io.c, lex.c, marshal.c, missing.h,
node.h, numeric.c, pack.c, process.c, re.h, ruby.c, ruby.h, rubyio.h,
rubysig.h, signal.c, sprintf.c, st.h, string.c, struct.c, time.c,
util.c, util.h, variable.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 02:32:32 -04:00
|
|
|
void ruby_init(void);
|
* include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
ruby_nerrs): purge global variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 04:12:18 -04:00
|
|
|
void *ruby_options(int, char**);
|
|
|
|
int ruby_run_node(void *);
|
1999-01-19 23:59:39 -05:00
|
|
|
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_mKernel;
|
|
|
|
RUBY_EXTERN VALUE rb_mComparable;
|
|
|
|
RUBY_EXTERN VALUE rb_mEnumerable;
|
|
|
|
RUBY_EXTERN VALUE rb_mPrecision;
|
|
|
|
RUBY_EXTERN VALUE rb_mErrno;
|
|
|
|
RUBY_EXTERN VALUE rb_mFileTest;
|
|
|
|
RUBY_EXTERN VALUE rb_mGC;
|
|
|
|
RUBY_EXTERN VALUE rb_mMath;
|
|
|
|
RUBY_EXTERN VALUE rb_mProcess;
|
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cBasicObject;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cObject;
|
|
|
|
RUBY_EXTERN VALUE rb_cArray;
|
|
|
|
RUBY_EXTERN VALUE rb_cBignum;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cBinding;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cClass;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cCont;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cDir;
|
|
|
|
RUBY_EXTERN VALUE rb_cData;
|
|
|
|
RUBY_EXTERN VALUE rb_cFalseClass;
|
2008-04-20 08:01:27 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cEnumerator;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cFile;
|
|
|
|
RUBY_EXTERN VALUE rb_cFixnum;
|
|
|
|
RUBY_EXTERN VALUE rb_cFloat;
|
|
|
|
RUBY_EXTERN VALUE rb_cHash;
|
|
|
|
RUBY_EXTERN VALUE rb_cInteger;
|
|
|
|
RUBY_EXTERN VALUE rb_cIO;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cMatch;
|
2006-07-12 07:10:22 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cMethod;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cModule;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cNameErrorMesg;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cNilClass;
|
|
|
|
RUBY_EXTERN VALUE rb_cNumeric;
|
|
|
|
RUBY_EXTERN VALUE rb_cProc;
|
|
|
|
RUBY_EXTERN VALUE rb_cRange;
|
2008-03-15 20:23:43 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cRational;
|
|
|
|
RUBY_EXTERN VALUE rb_cComplex;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cRegexp;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cStat;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cString;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cStruct;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_cSymbol;
|
|
|
|
RUBY_EXTERN VALUE rb_cThread;
|
|
|
|
RUBY_EXTERN VALUE rb_cTime;
|
|
|
|
RUBY_EXTERN VALUE rb_cTrueClass;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_cUnboundMethod;
|
2003-03-04 09:12:19 -05:00
|
|
|
|
|
|
|
RUBY_EXTERN VALUE rb_eException;
|
|
|
|
RUBY_EXTERN VALUE rb_eStandardError;
|
|
|
|
RUBY_EXTERN VALUE rb_eSystemExit;
|
|
|
|
RUBY_EXTERN VALUE rb_eInterrupt;
|
|
|
|
RUBY_EXTERN VALUE rb_eSignal;
|
|
|
|
RUBY_EXTERN VALUE rb_eFatal;
|
|
|
|
RUBY_EXTERN VALUE rb_eArgError;
|
|
|
|
RUBY_EXTERN VALUE rb_eEOFError;
|
|
|
|
RUBY_EXTERN VALUE rb_eIndexError;
|
2007-08-08 03:07:03 -04:00
|
|
|
RUBY_EXTERN VALUE rb_eStopIteration;
|
2004-09-22 00:48:52 -04:00
|
|
|
RUBY_EXTERN VALUE rb_eKeyError;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_eRangeError;
|
|
|
|
RUBY_EXTERN VALUE rb_eIOError;
|
|
|
|
RUBY_EXTERN VALUE rb_eRuntimeError;
|
|
|
|
RUBY_EXTERN VALUE rb_eSecurityError;
|
|
|
|
RUBY_EXTERN VALUE rb_eSystemCallError;
|
2006-09-23 17:29:47 -04:00
|
|
|
RUBY_EXTERN VALUE rb_eThreadError;
|
2003-03-04 09:12:19 -05:00
|
|
|
RUBY_EXTERN VALUE rb_eTypeError;
|
|
|
|
RUBY_EXTERN VALUE rb_eZeroDivError;
|
|
|
|
RUBY_EXTERN VALUE rb_eNotImpError;
|
|
|
|
RUBY_EXTERN VALUE rb_eNoMemError;
|
|
|
|
RUBY_EXTERN VALUE rb_eNoMethodError;
|
|
|
|
RUBY_EXTERN VALUE rb_eFloatDomainError;
|
2006-07-20 13:36:36 -04:00
|
|
|
RUBY_EXTERN VALUE rb_eLocalJumpError;
|
|
|
|
RUBY_EXTERN VALUE rb_eSysStackError;
|
|
|
|
RUBY_EXTERN VALUE rb_eRegexpError;
|
2003-03-04 09:12:19 -05:00
|
|
|
|
|
|
|
RUBY_EXTERN VALUE rb_eScriptError;
|
|
|
|
RUBY_EXTERN VALUE rb_eNameError;
|
|
|
|
RUBY_EXTERN VALUE rb_eSyntaxError;
|
|
|
|
RUBY_EXTERN VALUE rb_eLoadError;
|
|
|
|
|
2003-05-13 01:53:08 -04:00
|
|
|
RUBY_EXTERN VALUE rb_stdin, rb_stdout, rb_stderr;
|
* intern.h: add prototypes.
rb_gc_enable(), rb_gc_disable(), rb_gc_start(), rb_str_new5()
rb_str_buf_append(), rb_str_buf_cat(), rb_str_buf_cat2(),
rb_str_dup_frozen()
* ruby.h: added declaration.
rb_defout, rb_stdin, rb_stdout, rb_stderr, ruby_errinfo
* rubyio.h: changed double include guard macro to RUBYIO_H.
* array.c (inspect_call): make static.
* eval.c (dvar_asgn): ditto.
* io.c (rb_io_close_read): ditto.
* lex.c (rb_reserved_word): ditto.
* ruby.c: (req_list_head, req_list_last): ditto.
* ruby.c (require_libraries): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-12-17 02:52:35 -05:00
|
|
|
|
2001-03-27 02:10:58 -05:00
|
|
|
static inline VALUE
|
2001-03-26 03:57:16 -05:00
|
|
|
rb_class_of(VALUE obj)
|
1999-01-19 23:59:39 -05:00
|
|
|
{
|
2005-04-29 22:59:44 -04:00
|
|
|
if (IMMEDIATE_P(obj)) {
|
2004-01-13 00:48:59 -05:00
|
|
|
if (FIXNUM_P(obj)) return rb_cFixnum;
|
|
|
|
if (obj == Qtrue) return rb_cTrueClass;
|
|
|
|
if (SYMBOL_P(obj)) return rb_cSymbol;
|
|
|
|
}
|
2005-04-29 22:59:44 -04:00
|
|
|
else if (!RTEST(obj)) {
|
2004-01-13 00:48:59 -05:00
|
|
|
if (obj == Qnil) return rb_cNilClass;
|
|
|
|
if (obj == Qfalse) return rb_cFalseClass;
|
|
|
|
}
|
2004-01-27 01:05:04 -05:00
|
|
|
return RBASIC(obj)->klass;
|
1999-01-19 23:59:39 -05:00
|
|
|
}
|
|
|
|
|
2001-03-27 02:10:58 -05:00
|
|
|
static inline int
|
2001-03-26 03:57:16 -05:00
|
|
|
rb_type(VALUE obj)
|
1999-01-19 23:59:39 -05:00
|
|
|
{
|
2005-04-29 22:59:44 -04:00
|
|
|
if (IMMEDIATE_P(obj)) {
|
2004-01-13 00:48:59 -05:00
|
|
|
if (FIXNUM_P(obj)) return T_FIXNUM;
|
|
|
|
if (obj == Qtrue) return T_TRUE;
|
|
|
|
if (SYMBOL_P(obj)) return T_SYMBOL;
|
|
|
|
if (obj == Qundef) return T_UNDEF;
|
|
|
|
}
|
2005-04-29 22:59:44 -04:00
|
|
|
else if (!RTEST(obj)) {
|
2004-01-13 00:48:59 -05:00
|
|
|
if (obj == Qnil) return T_NIL;
|
|
|
|
if (obj == Qfalse) return T_FALSE;
|
|
|
|
}
|
2004-01-27 01:05:04 -05:00
|
|
|
return BUILTIN_TYPE(obj);
|
1999-01-19 23:59:39 -05:00
|
|
|
}
|
|
|
|
|
2001-03-27 02:10:58 -05:00
|
|
|
static inline int
|
2001-03-26 03:57:16 -05:00
|
|
|
rb_special_const_p(VALUE obj)
|
1999-01-19 23:59:39 -05:00
|
|
|
{
|
2000-01-04 23:41:21 -05:00
|
|
|
if (SPECIAL_CONST_P(obj)) return Qtrue;
|
1999-08-13 01:45:20 -04:00
|
|
|
return Qfalse;
|
1999-01-19 23:59:39 -05:00
|
|
|
}
|
2001-03-26 03:57:16 -05:00
|
|
|
|
2007-06-09 23:06:15 -04:00
|
|
|
#include "ruby/missing.h"
|
|
|
|
#include "ruby/intern.h"
|
1998-01-16 07:19:22 -05:00
|
|
|
|
1998-01-16 07:13:05 -05:00
|
|
|
#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
|
|
|
|
/* hook for external modules */
|
1999-01-19 23:59:39 -05:00
|
|
|
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
|
1998-01-16 07:13:05 -05:00
|
|
|
#endif
|
|
|
|
|
2007-09-29 04:45:24 -04:00
|
|
|
#if (defined(__APPLE__) || defined(__NeXT__)) && defined(__MACH__)
|
|
|
|
/* to link startup code with ObjC support */
|
|
|
|
#define RUBY_GLOBAL_SETUP static void objcdummyfunction(void) {objc_msgSend();}
|
|
|
|
#else
|
|
|
|
#define RUBY_GLOBAL_SETUP
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void ruby_sysinit(int *, char ***);
|
|
|
|
|
2007-02-24 21:43:43 -05:00
|
|
|
#define RUBY_VM 1 /* YARV */
|
|
|
|
#define HAVE_NATIVETHREAD
|
2007-12-25 02:28:51 -05:00
|
|
|
int ruby_native_thread_p(void);
|
2003-11-19 22:50:32 -05:00
|
|
|
|
2008-07-01 14:13:22 -04:00
|
|
|
#define RUBY_EVENT_NONE 0x0000
|
|
|
|
#define RUBY_EVENT_LINE 0x0001
|
|
|
|
#define RUBY_EVENT_CLASS 0x0002
|
|
|
|
#define RUBY_EVENT_END 0x0004
|
|
|
|
#define RUBY_EVENT_CALL 0x0008
|
|
|
|
#define RUBY_EVENT_RETURN 0x0010
|
|
|
|
#define RUBY_EVENT_C_CALL 0x0020
|
|
|
|
#define RUBY_EVENT_C_RETURN 0x0040
|
|
|
|
#define RUBY_EVENT_RAISE 0x0080
|
|
|
|
#define RUBY_EVENT_ALL 0xffff
|
|
|
|
#define RUBY_EVENT_VM 0x10000
|
|
|
|
#define RUBY_EVENT_SWITCH 0x20000
|
|
|
|
#define RUBY_EVENT_COVERAGE 0x40000
|
2007-11-16 02:29:44 -05:00
|
|
|
|
|
|
|
typedef unsigned int rb_event_flag_t;
|
|
|
|
typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass);
|
|
|
|
|
|
|
|
typedef struct rb_event_hook_struct {
|
|
|
|
rb_event_flag_t flag;
|
|
|
|
rb_event_hook_func_t func;
|
|
|
|
VALUE data;
|
|
|
|
struct rb_event_hook_struct *next;
|
|
|
|
} rb_event_hook_t;
|
|
|
|
|
|
|
|
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
|
|
|
|
VALUE data);
|
|
|
|
int rb_remove_event_hook(rb_event_hook_func_t func);
|
|
|
|
|
2008-01-03 01:13:31 -05:00
|
|
|
/* locale insensitive functions */
|
2008-01-03 03:44:01 -05:00
|
|
|
|
|
|
|
#define rb_isascii(c) ((unsigned long)(c) < 128)
|
|
|
|
int rb_isalnum(int c);
|
|
|
|
int rb_isalpha(int c);
|
|
|
|
int rb_isblank(int c);
|
|
|
|
int rb_iscntrl(int c);
|
|
|
|
int rb_isdigit(int c);
|
|
|
|
int rb_isgraph(int c);
|
|
|
|
int rb_islower(int c);
|
|
|
|
int rb_isprint(int c);
|
|
|
|
int rb_ispunct(int c);
|
|
|
|
int rb_isspace(int c);
|
|
|
|
int rb_isupper(int c);
|
|
|
|
int rb_isxdigit(int c);
|
|
|
|
int rb_tolower(int c);
|
|
|
|
int rb_toupper(int c);
|
|
|
|
|
2008-01-01 07:24:04 -05:00
|
|
|
#ifndef ISPRINT
|
2008-01-03 03:44:01 -05:00
|
|
|
#define ISASCII(c) rb_isascii((unsigned char)(c))
|
2008-01-01 07:24:04 -05:00
|
|
|
#undef ISPRINT
|
2008-01-04 04:41:44 -05:00
|
|
|
#define ISPRINT(c) rb_isprint((unsigned char)(c))
|
|
|
|
#define ISSPACE(c) rb_isspace((unsigned char)(c))
|
|
|
|
#define ISUPPER(c) rb_isupper((unsigned char)(c))
|
|
|
|
#define ISLOWER(c) rb_islower((unsigned char)(c))
|
|
|
|
#define ISALNUM(c) rb_isalnum((unsigned char)(c))
|
|
|
|
#define ISALPHA(c) rb_isalpha((unsigned char)(c))
|
|
|
|
#define ISDIGIT(c) rb_isdigit((unsigned char)(c))
|
|
|
|
#define ISXDIGIT(c) rb_isxdigit((unsigned char)(c))
|
|
|
|
#endif
|
|
|
|
#define TOUPPER(c) rb_toupper((unsigned char)(c))
|
|
|
|
#define TOLOWER(c) rb_tolower((unsigned char)(c))
|
2008-01-03 07:57:26 -05:00
|
|
|
|
|
|
|
int st_strcasecmp(const char *s1, const char *s2);
|
|
|
|
int st_strncasecmp(const char *s1, const char *s2, size_t n);
|
2008-01-01 07:24:04 -05:00
|
|
|
#define STRCASECMP(s1, s2) (st_strcasecmp(s1, s2))
|
|
|
|
#define STRNCASECMP(s1, s2, n) (st_strncasecmp(s1, s2, n))
|
|
|
|
|
2008-01-02 01:24:27 -05:00
|
|
|
unsigned long ruby_strtoul(const char *str, char **endptr, int base);
|
|
|
|
#define STRTOUL(str, endptr, base) (ruby_strtoul(str, endptr, base))
|
|
|
|
|
2008-01-03 07:57:26 -05:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
#if 0
|
|
|
|
{ /* satisfy cc-mode */
|
|
|
|
#endif
|
|
|
|
} /* extern "C" { */
|
|
|
|
#endif
|
2008-05-31 01:55:34 -04:00
|
|
|
#endif /* RUBY_RUBY_H */
|