2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #import "NSMethodSignature+misc.h"
25 @implementation NSMethodSignature(misc)
27 #if NeXT_Foundation_LIBRARY
28 - (NSString *)objCTypes {
29 return [NSString stringWithCString:self->_types];
32 - (NSString *)objCTypes {
33 char buf[256], *bufPos = buf;
34 int argCount = [self numberOfArguments];
35 char *pos1 = NULL, *pos2 = NULL;
38 #if GNUSTEP_BASE_LIBRARY
39 pos1 = (char *)[self methodType];
41 pos1 = (char *)[self types];
43 pos2 = (char *)objc_skip_typespec(pos1);
44 strncpy(bufPos, pos1, pos2 - pos1);
45 bufPos += pos2 - pos1;
47 pos1 = (char *)objc_skip_offset(pos2);
53 for (i = 0; i < argCount; i++) {
54 pos2 = (char *)objc_skip_typespec(pos1); // forward to offset
55 strncpy(bufPos, pos1, pos2 - pos1);
56 bufPos += pos2 - pos1;
58 pos1 = (char *)objc_skip_offset(pos2); // forward to next type
63 return [NSString stringWithCString:buf];
67 @end /* NSMethodSignature(misc) */
69 void __link_NSMethodSignature_misc() {
70 __link_NSMethodSignature_misc();