]> git.ipfire.org Git - thirdparty/gcc.git/blame - libobjc/objc-private/selector.h
Update copyright years.
[thirdparty/gcc.git] / libobjc / objc-private / selector.h
CommitLineData
e270313e 1/* GNU Objective C Runtime selector implementation - Private functions
fbd26352 2 Copyright (C) 2010-2019 Free Software Foundation, Inc.
e270313e 3 Contributed by Nicola Pero <nicola.pero@meta-innovation.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under the
8terms of the GNU General Public License as published by the Free Software
9Foundation; either version 3, or (at your option) any later version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14details.
15
16Under Section 7 of GPL version 3, you are granted additional
17permissions described in the GCC Runtime Library Exception, version
183.1, as published by the Free Software Foundation.
19
20You should have received a copy of the GNU General Public License and
21a copy of the GCC Runtime Library Exception along with this program;
22see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23<http://www.gnu.org/licenses/>. */
24
25#ifndef __objc_private_selector_INCLUDE_GNU
26#define __objc_private_selector_INCLUDE_GNU
27
e270313e 28/* Private runtime functions that may go away or be rewritten or
29 replaced. */
30
09b10428 31/* Definition of a selector. Selectors themselves are not unique, but
32 the sel_id is a unique identifier. */
72c46466 33struct objc_selector
34{
35 void *sel_id;
36 const char *sel_types;
37};
38
09b10428 39/* An inline, fast version of sel_isEqual(). */
72c46466 40inline static BOOL
41sel_eq (SEL s1, SEL s2)
42{
43 if (s1 == 0 || s2 == 0)
44 return s1 == s2;
45 else
46 return s1->sel_id == s2->sel_id;
47}
48
4fb8ab65 49/* Number of selectors stored in each of the selector tables. */
50extern unsigned int __objc_selector_max_index;
51
52/* Initialize the selector tables. This must be called by init.c. */
53void __objc_init_selector_tables(void);
54
55/* Various private functions to register selectors. */
56void __objc_register_selectors_from_class(Class);
57void __objc_register_selectors_from_list (struct objc_method_list *);
58void __objc_register_selectors_from_description_list
59(struct objc_method_description_list *method_list);
33f86c6f 60void __objc_register_selectors_from_module (struct objc_selector *selectors);
4fb8ab65 61
e270313e 62/* Return whether a selector is mapped or not ("mapped" meaning that
63 it has been inserted into the selector table). This is private as
64 only the runtime should ever encounter or need to know about
65 unmapped selectors. */
66BOOL sel_is_mapped (SEL aSel);
67
68/* Return selector representing name without registering it if it
69 doesn't exist. Typically used internally by the runtime when it's
70 looking up methods that may or may not exist (such as +initialize)
71 in the most efficient way. */
72SEL
73sel_get_any_uid (const char *name);
74
e270313e 75#endif /* not __objc_private_selector_INCLUDE_GNU */