forked from MacRuby/MacRuby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrote class flags to not use the version field anymore, better typi…
…ng system, fixed misc bugs git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@3968 23306eb0-4c56-4727-a40e-e92c0eb68959
- Loading branch information
Showing
23 changed files
with
246 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file is covered by the Ruby license. See COPYING for more details. | ||
* | ||
* Copyright (C) 2010, Apple Inc. All rights reserved. | ||
*/ | ||
|
||
#ifndef __CLASS_H_ | ||
#define __CLASS_H_ | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#define RCLASS_IS_OBJECT_SUBCLASS (1<<1) /* class is a true RBObject subclass */ | ||
#define RCLASS_IS_RUBY_CLASS (1<<2) /* class was created from Ruby */ | ||
#define RCLASS_IS_MODULE (1<<3) /* class represents a Ruby Module */ | ||
#define RCLASS_IS_SINGLETON (1<<4) /* class represents a singleton */ | ||
#define RCLASS_IS_FROZEN (1<<5) /* class is frozen */ | ||
#define RCLASS_IS_TAINTED (1<<6) /* class is tainted */ | ||
#define RCLASS_IS_INCLUDED (1<<10) /* module is included */ | ||
#define RCLASS_HAS_ROBJECT_ALLOC (1<<11) /* class uses the default RObject alloc */ | ||
#define RCLASS_SCOPE_PRIVATE (1<<12) /* class opened for private methods */ | ||
#define RCLASS_SCOPE_PROTECTED (1<<13) /* class opened for protected methods */ | ||
#define RCLASS_SCOPE_MOD_FUNC (1<<14) /* class opened for module_function methods */ | ||
#define RCLASS_KVO_CHECK_DONE (1<<15) /* class created by KVO and flags merged */ | ||
#define RCLASS_NO_IV_SLOTS (1<<16) /* class cannot hold ivar slots (T_DATA & friends) */ | ||
|
||
unsigned long rb_class_get_flags(Class k); | ||
void rb_class_set_flags(Class k, unsigned long flags); | ||
|
||
#define RCLASS_VERSION(m) (rb_class_get_flags((Class)m)) | ||
#define RCLASS_SET_VERSION(m,f) (rb_class_set_flags((Class)m, (unsigned long)f)) | ||
#define RCLASS_SET_VERSION_FLAG(m,f) (RCLASS_SET_VERSION((Class)m, (RCLASS_VERSION(m) | f))) | ||
|
||
#define RCLASS_RUBY(m) ((RCLASS_VERSION(m) & RCLASS_IS_RUBY_CLASS) == RCLASS_IS_RUBY_CLASS) | ||
#define RCLASS_MODULE(m) ((RCLASS_VERSION(m) & RCLASS_IS_MODULE) == RCLASS_IS_MODULE) | ||
#define RCLASS_SINGLETON(m) ((RCLASS_VERSION(m) & RCLASS_IS_SINGLETON) == RCLASS_IS_SINGLETON) | ||
|
||
CFMutableDictionaryRef rb_class_ivar_dict(VALUE); | ||
CFMutableDictionaryRef rb_class_ivar_dict_or_create(VALUE); | ||
void rb_class_ivar_set_dict(VALUE, CFMutableDictionaryRef); | ||
|
||
#if defined(__cplusplus) | ||
} // extern "C" | ||
#endif | ||
|
||
#endif // __CLASS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.