source: trunk/src/gcc/libobjc/Object.m@ 2230

Last change on this file since 2230 was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 8.1 KB
Line 
1/* The implementation of class Object for Objective-C.
2 Copyright (C) 1993, 1994, 1995, 1997, 2002 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU CC is distributed in the hope that it will be useful, but WITHOUT
12ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21/* As a special exception, if you link this library with files compiled
22 with GCC to produce an executable, this does not cause the resulting
23 executable to be covered by the GNU General Public License. This
24 exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27#include <stdarg.h>
28#include "objc/Object.h"
29#include "objc/Protocol.h"
30#include "objc/objc-api.h"
31
32extern int errno;
33
34#define MAX_CLASS_NAME_LEN 256
35
36@implementation Object
37
38+ initialize
39{
40 return self;
41}
42
43- init
44{
45 return self;
46}
47
48+ new
49{
50 return [[self alloc] init];
51}
52
53+ alloc
54{
55 return class_create_instance(self);
56}
57
58- free
59{
60 return object_dispose(self);
61}
62
63- copy
64{
65 return [[self shallowCopy] deepen];
66}
67
68- shallowCopy
69{
70 return object_copy(self);
71}
72
73- deepen
74{
75 return self;
76}
77
78- deepCopy
79{
80 return [self copy];
81}
82
83- (Class)class
84{
85 return object_get_class(self);
86}
87
88- (Class)superClass
89{
90 return object_get_super_class(self);
91}
92
93- (MetaClass)metaClass
94{
95 return object_get_meta_class(self);
96}
97
98- (const char *)name