]> err.no Git - sope/blob - gnustep-objc/globals.c
fixed mapping of 'method' attribute
[sope] / gnustep-objc / globals.c
1 /* GNU Objective C Runtime class related functions
2    Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
3    Contributed by Kresten Krab Thorup and Dennis Glatting.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify it under the
8 terms of the GNU General Public License as published by the Free Software
9 Foundation; either version 2, or (at your option) any later version.
10
11 GNU CC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14 details.
15
16 You should have received a copy of the GNU General Public License along with
17 GNU CC; see the file COPYING.  If not, write to the Free Software
18 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19
20 /* As a special exception, if you link this library with files compiled with
21    GCC to produce an executable, this does not cause the resulting executable
22    to be covered by the GNU General Public License. This exception does not
23    however invalidate any other reasons why the executable file might be
24    covered by the GNU General Public License.  */
25
26 #include "objc-decls.h"
27 #include "runtime.h"            /* the kitchen sink */
28
29 /*
30   Global variables used in the Objective-C runtime.
31 */
32
33 /* deprecated: */
34
35 objc_DECLARE void *__objc_uninstalled_dtable = NULL;
36
37 /* ******************** from class.c: ******************** */
38
39 /* The table of classname->class.  Used for objc_lookup_class and friends */
40 objc_DECLARE cache_ptr __objc_class_hash = 0;                 /* !T:MUTEX */
41
42 /* This is a hook which is called by objc_get_class and 
43    objc_lookup_class if the runtime is not able to find the class.
44    This may e.g. try to load in the class using dynamic loading */
45 objc_DECLARE Class (*_objc_lookup_class)(const char* name) = 0;      /* !T:SAFE */
46
47
48 /* True when class links has been resolved */     
49 objc_DECLARE BOOL __objc_class_links_resolved = NO;                  /* !T:UNUSED */
50
51
52 /* ******************** from init.c: ********************* */
53
54 /* This list contains all modules currently loaded into the runtime */
55 objc_DECLARE struct objc_list* __objc_module_list = 0;  /* !T:MUTEX */
56
57 /* This list contains all proto_list's not yet assigned class links */
58 objc_DECLARE struct objc_list* __objc_unclaimed_proto_list = 0;         /* !T:MUTEX */
59
60 /* List of unresolved static instances.  */
61 objc_DECLARE struct objc_list *__objc_uninitialized_statics = 0;        /* !T:MUTEX */
62
63 /* Global runtime "write" mutex. */
64 objc_DECLARE objc_mutex_t __objc_runtime_mutex = 0;
65
66 /* Number of threads that are alive. */
67 objc_DECLARE int __objc_runtime_threads_alive = 1;                      /* !T:MUTEX */
68
69 /* This is a hook which is called by __objc_exec_class every time a class
70    or a category is loaded into the runtime.  This may e.g. help a
71    dynamic loader determine the classes that have been loaded when
72    an object file is dynamically linked in */
73 objc_DECLARE void (*_objc_load_callback)(Class class, Category* category); /* !T:SAFE */
74
75 /* Is all categories/classes resolved? */
76 objc_DECLARE BOOL __objc_dangling_categories = NO;           /* !T:UNUSED */
77
78 /* This is a linked list of objc_class_tree trees. The head of these trees
79    are root classes (their super class is Nil). These different trees
80    represent different class hierarchies. */
81 objc_DECLARE struct objc_list *__objc_class_tree_list = NULL;
82
83 /* Keeps the +load methods who have been already executed. This hash should
84    not be destroyed during the execution of the program. */
85 objc_DECLARE cache_ptr __objc_load_methods = NULL;
86
87
88 /* ******************** from selector.c: ********************* */
89
90 /* Tables mapping selector names to uid and opposite */
91 objc_DECLARE struct sarray* __objc_selector_array = 0; /* uid -> sel-list !T:MUTEX */
92 objc_DECLARE struct sarray* __objc_selector_names = 0; /* uid -> name     !T:MUTEX */
93 objc_DECLARE cache_ptr      __objc_selector_hash  = 0; /* name -> uid     !T:MUTEX */
94
95 /* Number of selectors stored in each of the above tables */
96 objc_DECLARE int __objc_selector_max_index = 0;              /* !T:MUTEX */
97
98 objc_DECLARE IMP (*__objc_msg_lookup)(id, SEL) = NULL;
99 objc_DECLARE IMP (*__objc_class_get_method)(Class, SEL) = NULL;