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
|
|
|
|
modify it under the terms of the GNU Library 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 Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
2006-04-09 16:16:07 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02111 USA.
|
2000-12-08 19:06:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef cifframe_h_INCLUDE
|
|
|
|
#define cifframe_h_INCLUDE
|
|
|
|
|
2006-04-09 16:16:07 +00:00
|
|
|
#include <ffi.h>
|
|
|
|
|
|
|
|
#if defined(__MINGW32__)
|
|
|
|
/*
|
|
|
|
* Avoid conflicts when other headers try to define UINT32 and UINT64
|
|
|
|
*/
|
|
|
|
#if defined(UINT32)
|
|
|
|
#undef UINT32
|
|
|
|
#endif
|
|
|
|
#if defined(UINT64)
|
|
|
|
#undef UINT64
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2003-06-07 01:24:41 +00:00
|
|
|
#include "Foundation/NSMethodSignature.h"
|
2003-07-31 23:49:32 +00:00
|
|
|
#include "GNUstepBase/DistributedObjects.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;
|
|
|
|
|
2003-02-17 05:06:02 +00:00
|
|
|
extern cifframe_t *cifframe_from_info (NSArgumentInfo *info, int numargs,
|
|
|
|
void **retval);
|
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
|
|
|
|
2001-09-19 21:31:18 +00:00
|
|
|
extern void cifframe_do_call (DOContext *ctxt,
|
|
|
|
void(*decoder)(DOContext*),
|
|
|
|
void(*encoder)(DOContext*));
|
2002-04-18 16:02:12 +00:00
|
|
|
extern void cifframe_build_return (NSInvocation *inv,
|
|
|
|
const char *type,
|
|
|
|
BOOL out_parameters,
|
|
|
|
void(*decoder)(DOContext*),
|
|
|
|
DOContext* ctxt);
|
2000-12-08 19:06:00 +00:00
|
|
|
#endif
|