mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* internal.h: add for internal use only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2082417a48
commit
52f5f410e4
16 changed files with 66 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed May 18 22:41:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* internal.h: add for internal use only.
|
||||
|
||||
Wed May 18 22:36:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval.c (setup_exception): internal exception should be hidden
|
||||
|
|
1
class.c
1
class.c
|
@ -28,6 +28,7 @@
|
|||
#include "method.h"
|
||||
#include "constant.h"
|
||||
#include "vm_core.h"
|
||||
#include "internal.h"
|
||||
#include <ctype.h>
|
||||
|
||||
extern st_table *rb_class_tbl;
|
||||
|
|
18
common.mk
18
common.mk
|
@ -585,7 +585,7 @@ VM_CORE_H_INCLUDES = {$(VPATH)}vm_core.h {$(VPATH)}thread_$(THREAD_MODEL).h \
|
|||
array.$(OBJEXT): {$(VPATH)}array.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
|
||||
bignum.$(OBJEXT): {$(VPATH)}bignum.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
|
||||
class.$(OBJEXT): {$(VPATH)}class.c $(RUBY_H_INCLUDES) \
|
||||
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
|
||||
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h {$(VPATH)}internal.h
|
||||
compar.$(OBJEXT): {$(VPATH)}compar.c $(RUBY_H_INCLUDES)
|
||||
complex.$(OBJEXT): {$(VPATH)}complex.c $(RUBY_H_INCLUDES)
|
||||
dir.$(OBJEXT): {$(VPATH)}dir.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
|
||||
|
@ -616,7 +616,7 @@ file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
|
|||
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
|
||||
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
|
||||
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
|
||||
{$(VPATH)}debug.h
|
||||
{$(VPATH)}debug.h {$(VPATH)}internal.h
|
||||
hash.$(OBJEXT): {$(VPATH)}hash.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
|
||||
inits.$(OBJEXT): {$(VPATH)}inits.c $(RUBY_H_INCLUDES)
|
||||
io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
|
||||
|
@ -624,13 +624,14 @@ io.$(OBJEXT): {$(VPATH)}io.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
|
|||
main.$(OBJEXT): {$(VPATH)}main.c $(RUBY_H_INCLUDES) {$(VPATH)}debug.h \
|
||||
{$(VPATH)}node.h
|
||||
marshal.$(OBJEXT): {$(VPATH)}marshal.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
|
||||
$(ENCODING_H_INCLUDES) {$(VPATH)}util.h
|
||||
$(ENCODING_H_INCLUDES) {$(VPATH)}util.h {$(VPATH)}internal.h
|
||||
math.$(OBJEXT): {$(VPATH)}math.c $(RUBY_H_INCLUDES)
|
||||
node.$(OBJEXT): {$(VPATH)}node.c $(RUBY_H_INCLUDES) \
|
||||
$(VM_CORE_H_INCLUDES)
|
||||
numeric.$(OBJEXT): {$(VPATH)}numeric.c $(RUBY_H_INCLUDES) \
|
||||
{$(VPATH)}util.h $(ENCODING_H_INCLUDES)
|
||||
object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
|
||||
object.$(OBJEXT): {$(VPATH)}object.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h \
|
||||
{$(VPATH)}internal.h
|
||||
pack.$(OBJEXT): {$(VPATH)}pack.c $(RUBY_H_INCLUDES) {$(VPATH)}encoding.h \
|
||||
{$(VPATH)}oniguruma.h
|
||||
parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
|
||||
|
@ -640,7 +641,7 @@ parse.$(OBJEXT): {$(VPATH)}parse.c $(RUBY_H_INCLUDES) {$(VPATH)}node.h \
|
|||
{$(VPATH)}parse.h
|
||||
proc.$(OBJEXT): {$(VPATH)}proc.c {$(VPATH)}eval_intern.h \
|
||||
$(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
|
||||
{$(VPATH)}debug.h
|
||||
{$(VPATH)}debug.h {$(VPATH)}internal.h
|
||||
process.$(OBJEXT): {$(VPATH)}process.c $(RUBY_H_INCLUDES) \
|
||||
{$(VPATH)}util.h {$(VPATH)}io.h $(ENCODING_H_INCLUDES) {$(VPATH)}dln.h \
|
||||
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
|
||||
|
@ -681,7 +682,7 @@ strftime.$(OBJEXT): {$(VPATH)}strftime.c {$(VPATH)}ruby.h \
|
|||
{$(VPATH)}intern.h {$(VPATH)}st.h {$(VPATH)}timev.h
|
||||
string.$(OBJEXT): {$(VPATH)}string.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
|
||||
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES)
|
||||
struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES)
|
||||
struct.$(OBJEXT): {$(VPATH)}struct.c $(RUBY_H_INCLUDES) {$(VPATH)}internal.h
|
||||
thread.$(OBJEXT): {$(VPATH)}thread.c {$(VPATH)}eval_intern.h \
|
||||
$(RUBY_H_INCLUDES) {$(VPATH)}gc.h $(VM_CORE_H_INCLUDES) \
|
||||
{$(VPATH)}debug.h {$(VPATH)}thread_$(THREAD_MODEL).c
|
||||
|
@ -695,7 +696,7 @@ time.$(OBJEXT): {$(VPATH)}time.c $(RUBY_H_INCLUDES) \
|
|||
util.$(OBJEXT): {$(VPATH)}util.c $(RUBY_H_INCLUDES) {$(VPATH)}util.h
|
||||
variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
|
||||
{$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h \
|
||||
{$(VPATH)}oniguruma.h
|
||||
{$(VPATH)}oniguruma.h {$(VPATH)}internal.h
|
||||
version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
|
||||
{$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h
|
||||
dmyversion.$(OBJEXT): {$(VPATH)}dmyversion.c version.$(OBJEXT)
|
||||
|
@ -712,7 +713,8 @@ vm.$(OBJEXT): {$(VPATH)}vm.c {$(VPATH)}gc.h {$(VPATH)}iseq.h \
|
|||
$(VM_CORE_H_INCLUDES) {$(VPATH)}vm_method.c {$(VPATH)}vm_eval.c \
|
||||
{$(VPATH)}vm_insnhelper.c {$(VPATH)}vm_insnhelper.h {$(VPATH)}vm_exec.c \
|
||||
{$(VPATH)}vm_exec.h {$(VPATH)}insns.def {$(VPATH)}vmtc.inc \
|
||||
{$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h
|
||||
{$(VPATH)}vm.inc {$(VPATH)}insns.inc {$(VPATH)}debug.h \
|
||||
{$(VPATH)}internal.h
|
||||
vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c $(RUBY_H_INCLUDES) \
|
||||
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
|
||||
debug.$(OBJEXT): {$(VPATH)}debug.c $(RUBY_H_INCLUDES) \
|
||||
|
|
|
@ -436,14 +436,14 @@ get_digest_base_metadata(VALUE klass)
|
|||
VALUE obj;
|
||||
rb_digest_metadata_t *algo;
|
||||
|
||||
for (p = klass; p; p = RCLASS_SUPER(p)) {
|
||||
for (p = klass; !NIL_P(p); p = rb_class_superclass(p)) {
|
||||
if (rb_ivar_defined(p, id_metadata)) {
|
||||
obj = rb_ivar_get(p, id_metadata);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!p)
|
||||
if (NIL_P(p))
|
||||
rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby");
|
||||
|
||||
Data_Get_Struct(obj, rb_digest_metadata_t, algo);
|
||||
|
|
3
ext/objspace/depend
Normal file
3
ext/objspace/depend
Normal file
|
@ -0,0 +1,3 @@
|
|||
objspace.o: $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/io.h \
|
||||
$(hdrdir)/ruby/re.h $(top_srcdir)/node.h $(top_srcdir)/gc.h \
|
||||
$(top_srcdir)/regint.h $(top_srcdir)/internal.h
|
|
@ -30,6 +30,7 @@
|
|||
#include "node.h"
|
||||
#include "gc.h"
|
||||
#include "regint.h"
|
||||
#include "internal.h"
|
||||
|
||||
size_t rb_str_memsize(VALUE);
|
||||
size_t rb_ary_memsize(VALUE);
|
||||
|
|
1
gc.c
1
gc.c
|
@ -18,6 +18,7 @@
|
|||
#include "ruby/util.h"
|
||||
#include "eval_intern.h"
|
||||
#include "vm_core.h"
|
||||
#include "internal.h"
|
||||
#include "gc.h"
|
||||
#include "constant.h"
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -518,6 +518,7 @@ VALUE rb_obj_id(VALUE);
|
|||
VALUE rb_obj_class(VALUE);
|
||||
VALUE rb_class_real(VALUE);
|
||||
VALUE rb_class_inherited_p(VALUE, VALUE);
|
||||
VALUE rb_class_superclass(VALUE);
|
||||
VALUE rb_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
|
||||
VALUE rb_check_to_integer(VALUE, const char *);
|
||||
|
|
|
@ -609,11 +609,7 @@ struct RObject {
|
|||
ROBJECT(o)->as.heap.iv_index_tbl)
|
||||
|
||||
/** @internal */
|
||||
typedef struct {
|
||||
VALUE super;
|
||||
struct st_table *iv_tbl;
|
||||
struct st_table *const_tbl;
|
||||
} rb_classext_t;
|
||||
typedef struct rb_classext_struct rb_classext_t;
|
||||
|
||||
struct RClass {
|
||||
struct RBasic basic;
|
||||
|
|
35
internal.h
Normal file
35
internal.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**********************************************************************
|
||||
|
||||
internal.h -
|
||||
|
||||
$Author$
|
||||
created at: Tue May 17 11:42:20 JST 2011
|
||||
|
||||
Copyright (C) 2011 Yukihiro Matsumoto
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef RUBY_INTERNAL_H
|
||||
#define RUBY_INTERNAL_H 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#if 0
|
||||
} /* satisfy cc-mode */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct rb_classext_struct {
|
||||
VALUE super;
|
||||
struct st_table *iv_tbl;
|
||||
struct st_table *const_tbl;
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if 0
|
||||
{ /* satisfy cc-mode */
|
||||
#endif
|
||||
} /* extern "C" { */
|
||||
#endif
|
||||
|
||||
#endif /* RUBY_INTERNAL_H */
|
|
@ -14,6 +14,7 @@
|
|||
#include "ruby/st.h"
|
||||
#include "ruby/util.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "internal.h"
|
||||
|
||||
#include <math.h>
|
||||
#ifdef HAVE_FLOAT_H
|
||||
|
|
3
object.c
3
object.c
|
@ -20,6 +20,7 @@
|
|||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include "constant.h"
|
||||
#include "internal.h"
|
||||
|
||||
VALUE rb_cBasicObject;
|
||||
VALUE rb_mKernel;
|
||||
|
@ -1601,7 +1602,7 @@ rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
|
|||
*
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
VALUE
|
||||
rb_class_superclass(VALUE klass)
|
||||
{
|
||||
VALUE super = RCLASS_SUPER(klass);
|
||||
|
|
1
proc.c
1
proc.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "eval_intern.h"
|
||||
#include "internal.h"
|
||||
#include "gc.h"
|
||||
|
||||
struct METHOD {
|
||||
|
|
1
struct.c
1
struct.c
|
@ -10,6 +10,7 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
#include "internal.h"
|
||||
|
||||
VALUE rb_cStruct;
|
||||
static ID id_members;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "ruby/encoding.h"
|
||||
#include "node.h"
|
||||
#include "constant.h"
|
||||
#include "internal.h"
|
||||
|
||||
void rb_vm_change_state(void);
|
||||
void rb_vm_inc_const_missing_count(void);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "insns.inc"
|
||||
#include <math.h>
|
||||
#include "constant.h"
|
||||
#include "internal.h"
|
||||
|
||||
/* control stack frame */
|
||||
|
||||
|
|
Loading…
Reference in a new issue