Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/include/ruby
File: ruby.h
/**********************************************************************
[0] Fix | Delete
[1] Fix | Delete
ruby/ruby.h -
[2] Fix | Delete
[3] Fix | Delete
$Author$
[4] Fix | Delete
created at: Thu Jun 10 14:26:32 JST 1993
[5] Fix | Delete
[6] Fix | Delete
Copyright (C) 1993-2008 Yukihiro Matsumoto
[7] Fix | Delete
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
[8] Fix | Delete
Copyright (C) 2000 Information-technology Promotion Agency, Japan
[9] Fix | Delete
[10] Fix | Delete
**********************************************************************/
[11] Fix | Delete
[12] Fix | Delete
#ifndef RUBY_RUBY_H
[13] Fix | Delete
#define RUBY_RUBY_H 1
[14] Fix | Delete
[15] Fix | Delete
#if defined(__cplusplus)
[16] Fix | Delete
extern "C" {
[17] Fix | Delete
#if 0
[18] Fix | Delete
} /* satisfy cc-mode */
[19] Fix | Delete
#endif
[20] Fix | Delete
#endif
[21] Fix | Delete
[22] Fix | Delete
#include "ruby/config.h"
[23] Fix | Delete
#ifdef RUBY_EXTCONF_H
[24] Fix | Delete
#include RUBY_EXTCONF_H
[25] Fix | Delete
#endif
[26] Fix | Delete
[27] Fix | Delete
#include "defines.h"
[28] Fix | Delete
#include "ruby/assert.h"
[29] Fix | Delete
[30] Fix | Delete
/* For MinGW, we need __declspec(dllimport) for RUBY_EXTERN on MJIT.
[31] Fix | Delete
mswin's RUBY_EXTERN already has that. See also: win32/Makefile.sub */
[32] Fix | Delete
#if defined(MJIT_HEADER) && defined(_WIN32) && defined(__GNUC__)
[33] Fix | Delete
# undef RUBY_EXTERN
[34] Fix | Delete
# define RUBY_EXTERN extern __declspec(dllimport)
[35] Fix | Delete
#endif
[36] Fix | Delete
[37] Fix | Delete
#if defined(__cplusplus)
[38] Fix | Delete
/* __builtin_choose_expr and __builtin_types_compatible aren't available
[39] Fix | Delete
* on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
[40] Fix | Delete
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
[41] Fix | Delete
# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
[42] Fix | Delete
#elif GCC_VERSION_BEFORE(4,8,6) /* Bug #14221 */
[43] Fix | Delete
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
[44] Fix | Delete
#endif
[45] Fix | Delete
[46] Fix | Delete
#ifndef ASSUME
[47] Fix | Delete
# ifdef UNREACHABLE
[48] Fix | Delete
# define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
[49] Fix | Delete
# else
[50] Fix | Delete
# define ASSUME(x) ((void)(x))
[51] Fix | Delete
# endif
[52] Fix | Delete
#endif
[53] Fix | Delete
#ifndef UNREACHABLE_RETURN
[54] Fix | Delete
# ifdef UNREACHABLE
[55] Fix | Delete
# define UNREACHABLE_RETURN(val) UNREACHABLE
[56] Fix | Delete
# else
[57] Fix | Delete
# define UNREACHABLE_RETURN(val) return (val)
[58] Fix | Delete
# endif
[59] Fix | Delete
#endif
[60] Fix | Delete
#ifndef UNREACHABLE
[61] Fix | Delete
# define UNREACHABLE ((void)0) /* unreachable */
[62] Fix | Delete
#endif
[63] Fix | Delete
[64] Fix | Delete
#define RUBY_MACRO_SELECT(base, n) TOKEN_PASTE(base, n)
[65] Fix | Delete
[66] Fix | Delete
#ifdef HAVE_INTRINSICS_H
[67] Fix | Delete
# include <intrinsics.h>
[68] Fix | Delete
#endif
[69] Fix | Delete
[70] Fix | Delete
#include <stdarg.h>
[71] Fix | Delete
[72] Fix | Delete
RUBY_SYMBOL_EXPORT_BEGIN
[73] Fix | Delete
[74] Fix | Delete
/* Make alloca work the best possible way. */
[75] Fix | Delete
#ifdef __GNUC__
[76] Fix | Delete
# ifndef alloca
[77] Fix | Delete
# define alloca __builtin_alloca
[78] Fix | Delete
# endif
[79] Fix | Delete
#else
[80] Fix | Delete
# ifdef HAVE_ALLOCA_H
[81] Fix | Delete
# include <alloca.h>
[82] Fix | Delete
# else
[83] Fix | Delete
# ifdef _AIX
[84] Fix | Delete
#pragma alloca
[85] Fix | Delete
# else
[86] Fix | Delete
# ifndef alloca /* predefined by HP cc +Olibcalls */
[87] Fix | Delete
void *alloca();
[88] Fix | Delete
# endif
[89] Fix | Delete
# endif /* AIX */
[90] Fix | Delete
# endif /* HAVE_ALLOCA_H */
[91] Fix | Delete
#endif /* __GNUC__ */
[92] Fix | Delete
[93] Fix | Delete
#if defined HAVE_UINTPTR_T && 0
[94] Fix | Delete
typedef uintptr_t VALUE;
[95] Fix | Delete
typedef uintptr_t ID;
[96] Fix | Delete
# define SIGNED_VALUE intptr_t
[97] Fix | Delete
# define SIZEOF_VALUE SIZEOF_UINTPTR_T
[98] Fix | Delete
# undef PRI_VALUE_PREFIX
[99] Fix | Delete
#elif SIZEOF_LONG == SIZEOF_VOIDP
[100] Fix | Delete
typedef unsigned long VALUE;
[101] Fix | Delete
typedef unsigned long ID;
[102] Fix | Delete
# define SIGNED_VALUE long
[103] Fix | Delete
# define SIZEOF_VALUE SIZEOF_LONG
[104] Fix | Delete
# define PRI_VALUE_PREFIX "l"
[105] Fix | Delete
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
[106] Fix | Delete
typedef unsigned LONG_LONG VALUE;
[107] Fix | Delete
typedef unsigned LONG_LONG ID;
[108] Fix | Delete
# define SIGNED_VALUE LONG_LONG
[109] Fix | Delete
# define LONG_LONG_VALUE 1
[110] Fix | Delete
# define SIZEOF_VALUE SIZEOF_LONG_LONG
[111] Fix | Delete
# define PRI_VALUE_PREFIX PRI_LL_PREFIX
[112] Fix | Delete
#else
[113] Fix | Delete
# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<----
[114] Fix | Delete
#endif
[115] Fix | Delete
[116] Fix | Delete
typedef char ruby_check_sizeof_int[SIZEOF_INT == sizeof(int) ? 1 : -1];
[117] Fix | Delete
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
[118] Fix | Delete
#ifdef HAVE_LONG_LONG
[119] Fix | Delete
typedef char ruby_check_sizeof_long_long[SIZEOF_LONG_LONG == sizeof(LONG_LONG) ? 1 : -1];
[120] Fix | Delete
#endif
[121] Fix | Delete
typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
[122] Fix | Delete
[123] Fix | Delete
#ifndef PRI_INT_PREFIX
[124] Fix | Delete
#define PRI_INT_PREFIX ""
[125] Fix | Delete
#endif
[126] Fix | Delete
#ifndef PRI_LONG_PREFIX
[127] Fix | Delete
#define PRI_LONG_PREFIX "l"
[128] Fix | Delete
#endif
[129] Fix | Delete
#ifndef PRI_SHORT_PREFIX
[130] Fix | Delete
#define PRI_SHORT_PREFIX "h"
[131] Fix | Delete
#endif
[132] Fix | Delete
[133] Fix | Delete
#ifndef PRI_64_PREFIX
[134] Fix | Delete
#if SIZEOF_LONG == 8
[135] Fix | Delete
#define PRI_64_PREFIX PRI_LONG_PREFIX
[136] Fix | Delete
#elif SIZEOF_LONG_LONG == 8
[137] Fix | Delete
#define PRI_64_PREFIX PRI_LL_PREFIX
[138] Fix | Delete
#endif
[139] Fix | Delete
#endif
[140] Fix | Delete
[141] Fix | Delete
#ifndef PRIdPTR
[142] Fix | Delete
#define PRIdPTR PRI_PTR_PREFIX"d"
[143] Fix | Delete
#define PRIiPTR PRI_PTR_PREFIX"i"
[144] Fix | Delete
#define PRIoPTR PRI_PTR_PREFIX"o"
[145] Fix | Delete
#define PRIuPTR PRI_PTR_PREFIX"u"
[146] Fix | Delete
#define PRIxPTR PRI_PTR_PREFIX"x"
[147] Fix | Delete
#define PRIXPTR PRI_PTR_PREFIX"X"
[148] Fix | Delete
#endif
[149] Fix | Delete
[150] Fix | Delete
#define RUBY_PRI_VALUE_MARK "\v"
[151] Fix | Delete
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
[152] Fix | Delete
#define PRIdVALUE PRIdPTR
[153] Fix | Delete
#define PRIoVALUE PRIoPTR
[154] Fix | Delete
#define PRIuVALUE PRIuPTR
[155] Fix | Delete
#define PRIxVALUE PRIxPTR
[156] Fix | Delete
#define PRIXVALUE PRIXPTR
[157] Fix | Delete
#define PRIsVALUE PRIiPTR"" RUBY_PRI_VALUE_MARK
[158] Fix | Delete
#else
[159] Fix | Delete
#define PRIdVALUE PRI_VALUE_PREFIX"d"
[160] Fix | Delete
#define PRIoVALUE PRI_VALUE_PREFIX"o"
[161] Fix | Delete
#define PRIuVALUE PRI_VALUE_PREFIX"u"
[162] Fix | Delete
#define PRIxVALUE PRI_VALUE_PREFIX"x"
[163] Fix | Delete
#define PRIXVALUE PRI_VALUE_PREFIX"X"
[164] Fix | Delete
#define PRIsVALUE PRI_VALUE_PREFIX"i" RUBY_PRI_VALUE_MARK
[165] Fix | Delete
#endif
[166] Fix | Delete
#ifndef PRI_VALUE_PREFIX
[167] Fix | Delete
# define PRI_VALUE_PREFIX ""
[168] Fix | Delete
#endif
[169] Fix | Delete
[170] Fix | Delete
#ifndef PRI_TIMET_PREFIX
[171] Fix | Delete
# if SIZEOF_TIME_T == SIZEOF_INT
[172] Fix | Delete
# define PRI_TIMET_PREFIX
[173] Fix | Delete
# elif SIZEOF_TIME_T == SIZEOF_LONG
[174] Fix | Delete
# define PRI_TIMET_PREFIX "l"
[175] Fix | Delete
# elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
[176] Fix | Delete
# define PRI_TIMET_PREFIX PRI_LL_PREFIX
[177] Fix | Delete
# endif
[178] Fix | Delete
#endif
[179] Fix | Delete
[180] Fix | Delete
#if defined PRI_PTRDIFF_PREFIX
[181] Fix | Delete
#elif SIZEOF_PTRDIFF_T == SIZEOF_INT
[182] Fix | Delete
# define PRI_PTRDIFF_PREFIX ""
[183] Fix | Delete
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG
[184] Fix | Delete
# define PRI_PTRDIFF_PREFIX "l"
[185] Fix | Delete
#elif SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
[186] Fix | Delete
# define PRI_PTRDIFF_PREFIX PRI_LL_PREFIX
[187] Fix | Delete
#endif
[188] Fix | Delete
#define PRIdPTRDIFF PRI_PTRDIFF_PREFIX"d"
[189] Fix | Delete
#define PRIiPTRDIFF PRI_PTRDIFF_PREFIX"i"
[190] Fix | Delete
#define PRIoPTRDIFF PRI_PTRDIFF_PREFIX"o"
[191] Fix | Delete
#define PRIuPTRDIFF PRI_PTRDIFF_PREFIX"u"
[192] Fix | Delete
#define PRIxPTRDIFF PRI_PTRDIFF_PREFIX"x"
[193] Fix | Delete
#define PRIXPTRDIFF PRI_PTRDIFF_PREFIX"X"
[194] Fix | Delete
[195] Fix | Delete
#if defined PRI_SIZE_PREFIX
[196] Fix | Delete
#elif SIZEOF_SIZE_T == SIZEOF_INT
[197] Fix | Delete
# define PRI_SIZE_PREFIX ""
[198] Fix | Delete
#elif SIZEOF_SIZE_T == SIZEOF_LONG
[199] Fix | Delete
# define PRI_SIZE_PREFIX "l"
[200] Fix | Delete
#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
[201] Fix | Delete
# define PRI_SIZE_PREFIX PRI_LL_PREFIX
[202] Fix | Delete
#endif
[203] Fix | Delete
#define PRIdSIZE PRI_SIZE_PREFIX"d"
[204] Fix | Delete
#define PRIiSIZE PRI_SIZE_PREFIX"i"
[205] Fix | Delete
#define PRIoSIZE PRI_SIZE_PREFIX"o"
[206] Fix | Delete
#define PRIuSIZE PRI_SIZE_PREFIX"u"
[207] Fix | Delete
#define PRIxSIZE PRI_SIZE_PREFIX"x"
[208] Fix | Delete
#define PRIXSIZE PRI_SIZE_PREFIX"X"
[209] Fix | Delete
[210] Fix | Delete
#ifdef __STDC__
[211] Fix | Delete
# include <limits.h>
[212] Fix | Delete
#else
[213] Fix | Delete
# ifndef LONG_MAX
[214] Fix | Delete
# ifdef HAVE_LIMITS_H
[215] Fix | Delete
# include <limits.h>
[216] Fix | Delete
# else
[217] Fix | Delete
/* assuming 32bit(2's complement) long */
[218] Fix | Delete
# define LONG_MAX 2147483647
[219] Fix | Delete
# endif
[220] Fix | Delete
# endif
[221] Fix | Delete
# ifndef LONG_MIN
[222] Fix | Delete
# define LONG_MIN (-LONG_MAX-1)
[223] Fix | Delete
# endif
[224] Fix | Delete
# ifndef CHAR_BIT
[225] Fix | Delete
# define CHAR_BIT 8
[226] Fix | Delete
# endif
[227] Fix | Delete
#endif
[228] Fix | Delete
[229] Fix | Delete
#ifdef HAVE_LONG_LONG
[230] Fix | Delete
# ifndef LLONG_MAX
[231] Fix | Delete
# ifdef LONG_LONG_MAX
[232] Fix | Delete
# define LLONG_MAX LONG_LONG_MAX
[233] Fix | Delete
# else
[234] Fix | Delete
# ifdef _I64_MAX
[235] Fix | Delete
# define LLONG_MAX _I64_MAX
[236] Fix | Delete
# else
[237] Fix | Delete
/* assuming 64bit(2's complement) long long */
[238] Fix | Delete
# define LLONG_MAX 9223372036854775807LL
[239] Fix | Delete
# endif
[240] Fix | Delete
# endif
[241] Fix | Delete
# endif
[242] Fix | Delete
# ifndef LLONG_MIN
[243] Fix | Delete
# ifdef LONG_LONG_MIN
[244] Fix | Delete
# define LLONG_MIN LONG_LONG_MIN
[245] Fix | Delete
# else
[246] Fix | Delete
# ifdef _I64_MIN
[247] Fix | Delete
# define LLONG_MIN _I64_MIN
[248] Fix | Delete
# else
[249] Fix | Delete
# define LLONG_MIN (-LLONG_MAX-1)
[250] Fix | Delete
# endif
[251] Fix | Delete
# endif
[252] Fix | Delete
# endif
[253] Fix | Delete
#endif
[254] Fix | Delete
[255] Fix | Delete
#define RUBY_FIXNUM_MAX (LONG_MAX>>1)
[256] Fix | Delete
#define RUBY_FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
[257] Fix | Delete
#define FIXNUM_MAX RUBY_FIXNUM_MAX
[258] Fix | Delete
#define FIXNUM_MIN RUBY_FIXNUM_MIN
[259] Fix | Delete
[260] Fix | Delete
#define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
[261] Fix | Delete
#define INT2FIX(i) RB_INT2FIX(i)
[262] Fix | Delete
#define RB_LONG2FIX(i) RB_INT2FIX(i)
[263] Fix | Delete
#define LONG2FIX(i) RB_INT2FIX(i)
[264] Fix | Delete
#define rb_fix_new(v) RB_INT2FIX(v)
[265] Fix | Delete
VALUE rb_int2inum(intptr_t);
[266] Fix | Delete
[267] Fix | Delete
#define rb_int_new(v) rb_int2inum(v)
[268] Fix | Delete
VALUE rb_uint2inum(uintptr_t);
[269] Fix | Delete
[270] Fix | Delete
#define rb_uint_new(v) rb_uint2inum(v)
[271] Fix | Delete
[272] Fix | Delete
#ifdef HAVE_LONG_LONG
[273] Fix | Delete
VALUE rb_ll2inum(LONG_LONG);
[274] Fix | Delete
#define LL2NUM(v) rb_ll2inum(v)
[275] Fix | Delete
VALUE rb_ull2inum(unsigned LONG_LONG);
[276] Fix | Delete
#define ULL2NUM(v) rb_ull2inum(v)
[277] Fix | Delete
#endif
[278] Fix | Delete
[279] Fix | Delete
#ifndef OFFT2NUM
[280] Fix | Delete
#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
[281] Fix | Delete
# define OFFT2NUM(v) LL2NUM(v)
[282] Fix | Delete
#elif SIZEOF_OFF_T == SIZEOF_LONG
[283] Fix | Delete
# define OFFT2NUM(v) LONG2NUM(v)
[284] Fix | Delete
#else
[285] Fix | Delete
# define OFFT2NUM(v) INT2NUM(v)
[286] Fix | Delete
#endif
[287] Fix | Delete
#endif
[288] Fix | Delete
[289] Fix | Delete
#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
[290] Fix | Delete
# define SIZET2NUM(v) ULL2NUM(v)
[291] Fix | Delete
# define SSIZET2NUM(v) LL2NUM(v)
[292] Fix | Delete
#elif SIZEOF_SIZE_T == SIZEOF_LONG
[293] Fix | Delete
# define SIZET2NUM(v) ULONG2NUM(v)
[294] Fix | Delete
# define SSIZET2NUM(v) LONG2NUM(v)
[295] Fix | Delete
#else
[296] Fix | Delete
# define SIZET2NUM(v) UINT2NUM(v)
[297] Fix | Delete
# define SSIZET2NUM(v) INT2NUM(v)
[298] Fix | Delete
#endif
[299] Fix | Delete
[300] Fix | Delete
#ifndef SIZE_MAX
[301] Fix | Delete
# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
[302] Fix | Delete
# define SIZE_MAX ULLONG_MAX
[303] Fix | Delete
# define SIZE_MIN ULLONG_MIN
[304] Fix | Delete
# elif SIZEOF_SIZE_T == SIZEOF_LONG
[305] Fix | Delete
# define SIZE_MAX ULONG_MAX
[306] Fix | Delete
# define SIZE_MIN ULONG_MIN
[307] Fix | Delete
# elif SIZEOF_SIZE_T == SIZEOF_INT
[308] Fix | Delete
# define SIZE_MAX UINT_MAX
[309] Fix | Delete
# define SIZE_MIN UINT_MIN
[310] Fix | Delete
# else
[311] Fix | Delete
# define SIZE_MAX USHRT_MAX
[312] Fix | Delete
# define SIZE_MIN USHRT_MIN
[313] Fix | Delete
# endif
[314] Fix | Delete
#endif
[315] Fix | Delete
[316] Fix | Delete
#ifndef SSIZE_MAX
[317] Fix | Delete
# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
[318] Fix | Delete
# define SSIZE_MAX LLONG_MAX
[319] Fix | Delete
# define SSIZE_MIN LLONG_MIN
[320] Fix | Delete
# elif SIZEOF_SIZE_T == SIZEOF_LONG
[321] Fix | Delete
# define SSIZE_MAX LONG_MAX
[322] Fix | Delete
# define SSIZE_MIN LONG_MIN
[323] Fix | Delete
# elif SIZEOF_SIZE_T == SIZEOF_INT
[324] Fix | Delete
# define SSIZE_MAX INT_MAX
[325] Fix | Delete
# define SSIZE_MIN INT_MIN
[326] Fix | Delete
# else
[327] Fix | Delete
# define SSIZE_MAX SHRT_MAX
[328] Fix | Delete
# define SSIZE_MIN SHRT_MIN
[329] Fix | Delete
# endif
[330] Fix | Delete
#endif
[331] Fix | Delete
[332] Fix | Delete
#if SIZEOF_INT < SIZEOF_VALUE
[333] Fix | Delete
NORETURN(void rb_out_of_int(SIGNED_VALUE num));
[334] Fix | Delete
#endif
[335] Fix | Delete
[336] Fix | Delete
#if SIZEOF_INT < SIZEOF_LONG
[337] Fix | Delete
static inline int
[338] Fix | Delete
rb_long2int_inline(long n)
[339] Fix | Delete
{
[340] Fix | Delete
int i = (int)n;
[341] Fix | Delete
if ((long)i != n)
[342] Fix | Delete
rb_out_of_int(n);
[343] Fix | Delete
[344] Fix | Delete
return i;
[345] Fix | Delete
}
[346] Fix | Delete
#define rb_long2int(n) rb_long2int_inline(n)
[347] Fix | Delete
#else
[348] Fix | Delete
#define rb_long2int(n) ((int)(n))
[349] Fix | Delete
#endif
[350] Fix | Delete
[351] Fix | Delete
#ifndef PIDT2NUM
[352] Fix | Delete
#define PIDT2NUM(v) LONG2NUM(v)
[353] Fix | Delete
#endif
[354] Fix | Delete
#ifndef NUM2PIDT
[355] Fix | Delete
#define NUM2PIDT(v) NUM2LONG(v)
[356] Fix | Delete
#endif
[357] Fix | Delete
#ifndef UIDT2NUM
[358] Fix | Delete
#define UIDT2NUM(v) LONG2NUM(v)
[359] Fix | Delete
#endif
[360] Fix | Delete
#ifndef NUM2UIDT
[361] Fix | Delete
#define NUM2UIDT(v) NUM2LONG(v)
[362] Fix | Delete
#endif
[363] Fix | Delete
#ifndef GIDT2NUM
[364] Fix | Delete
#define GIDT2NUM(v) LONG2NUM(v)
[365] Fix | Delete
#endif
[366] Fix | Delete
#ifndef NUM2GIDT
[367] Fix | Delete
#define NUM2GIDT(v) NUM2LONG(v)
[368] Fix | Delete
#endif
[369] Fix | Delete
#ifndef NUM2MODET
[370] Fix | Delete
#define NUM2MODET(v) NUM2INT(v)
[371] Fix | Delete
#endif
[372] Fix | Delete
#ifndef MODET2NUM
[373] Fix | Delete
#define MODET2NUM(v) INT2NUM(v)
[374] Fix | Delete
#endif
[375] Fix | Delete
[376] Fix | Delete
#define RB_FIX2LONG(x) ((long)RSHIFT((SIGNED_VALUE)(x),1))
[377] Fix | Delete
static inline long
[378] Fix | Delete
rb_fix2long(VALUE x)
[379] Fix | Delete
{
[380] Fix | Delete
return RB_FIX2LONG(x);
[381] Fix | Delete
}
[382] Fix | Delete
#define RB_FIX2ULONG(x) ((unsigned long)RB_FIX2LONG(x))
[383] Fix | Delete
static inline unsigned long
[384] Fix | Delete
rb_fix2ulong(VALUE x)
[385] Fix | Delete
{
[386] Fix | Delete
return RB_FIX2ULONG(x);
[387] Fix | Delete
}
[388] Fix | Delete
#define RB_FIXNUM_P(f) (((int)(SIGNED_VALUE)(f))&RUBY_FIXNUM_FLAG)
[389] Fix | Delete
#define RB_POSFIXABLE(f) ((f) < RUBY_FIXNUM_MAX+1)
[390] Fix | Delete
#define RB_NEGFIXABLE(f) ((f) >= RUBY_FIXNUM_MIN)
[391] Fix | Delete
#define RB_FIXABLE(f) (RB_POSFIXABLE(f) && RB_NEGFIXABLE(f))
[392] Fix | Delete
#define FIX2LONG(x) RB_FIX2LONG(x)
[393] Fix | Delete
#define FIX2ULONG(x) RB_FIX2ULONG(x)
[394] Fix | Delete
#define FIXNUM_P(f) RB_FIXNUM_P(f)
[395] Fix | Delete
#define POSFIXABLE(f) RB_POSFIXABLE(f)
[396] Fix | Delete
#define NEGFIXABLE(f) RB_NEGFIXABLE(f)
[397] Fix | Delete
#define FIXABLE(f) RB_FIXABLE(f)
[398] Fix | Delete
[399] Fix | Delete
#define RB_IMMEDIATE_P(x) ((VALUE)(x) & RUBY_IMMEDIATE_MASK)
[400] Fix | Delete
#define IMMEDIATE_P(x) RB_IMMEDIATE_P(x)
[401] Fix | Delete
[402] Fix | Delete
ID rb_sym2id(VALUE);
[403] Fix | Delete
VALUE rb_id2sym(ID);
[404] Fix | Delete
#define RB_STATIC_SYM_P(x) (((VALUE)(x)&~((~(VALUE)0)<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG)
[405] Fix | Delete
#define RB_DYNAMIC_SYM_P(x) (!RB_SPECIAL_CONST_P(x) && RB_BUILTIN_TYPE(x) == (RUBY_T_SYMBOL))
[406] Fix | Delete
#define RB_SYMBOL_P(x) (RB_STATIC_SYM_P(x)||RB_DYNAMIC_SYM_P(x))
[407] Fix | Delete
#define RB_ID2SYM(x) (rb_id2sym(x))
[408] Fix | Delete
#define RB_SYM2ID(x) (rb_sym2id(x))
[409] Fix | Delete
#define STATIC_SYM_P(x) RB_STATIC_SYM_P(x)
[410] Fix | Delete
#define DYNAMIC_SYM_P(x) RB_DYNAMIC_SYM_P(x)
[411] Fix | Delete
#define SYMBOL_P(x) RB_SYMBOL_P(x)
[412] Fix | Delete
#define ID2SYM(x) RB_ID2SYM(x)
[413] Fix | Delete
#define SYM2ID(x) RB_SYM2ID(x)
[414] Fix | Delete
[415] Fix | Delete
#ifndef USE_FLONUM
[416] Fix | Delete
#if SIZEOF_VALUE >= SIZEOF_DOUBLE
[417] Fix | Delete
#define USE_FLONUM 1
[418] Fix | Delete
#else
[419] Fix | Delete
#define USE_FLONUM 0
[420] Fix | Delete
#endif
[421] Fix | Delete
#endif
[422] Fix | Delete
[423] Fix | Delete
#if USE_FLONUM
[424] Fix | Delete
#define RB_FLONUM_P(x) ((((int)(SIGNED_VALUE)(x))&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG)
[425] Fix | Delete
#else
[426] Fix | Delete
#define RB_FLONUM_P(x) 0
[427] Fix | Delete
#endif
[428] Fix | Delete
#define FLONUM_P(x) RB_FLONUM_P(x)
[429] Fix | Delete
[430] Fix | Delete
/* Module#methods, #singleton_methods and so on return Symbols */
[431] Fix | Delete
#define USE_SYMBOL_AS_METHOD_NAME 1
[432] Fix | Delete
[433] Fix | Delete
/* special constants - i.e. non-zero and non-fixnum constants */
[434] Fix | Delete
enum ruby_special_consts {
[435] Fix | Delete
#if USE_FLONUM
[436] Fix | Delete
RUBY_Qfalse = 0x00, /* ...0000 0000 */
[437] Fix | Delete
RUBY_Qtrue = 0x14, /* ...0001 0100 */
[438] Fix | Delete
RUBY_Qnil = 0x08, /* ...0000 1000 */
[439] Fix | Delete
RUBY_Qundef = 0x34, /* ...0011 0100 */
[440] Fix | Delete
[441] Fix | Delete
RUBY_IMMEDIATE_MASK = 0x07,
[442] Fix | Delete
RUBY_FIXNUM_FLAG = 0x01, /* ...xxxx xxx1 */
[443] Fix | Delete
RUBY_FLONUM_MASK = 0x03,
[444] Fix | Delete
RUBY_FLONUM_FLAG = 0x02, /* ...xxxx xx10 */
[445] Fix | Delete
RUBY_SYMBOL_FLAG = 0x0c, /* ...0000 1100 */
[446] Fix | Delete
#else
[447] Fix | Delete
RUBY_Qfalse = 0, /* ...0000 0000 */
[448] Fix | Delete
RUBY_Qtrue = 2, /* ...0000 0010 */
[449] Fix | Delete
RUBY_Qnil = 4, /* ...0000 0100 */
[450] Fix | Delete
RUBY_Qundef = 6, /* ...0000 0110 */
[451] Fix | Delete
[452] Fix | Delete
RUBY_IMMEDIATE_MASK = 0x03,
[453] Fix | Delete
RUBY_FIXNUM_FLAG = 0x01, /* ...xxxx xxx1 */
[454] Fix | Delete
RUBY_FLONUM_MASK = 0x00, /* any values ANDed with FLONUM_MASK cannot be FLONUM_FLAG */
[455] Fix | Delete
RUBY_FLONUM_FLAG = 0x02,
[456] Fix | Delete
RUBY_SYMBOL_FLAG = 0x0e, /* ...0000 1110 */
[457] Fix | Delete
#endif
[458] Fix | Delete
RUBY_SPECIAL_SHIFT = 8
[459] Fix | Delete
};
[460] Fix | Delete
[461] Fix | Delete
#define RUBY_Qfalse ((VALUE)RUBY_Qfalse)
[462] Fix | Delete
#define RUBY_Qtrue ((VALUE)RUBY_Qtrue)
[463] Fix | Delete
#define RUBY_Qnil ((VALUE)RUBY_Qnil)
[464] Fix | Delete
#define RUBY_Qundef ((VALUE)RUBY_Qundef) /* undefined value for placeholder */
[465] Fix | Delete
#define Qfalse RUBY_Qfalse
[466] Fix | Delete
#define Qtrue RUBY_Qtrue
[467] Fix | Delete
#define Qnil RUBY_Qnil
[468] Fix | Delete
#define Qundef RUBY_Qundef
[469] Fix | Delete
#define IMMEDIATE_MASK RUBY_IMMEDIATE_MASK
[470] Fix | Delete
#define FIXNUM_FLAG RUBY_FIXNUM_FLAG
[471] Fix | Delete
#if USE_FLONUM
[472] Fix | Delete
#define FLONUM_MASK RUBY_FLONUM_MASK
[473] Fix | Delete
#define FLONUM_FLAG RUBY_FLONUM_FLAG
[474] Fix | Delete
#endif
[475] Fix | Delete
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
[476] Fix | Delete
[477] Fix | Delete
#define RB_TEST(v) !(((VALUE)(v) & (VALUE)~RUBY_Qnil) == 0)
[478] Fix | Delete
#define RB_NIL_P(v) !((VALUE)(v) != RUBY_Qnil)
[479] Fix | Delete
#define RTEST(v) RB_TEST(v)
[480] Fix | Delete
#define NIL_P(v) RB_NIL_P(v)
[481] Fix | Delete
[482] Fix | Delete
#define CLASS_OF(v) rb_class_of((VALUE)(v))
[483] Fix | Delete
[484] Fix | Delete
enum ruby_value_type {
[485] Fix | Delete
RUBY_T_NONE = 0x00,
[486] Fix | Delete
[487] Fix | Delete
RUBY_T_OBJECT = 0x01,
[488] Fix | Delete
RUBY_T_CLASS = 0x02,
[489] Fix | Delete
RUBY_T_MODULE = 0x03,
[490] Fix | Delete
RUBY_T_FLOAT = 0x04,
[491] Fix | Delete
RUBY_T_STRING = 0x05,
[492] Fix | Delete
RUBY_T_REGEXP = 0x06,
[493] Fix | Delete
RUBY_T_ARRAY = 0x07,
[494] Fix | Delete
RUBY_T_HASH = 0x08,
[495] Fix | Delete
RUBY_T_STRUCT = 0x09,
[496] Fix | Delete
RUBY_T_BIGNUM = 0x0a,
[497] Fix | Delete
RUBY_T_FILE = 0x0b,
[498] Fix | Delete
RUBY_T_DATA = 0x0c,
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function