2000-12-08 19:06:00 +00:00
|
|
|
/* cifframe - Wrapper/Objective-C interface for ffi function interface
|
|
|
|
|
|
|
|
Copyright (C) 1999, Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@gnu.org>
|
|
|
|
Created: Feb 2000
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2000-12-08 19:06:00 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2000-12-08 19:06:00 +00:00
|
|
|
|
|
|
|
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
|
2019-12-09 23:36:00 +00:00
|
|
|
Lesser General Public License for more details.
|
2000-12-08 19:06:00 +00:00
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2000-12-08 19:06:00 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2024-11-07 13:37:59 +00:00
|
|
|
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
2000-12-08 19:06:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef cifframe_h_INCLUDE
|
|
|
|
#define cifframe_h_INCLUDE
|
|
|
|
|
2006-03-17 09:31:40 +00:00
|
|
|
#include <ffi.h>
|
|
|
|
|
2016-03-09 13:16:16 +00:00
|
|
|
#if defined(_WIN32)
|
2006-03-17 09:31:40 +00:00
|
|
|
/*
|
|
|
|
* Avoid conflicts when other headers try to define UINT32 and UINT64
|
|
|
|
*/
|
|
|
|
#if defined(UINT32)
|
|
|
|
#undef UINT32
|
|
|
|
#endif
|
|
|
|
#if defined(UINT64)
|
|
|
|
#undef UINT64
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2012-07-27 16:48:49 +00:00
|
|
|
#import "Foundation/NSMethodSignature.h"
|
|
|
|
#import "GNUstepBase/DistributedObjects.h"
|
|
|
|
#import "GSPrivate.h"
|
2000-12-08 19:06:00 +00:00
|
|
|
|
|
|
|
typedef struct _cifframe_t {
|
|
|
|
ffi_cif cif;
|
|
|
|
int nargs;
|
2002-04-18 16:02:12 +00:00
|
|
|
ffi_type **arg_types;
|
2000-12-08 19:06:00 +00:00
|
|
|
void **values;
|
|
|
|
} cifframe_t;
|
|
|
|
|
2010-06-08 05:03:14 +00:00
|
|
|
@class NSMutableData;
|
|
|
|
|
|
|
|
extern NSMutableData *cifframe_from_signature (NSMethodSignature *info);
|
2008-06-30 05:29:19 +00:00
|
|
|
|
2012-07-27 16:48:49 +00:00
|
|
|
extern GSCodeBuffer* cifframe_closure (NSMethodSignature *sig, void (*func)());
|
|
|
|
|
2002-04-18 16:02:12 +00:00
|
|
|
extern void cifframe_set_arg(cifframe_t *cframe, int index, void *buffer,
|
|
|
|
int size);
|
|
|
|
extern void cifframe_get_arg(cifframe_t *cframe, int index, void *buffer,
|
|
|
|
int size);
|
2000-12-08 19:06:00 +00:00
|
|
|
extern void *cifframe_arg_addr(cifframe_t *cframe, int index);
|
2002-04-18 16:02:12 +00:00
|
|
|
extern BOOL cifframe_decode_arg (const char *type, void* buffer);
|
|
|
|
extern BOOL cifframe_encode_arg (const char *type, void* buffer);
|
2000-12-08 19:06:00 +00:00
|
|
|
|
|
|
|
#endif
|