2000-05-01 13:42:38 +04:00
|
|
|
/**********************************************************************
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
inits.c -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
created at: Tue Dec 28 16:01:58 JST 1993
|
|
|
|
|
* 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-25 07:29:39 +04:00
|
|
|
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2000-05-01 13:42:38 +04:00
|
|
|
**********************************************************************/
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2019-12-04 11:16:30 +03:00
|
|
|
#include "internal/inits.h"
|
|
|
|
#include "ruby.h"
|
2019-11-14 21:51:06 +03:00
|
|
|
#include "builtin.h"
|
2019-12-29 04:07:17 +03:00
|
|
|
static void Init_builtin_prelude(void);
|
2019-11-14 21:51:06 +03:00
|
|
|
#include "prelude.rbinc"
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2008-11-07 16:52:07 +03:00
|
|
|
#define CALL(n) {void Init_##n(void); Init_##n();}
|
1998-01-16 15:19:22 +03:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
void
|
2008-11-07 16:52:07 +03:00
|
|
|
rb_call_inits(void)
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2022-11-08 23:35:31 +03:00
|
|
|
CALL(default_shapes);
|
2020-07-01 00:19:18 +03:00
|
|
|
CALL(Thread_Mutex);
|
2018-11-08 08:35:46 +03:00
|
|
|
CALL(vm_postponed_job);
|
2014-09-18 04:36:37 +04:00
|
|
|
CALL(Method);
|
2015-11-30 23:32:42 +03:00
|
|
|
CALL(RandomSeedCore);
|
2019-04-13 19:05:58 +03:00
|
|
|
CALL(encodings);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(sym);
|
|
|
|
CALL(var_tables);
|
|
|
|
CALL(Object);
|
|
|
|
CALL(top_self);
|
|
|
|
CALL(Encoding);
|
|
|
|
CALL(Comparable);
|
|
|
|
CALL(Enumerable);
|
|
|
|
CALL(String);
|
|
|
|
CALL(Exception);
|
|
|
|
CALL(eval);
|
|
|
|
CALL(jump);
|
|
|
|
CALL(Numeric);
|
|
|
|
CALL(Bignum);
|
|
|
|
CALL(syserr);
|
|
|
|
CALL(Array);
|
|
|
|
CALL(Hash);
|
|
|
|
CALL(Struct);
|
|
|
|
CALL(Regexp);
|
2019-12-29 04:07:17 +03:00
|
|
|
CALL(pack);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(transcode);
|
|
|
|
CALL(marshal);
|
|
|
|
CALL(Range);
|
|
|
|
CALL(IO);
|
2021-07-02 13:41:16 +03:00
|
|
|
CALL(IO_Buffer)
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(Dir);
|
|
|
|
CALL(Time);
|
|
|
|
CALL(Random);
|
|
|
|
CALL(signal);
|
|
|
|
CALL(load);
|
|
|
|
CALL(Proc);
|
|
|
|
CALL(Binding);
|
|
|
|
CALL(Math);
|
2019-12-29 04:07:17 +03:00
|
|
|
CALL(GC);
|
2023-03-06 22:45:02 +03:00
|
|
|
CALL(WeakMap);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(Enumerator);
|
2020-03-09 20:22:11 +03:00
|
|
|
CALL(Ractor);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(VM);
|
|
|
|
CALL(ISeq);
|
|
|
|
CALL(Thread);
|
2021-02-09 09:39:56 +03:00
|
|
|
CALL(Fiber_Scheduler);
|
2014-09-12 23:42:01 +04:00
|
|
|
CALL(process);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(Cont);
|
|
|
|
CALL(Rational);
|
|
|
|
CALL(Complex);
|
2020-09-25 14:32:02 +03:00
|
|
|
CALL(MemoryView);
|
2008-11-07 16:52:07 +03:00
|
|
|
CALL(version);
|
2019-12-29 04:07:17 +03:00
|
|
|
CALL(vm_trace);
|
2018-09-11 12:48:58 +03:00
|
|
|
CALL(vm_stack_canary);
|
2019-12-29 04:07:17 +03:00
|
|
|
CALL(ast);
|
2019-04-24 06:52:57 +03:00
|
|
|
CALL(gc_stress);
|
2022-10-03 18:14:32 +03:00
|
|
|
CALL(shape);
|
2023-06-20 18:48:12 +03:00
|
|
|
CALL(YARP);
|
2019-11-07 10:58:00 +03:00
|
|
|
|
2019-11-14 21:51:06 +03:00
|
|
|
// enable builtin loading
|
2019-11-07 10:58:00 +03:00
|
|
|
CALL(builtin);
|
2020-05-16 11:37:28 +03:00
|
|
|
}
|
2019-11-07 12:22:08 +03:00
|
|
|
|
2020-05-16 11:37:28 +03:00
|
|
|
void
|
|
|
|
rb_call_builtin_inits(void)
|
|
|
|
{
|
2019-12-29 04:07:17 +03:00
|
|
|
#define BUILTIN(n) CALL(builtin_##n)
|
|
|
|
BUILTIN(gc);
|
2020-03-09 20:22:11 +03:00
|
|
|
BUILTIN(ractor);
|
2021-01-02 05:39:07 +03:00
|
|
|
BUILTIN(numeric);
|
2019-12-29 04:07:17 +03:00
|
|
|
BUILTIN(io);
|
2020-01-18 07:59:21 +03:00
|
|
|
BUILTIN(dir);
|
2019-12-29 04:07:17 +03:00
|
|
|
BUILTIN(ast);
|
|
|
|
BUILTIN(trace_point);
|
|
|
|
BUILTIN(pack);
|
|
|
|
BUILTIN(warning);
|
2020-01-26 12:27:40 +03:00
|
|
|
BUILTIN(array);
|
2020-03-17 13:37:07 +03:00
|
|
|
BUILTIN(kernel);
|
2022-11-16 08:34:30 +03:00
|
|
|
BUILTIN(symbol);
|
2020-12-31 11:23:37 +03:00
|
|
|
BUILTIN(timev);
|
2022-07-26 18:40:00 +03:00
|
|
|
BUILTIN(thread_sync);
|
2021-10-18 16:06:03 +03:00
|
|
|
BUILTIN(yjit);
|
2021-06-03 06:04:56 +03:00
|
|
|
BUILTIN(nilclass);
|
2021-09-18 16:34:15 +03:00
|
|
|
BUILTIN(marshal);
|
2023-03-07 10:15:30 +03:00
|
|
|
#if USE_RJIT
|
2023-03-07 10:17:25 +03:00
|
|
|
BUILTIN(rjit_c);
|
|
|
|
BUILTIN(rjit);
|
2022-06-15 20:19:33 +03:00
|
|
|
#endif
|
2019-12-29 04:07:17 +03:00
|
|
|
Init_builtin_prelude();
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
2008-11-07 16:52:07 +03:00
|
|
|
#undef CALL
|