libs-base/Source/mframe/mframe.head
rfm 2fc494c446 a bit step towards removing obsolete mframe code.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28774 72102866-910b-0410-8b05-ffd578937521
2009-10-04 15:26:07 +00:00

65 lines
1.9 KiB
Text

/* Interface for functions that dissect/make method calls
Copyright (C) 1994, 1996, 1998 Free Software Foundation, Inc.
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
Created: Oct 1994
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __mframe_h_GNUSTEP_BASE_INCLUDE
#define __mframe_h_GNUSTEP_BASE_INCLUDE
#include "GNUstepBase/preface.h"
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "GNUstepBase/DistributedObjects.h"
/* For NSArgumentInfo we include NSMethodSignature.h */
#include "Foundation/NSMethodSignature.h"
#if NeXT_runtime
typedef union {
char *arg_ptr;
char arg_regs[sizeof (char*)];
} *arglist_t;
#endif
/*
* Step through method encoding information extracting details.
*/
const char *
mframe_next_arg(const char *typePtr, NSArgumentInfo *info, char *outTypes);
/*
* Generate method encoding with stack/register offsets from a simple
* type encoding string. Store results in 'buf' or allocate memory
* using objc_malloc() if 'buf' is a nul pointer.
*/
char*
mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf);
#define ROUND(V, A) \
({ typeof(V) __v=(V); typeof(A) __a=(A); \
__a*((__v+__a-1)/__a); })