Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby32/include/ruby
File: ruby.h
#ifndef RUBY_RUBY_H /*-*-C++-*-vi:se ft=cpp:*/
[0] Fix | Delete
#define RUBY_RUBY_H 1
[1] Fix | Delete
/**
[2] Fix | Delete
* @file
[3] Fix | Delete
* @author $Author$
[4] Fix | Delete
* @date Thu Jun 10 14:26:32 JST 1993
[5] Fix | Delete
* @copyright Copyright (C) 1993-2008 Yukihiro Matsumoto
[6] Fix | Delete
* @copyright Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
[7] Fix | Delete
* @copyright Copyright (C) 2000 Information-technology Promotion Agency, Japan
[8] Fix | Delete
* @copyright This file is a part of the programming language Ruby.
[9] Fix | Delete
* Permission is hereby granted, to either redistribute and/or
[10] Fix | Delete
* modify this file, provided that the conditions mentioned in the
[11] Fix | Delete
* file COPYING are met. Consult the file for details.
[12] Fix | Delete
*/
[13] Fix | Delete
#include "ruby/internal/config.h"
[14] Fix | Delete
[15] Fix | Delete
/* @shyouhei doesn't understand why we need <intrinsics.h> at this very
[16] Fix | Delete
* beginning of the entire <ruby.h> circus. */
[17] Fix | Delete
#ifdef HAVE_INTRINSICS_H
[18] Fix | Delete
# include <intrinsics.h>
[19] Fix | Delete
#endif
[20] Fix | Delete
[21] Fix | Delete
#include <stdarg.h>
[22] Fix | Delete
[23] Fix | Delete
#include "defines.h"
[24] Fix | Delete
#include "ruby/internal/abi.h"
[25] Fix | Delete
#include "ruby/internal/anyargs.h"
[26] Fix | Delete
#include "ruby/internal/arithmetic.h"
[27] Fix | Delete
#include "ruby/internal/core.h"
[28] Fix | Delete
#include "ruby/internal/ctype.h"
[29] Fix | Delete
#include "ruby/internal/dllexport.h"
[30] Fix | Delete
#include "ruby/internal/error.h"
[31] Fix | Delete
#include "ruby/internal/eval.h"
[32] Fix | Delete
#include "ruby/internal/event.h"
[33] Fix | Delete
#include "ruby/internal/fl_type.h"
[34] Fix | Delete
#include "ruby/internal/gc.h"
[35] Fix | Delete
#include "ruby/internal/glob.h"
[36] Fix | Delete
#include "ruby/internal/globals.h"
[37] Fix | Delete
#include "ruby/internal/has/warning.h"
[38] Fix | Delete
#include "ruby/internal/interpreter.h"
[39] Fix | Delete
#include "ruby/internal/iterator.h"
[40] Fix | Delete
#include "ruby/internal/memory.h"
[41] Fix | Delete
#include "ruby/internal/method.h"
[42] Fix | Delete
#include "ruby/internal/module.h"
[43] Fix | Delete
#include "ruby/internal/newobj.h"
[44] Fix | Delete
#include "ruby/internal/rgengc.h"
[45] Fix | Delete
#include "ruby/internal/scan_args.h"
[46] Fix | Delete
#include "ruby/internal/special_consts.h"
[47] Fix | Delete
#include "ruby/internal/symbol.h"
[48] Fix | Delete
#include "ruby/internal/value.h"
[49] Fix | Delete
#include "ruby/internal/value_type.h"
[50] Fix | Delete
#include "ruby/internal/variable.h"
[51] Fix | Delete
#include "ruby/assert.h"
[52] Fix | Delete
#include "ruby/backward/2/assume.h"
[53] Fix | Delete
#include "ruby/backward/2/inttypes.h"
[54] Fix | Delete
#include "ruby/backward/2/limits.h"
[55] Fix | Delete
[56] Fix | Delete
RBIMPL_SYMBOL_EXPORT_BEGIN()
[57] Fix | Delete
[58] Fix | Delete
/* Module#methods, #singleton_methods and so on return Symbols */
[59] Fix | Delete
/**
[60] Fix | Delete
* @private
[61] Fix | Delete
*
[62] Fix | Delete
* @deprecated This macro once was a thing in the old days, but makes no sense
[63] Fix | Delete
* any longer today. Exists here for backwards compatibility
[64] Fix | Delete
* only. You can safely forget about it.
[65] Fix | Delete
*/
[66] Fix | Delete
#define USE_SYMBOL_AS_METHOD_NAME 1
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Converts an object to a path. It first tries `#to_path` method if any, then
[70] Fix | Delete
* falls back to `#to_str` method.
[71] Fix | Delete
*
[72] Fix | Delete
* @param[in] obj Arbitrary ruby object.
[73] Fix | Delete
* @exception rb_eArgError `obj` contains a NUL byte.
[74] Fix | Delete
* @exception rb_eTypeError `obj` is not path-ish.
[75] Fix | Delete
* @exception rb_eEncCompatError No encoding conversion from `obj` to path.
[76] Fix | Delete
* @return Converted path object.
[77] Fix | Delete
*/
[78] Fix | Delete
VALUE rb_get_path(VALUE obj);
[79] Fix | Delete
[80] Fix | Delete
/**
[81] Fix | Delete
* Ensures that the parameter object is a path.
[82] Fix | Delete
*
[83] Fix | Delete
* @param[in,out] v Arbitrary ruby object.
[84] Fix | Delete
* @exception rb_eArgError `v` contains a NUL byte.
[85] Fix | Delete
* @exception rb_eTypeError `v` is not path-ish.
[86] Fix | Delete
* @exception rb_eEncCompatError `v` is not path-compatible.
[87] Fix | Delete
* @post `v` is a path.
[88] Fix | Delete
*/
[89] Fix | Delete
#define FilePathValue(v) (RB_GC_GUARD(v) = rb_get_path(v))
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* @deprecated This function is an alias of rb_get_path() now. The part that
[93] Fix | Delete
* did "no_checksafe" was deleted. It remains here because of no
[94] Fix | Delete
* harm.
[95] Fix | Delete
*/
[96] Fix | Delete
VALUE rb_get_path_no_checksafe(VALUE);
[97] Fix | Delete
[98] Fix | Delete
/**
[99] Fix | Delete
* @deprecated This macro is an alias of #FilePathValue now. The part that did
[100] Fix | Delete
* "String" was deleted. It remains here because of no harm.
[101] Fix | Delete
*/
[102] Fix | Delete
#define FilePathStringValue(v) ((v) = rb_get_path(v))
[103] Fix | Delete
[104] Fix | Delete
/** @cond INTERNAL_MACRO */
[105] Fix | Delete
#if defined(HAVE_BUILTIN___BUILTIN_CONSTANT_P) && defined(HAVE_STMT_AND_DECL_IN_EXPR)
[106] Fix | Delete
# define rb_varargs_argc_check_runtime(argc, vargc) \
[107] Fix | Delete
(((argc) <= (vargc)) ? (argc) : \
[108] Fix | Delete
(rb_fatal("argc(%d) exceeds actual arguments(%d)", \
[109] Fix | Delete
argc, vargc), 0))
[110] Fix | Delete
# define rb_varargs_argc_valid_p(argc, vargc) \
[111] Fix | Delete
((argc) == 0 ? (vargc) <= 1 : /* [ruby-core:85266] [Bug #14425] */ \
[112] Fix | Delete
(argc) == (vargc))
[113] Fix | Delete
# if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
[114] Fix | Delete
# ifdef HAVE_ATTRIBUTE_ERRORFUNC
[115] Fix | Delete
ERRORFUNC((" argument length doesn't match"), int rb_varargs_bad_length(int,int));
[116] Fix | Delete
# else
[117] Fix | Delete
# define rb_varargs_bad_length(argc, vargc) \
[118] Fix | Delete
((argc)/rb_varargs_argc_valid_p(argc, vargc))
[119] Fix | Delete
# endif
[120] Fix | Delete
# define rb_varargs_argc_check(argc, vargc) \
[121] Fix | Delete
__builtin_choose_expr(__builtin_constant_p(argc), \
[122] Fix | Delete
(rb_varargs_argc_valid_p(argc, vargc) ? (argc) : \
[123] Fix | Delete
rb_varargs_bad_length(argc, vargc)), \
[124] Fix | Delete
rb_varargs_argc_check_runtime(argc, vargc))
[125] Fix | Delete
# else
[126] Fix | Delete
# define rb_varargs_argc_check(argc, vargc) \
[127] Fix | Delete
rb_varargs_argc_check_runtime(argc, vargc)
[128] Fix | Delete
# endif
[129] Fix | Delete
#endif
[130] Fix | Delete
/** @endcond */
[131] Fix | Delete
[132] Fix | Delete
/**
[133] Fix | Delete
* Queries the name of the passed class.
[134] Fix | Delete
*
[135] Fix | Delete
* @param[in] klass An instance of a class.
[136] Fix | Delete
* @return The name of `klass`.
[137] Fix | Delete
* @note Return value is managed by our GC. Don't free.
[138] Fix | Delete
*/
[139] Fix | Delete
const char *rb_class2name(VALUE klass);
[140] Fix | Delete
[141] Fix | Delete
/**
[142] Fix | Delete
* Queries the name of the class of the passed object.
[143] Fix | Delete
*
[144] Fix | Delete
* @param[in] obj Arbitrary ruby object.
[145] Fix | Delete
* @return The name of the class of `obj`.
[146] Fix | Delete
* @note Return value is managed by our GC. Don't free.
[147] Fix | Delete
*/
[148] Fix | Delete
const char *rb_obj_classname(VALUE obj);
[149] Fix | Delete
[150] Fix | Delete
/**
[151] Fix | Delete
* Inspects an object. It first calls the argument's `#inspect` method, then
[152] Fix | Delete
* feeds its result string into ::rb_stdout.
[153] Fix | Delete
*
[154] Fix | Delete
* This is identical to Ruby level `Kernel#p`, except it takes only one object.
[155] Fix | Delete
*
[156] Fix | Delete
* @internal
[157] Fix | Delete
*
[158] Fix | Delete
* Above description is in fact inaccurate. This API interfaces with Ractors.
[159] Fix | Delete
*/
[160] Fix | Delete
void rb_p(VALUE obj);
[161] Fix | Delete
[162] Fix | Delete
/**
[163] Fix | Delete
* This function is an optimised version of calling `#==`. It checks equality
[164] Fix | Delete
* between two objects by first doing a fast identity check using using C's
[165] Fix | Delete
* `==` (same as `BasicObject#equal?`). If that check fails, it calls `#==`
[166] Fix | Delete
* dynamically. This optimisation actually affects semantics, because when
[167] Fix | Delete
* `#==` returns false for the same object obj, `rb_equal(obj, obj)` would
[168] Fix | Delete
* still return true. This happens for `Float::NAN`, where `Float::NAN ==
[169] Fix | Delete
* Float::NAN` is `false`, but `rb_equal(Float::NAN, Float::NAN)` is `true`.
[170] Fix | Delete
*
[171] Fix | Delete
* @param[in] lhs Comparison LHS.
[172] Fix | Delete
* @param[in] rhs Comparison RHS.
[173] Fix | Delete
* @retval RUBY_Qtrue They are the same.
[174] Fix | Delete
* @retval RUBY_Qfalse They are different.
[175] Fix | Delete
*/
[176] Fix | Delete
VALUE rb_equal(VALUE lhs, VALUE rhs);
[177] Fix | Delete
[178] Fix | Delete
/**
[179] Fix | Delete
* Identical to rb_require_string(), except it takes C's string instead of
[180] Fix | Delete
* Ruby's.
[181] Fix | Delete
*
[182] Fix | Delete
* @param[in] feature Name of a feature, e.g. `"json"`.
[183] Fix | Delete
* @exception rb_eLoadError No such feature.
[184] Fix | Delete
* @exception rb_eRuntimeError `$"` is frozen; unable to push.
[185] Fix | Delete
* @retval RUBY_Qtrue The feature is loaded for the first time.
[186] Fix | Delete
* @retval RUBY_Qfalse The feature has already been loaded.
[187] Fix | Delete
* @post `$"` is updated.
[188] Fix | Delete
*/
[189] Fix | Delete
VALUE rb_require(const char *feature);
[190] Fix | Delete
[191] Fix | Delete
#include "ruby/intern.h"
[192] Fix | Delete
[193] Fix | Delete
/**
[194] Fix | Delete
* @private
[195] Fix | Delete
*
[196] Fix | Delete
* @deprecated This macro once was a thing in the old days, but makes no sense
[197] Fix | Delete
* any longer today. Exists here for backwards compatibility
[198] Fix | Delete
* only. You can safely forget about it.
[199] Fix | Delete
*/
[200] Fix | Delete
#define RUBY_VM 1 /* YARV */
[201] Fix | Delete
[202] Fix | Delete
/**
[203] Fix | Delete
* @private
[204] Fix | Delete
*
[205] Fix | Delete
* @deprecated This macro once was a thing in the old days, but makes no sense
[206] Fix | Delete
* any longer today. Exists here for backwards compatibility
[207] Fix | Delete
* only. You can safely forget about it.
[208] Fix | Delete
*/
[209] Fix | Delete
#define HAVE_NATIVETHREAD
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* Queries if the thread which calls this function is a ruby's thread.
[213] Fix | Delete
* "Ruby's" in this context is a thread created using one of our APIs like
[214] Fix | Delete
* rb_thread_create(). There are distinctions between ruby's and other
[215] Fix | Delete
* threads. For instance calling ruby methods are allowed only from inside of
[216] Fix | Delete
* a ruby's thread.
[217] Fix | Delete
*
[218] Fix | Delete
* @retval 1 The current thread is a Ruby's thread.
[219] Fix | Delete
* @retval 0 The current thread is a random thread from outside of Ruby.
[220] Fix | Delete
*/
[221] Fix | Delete
int ruby_native_thread_p(void);
[222] Fix | Delete
[223] Fix | Delete
/**
[224] Fix | Delete
* @private
[225] Fix | Delete
*
[226] Fix | Delete
* This macro is for internal use. Must be a mistake to place here.
[227] Fix | Delete
*/
[228] Fix | Delete
#define InitVM(ext) {void InitVM_##ext(void);InitVM_##ext();}
[229] Fix | Delete
[230] Fix | Delete
RBIMPL_ATTR_NONNULL((3))
[231] Fix | Delete
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 4)
[232] Fix | Delete
/**
[233] Fix | Delete
* Our own locale-insensitive version of `snprintf(3)`. It can also be seen as
[234] Fix | Delete
* a routine identical to rb_sprintf(), except it writes back to the passed
[235] Fix | Delete
* buffer instead of allocating a new Ruby object.
[236] Fix | Delete
*
[237] Fix | Delete
* @param[out] str Return buffer
[238] Fix | Delete
* @param[in] n Number of bytes of `str`.
[239] Fix | Delete
* @param[in] fmt A `printf`-like format specifier.
[240] Fix | Delete
* @param[in] ... Variadic number of contents to format.
[241] Fix | Delete
* @return Number of bytes that would have been written to `str`, if `n`
[242] Fix | Delete
* was large enough. Comparing this to `n` can give you insights
[243] Fix | Delete
* that the buffer is too small or too big. Especially passing 0
[244] Fix | Delete
* to `n` gives you the exact number of bytes necessary to hold
[245] Fix | Delete
* the result string without writing anything to anywhere.
[246] Fix | Delete
* @post `str` holds up to `n-1` bytes of formatted contents (and the
[247] Fix | Delete
* terminating NUL character.)
[248] Fix | Delete
*/
[249] Fix | Delete
int ruby_snprintf(char *str, size_t n, char const *fmt, ...);
[250] Fix | Delete
[251] Fix | Delete
RBIMPL_ATTR_NONNULL((3))
[252] Fix | Delete
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 3, 0)
[253] Fix | Delete
/**
[254] Fix | Delete
* Identical to ruby_snprintf(), except it takes a `va_list`. It can also be
[255] Fix | Delete
* seen as a routine identical to rb_vsprintf(), except it writes back to the
[256] Fix | Delete
* passed buffer instead of allocating a new Ruby object.
[257] Fix | Delete
*
[258] Fix | Delete
* @param[out] str Return buffer
[259] Fix | Delete
* @param[in] n Number of bytes of `str`.
[260] Fix | Delete
* @param[in] fmt A `printf`-like format specifier.
[261] Fix | Delete
* @param[in] ap Contents to format.
[262] Fix | Delete
* @return Number of bytes that would have been written to `str`, if `n`
[263] Fix | Delete
* was large enough. Comparing this to `n` can give you insights
[264] Fix | Delete
* that the buffer is too small or too big. Especially passing 0
[265] Fix | Delete
* to `n` gives you the exact number of bytes necessary to hold
[266] Fix | Delete
* the result string without writing anything to anywhere.
[267] Fix | Delete
* @post `str` holds up to `n-1` bytes of formatted contents (and the
[268] Fix | Delete
* terminating NUL character.)
[269] Fix | Delete
*/
[270] Fix | Delete
int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
[271] Fix | Delete
[272] Fix | Delete
/** @cond INTERNAL_MACRO */
[273] Fix | Delete
#if RBIMPL_HAS_WARNING("-Wgnu-zero-variadic-macro-arguments")
[274] Fix | Delete
# /* Skip it; clang -pedantic doesn't like the following */
[275] Fix | Delete
#elif defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) && defined(__OPTIMIZE__)
[276] Fix | Delete
# define rb_yield_values(argc, ...) \
[277] Fix | Delete
__extension__({ \
[278] Fix | Delete
const int rb_yield_values_argc = (argc); \
[279] Fix | Delete
const VALUE rb_yield_values_args[] = {__VA_ARGS__}; \
[280] Fix | Delete
const int rb_yield_values_nargs = \
[281] Fix | Delete
(int)(sizeof(rb_yield_values_args) / sizeof(VALUE)); \
[282] Fix | Delete
rb_yield_values2( \
[283] Fix | Delete
rb_varargs_argc_check(rb_yield_values_argc, rb_yield_values_nargs), \
[284] Fix | Delete
rb_yield_values_nargs ? rb_yield_values_args : NULL); \
[285] Fix | Delete
})
[286] Fix | Delete
[287] Fix | Delete
# define rb_funcall(recv, mid, argc, ...) \
[288] Fix | Delete
__extension__({ \
[289] Fix | Delete
const int rb_funcall_argc = (argc); \
[290] Fix | Delete
const VALUE rb_funcall_args[] = {__VA_ARGS__}; \
[291] Fix | Delete
const int rb_funcall_nargs = \
[292] Fix | Delete
(int)(sizeof(rb_funcall_args) / sizeof(VALUE)); \
[293] Fix | Delete
rb_funcallv(recv, mid, \
[294] Fix | Delete
rb_varargs_argc_check(rb_funcall_argc, rb_funcall_nargs), \
[295] Fix | Delete
rb_funcall_nargs ? rb_funcall_args : NULL); \
[296] Fix | Delete
})
[297] Fix | Delete
#endif
[298] Fix | Delete
/** @endcond */
[299] Fix | Delete
[300] Fix | Delete
#ifndef RUBY_DONT_SUBST
[301] Fix | Delete
#include "ruby/subst.h"
[302] Fix | Delete
#endif
[303] Fix | Delete
[304] Fix | Delete
#if !defined RUBY_EXPORT && !defined RUBY_NO_OLD_COMPATIBILITY
[305] Fix | Delete
# include "ruby/backward.h"
[306] Fix | Delete
#endif
[307] Fix | Delete
[308] Fix | Delete
RBIMPL_SYMBOL_EXPORT_END()
[309] Fix | Delete
[310] Fix | Delete
#endif /* RUBY_RUBY_H */
[311] Fix | Delete
[312] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function