source: trunk/src/gcc/libobjc/objc/objc-api.h@ 11

Last change on this file since 11 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 20.2 KB
Line 
1/* GNU Objective-C Runtime API.
2 Copyright (C) 1993, 1995, 1996, 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#ifndef __objc_api_INCLUDE_GNU
28#define __objc_api_INCLUDE_GNU
29
30#include "objc/objc.h"
31#include "objc/hash.h"
32#include "objc/thr.h"
33#include <stdio.h>
34#include <stdarg.h>
35
36/* For functions which return Method_t */
37#define METHOD_NULL (Method_t)0
38 /* Boolean typedefs */
39/*
40** Method descriptor returned by introspective Object methods.
41** This is really just the first part of the more complete objc_method
42** structure defined below and used internally by the runtime.
43*/
44struct objc_method_description
45{
46 SEL name; /* this is a selector, not a string */
47 char *types; /* type encoding */
48};
49
50/* Filer types used to describe Ivars and Methods. */
51#define _C_ID '@'
52#define _C_CLASS '#'
53#define _C_SEL ':'
54#define _C_CHR 'c'
55#define _C_UCHR 'C'
56#define _C_SHT 's'
57#define _C_USHT 'S'
58#define _C_INT 'i'
59#define _C_UINT 'I'
60#define _C_LNG 'l'
61#define _C_ULNG 'L'
62#define _C_LNG_LNG 'q'
63#define _C_ULNG_LNG 'Q'
64#define _C_FLT 'f'
65#define _C_DBL 'd'
66#define _C_BFLD 'b'
67#define _C_VOID 'v'
68#define _C_UNDEF '?'
69#define _C_PTR '^'
70#define _C_CHARPTR '*'
71#define _C_ATOM '%'
72#define _C_ARY_B '['
73#define _C_ARY_E ']'
74#define _C_UNION_B '('
75#define _C_UNION_E ')'
76#define _C_STRUCT_B '{'
77#define _C_STRUCT_E '}'
78#define _C_VECTOR '!'
79
80
81/*
82** Error handling
83**
84** Call objc_error() or objc_verror() to record an error; this error
85** routine will generally exit the program but not necessarily if the
86** user has installed his own error handler.
87**
88** Call objc_set_error_handler to assign your own function for
89** handling errors. The function should return YES if it is ok
90** to continue execution, or return NO or just abort if the
91** program should be stopped. The default error handler is just to
92** print a message on stderr.
93**
94** The error handler function should be of type objc_error_handler
95** The first parameter is an object instance of relevance.
96** The second parameter is an error code.
97** The third parameter is a format string in the printf style.
98** The fourth parameter is a variable list of arguments.
99*/
100extern void objc_error(id object, int code, const char* fmt, ...);
101extern void objc_verror(id object, int code, const char* fmt, va_list ap);
102typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);