2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #import "NSMethodSignature+misc.h"
26 @implementation NSMethodSignature(misc)
28 #if NeXT_Foundation_LIBRARY
29 - (NSString *)objCTypes {
30 return [NSString stringWithCString:self->_types];
33 - (NSString *)objCTypes {
34 char buf[256], *bufPos = buf;
35 int argCount = [self numberOfArguments];
36 char *pos1 = NULL, *pos2 = NULL;
39 #if GNUSTEP_BASE_LIBRARY
40 pos1 = (char *)[self methodType];
42 pos1 = (char *)[self types];
44 pos2 = (char *)objc_skip_typespec(pos1);
45 strncpy(bufPos, pos1, pos2 - pos1);
46 bufPos += pos2 - pos1;
48 pos1 = (char *)objc_skip_offset(pos2);
54 for (i = 0; i < argCount; i++) {
55 pos2 = (char *)objc_skip_typespec(pos1); // forward to offset
56 strncpy(bufPos, pos1, pos2 - pos1);
57 bufPos += pos2 - pos1;
59 pos1 = (char *)objc_skip_offset(pos2); // forward to next type
64 return [NSString stringWithCString:buf];
68 @end /* NSMethodSignature(misc) */
70 void __link_NSMethodSignature_misc() {
71 __link_NSMethodSignature_misc();