forked from MacRuby/MacRuby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbridgesupport.h
43 lines (35 loc) · 1010 Bytes
/
bridgesupport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* MacRuby BridgeSupport implementation.
*
* This file is covered by the Ruby license. See COPYING for more details.
*
* Copyright (C) 2012-2013, The MacRuby Team. All rights reserved.
* Copyright (C) 2007-2011, Apple Inc. All rights reserved.
*/
#ifndef __BRIDGESUPPORT_H_
#define __BRIDGESUPPORT_H_
#if defined(__cplusplus)
extern "C" {
#endif
#include "bs.h"
void *rb_pointer_get_data(VALUE rcv, const char *type);
VALUE rb_pointer_new(const char *type_str, void *val, size_t len);
VALUE rb_pointer_new2(const char *type_str, VALUE val);
bool rb_boxed_is_type(VALUE klass, const char *type);
#if defined(__cplusplus)
} // extern "C"
typedef struct rb_vm_bs_boxed {
bs_element_type_t bs_type;
bool is_struct(void) { return bs_type == BS_ELEMENT_STRUCT; }
union {
bs_element_struct_t *s;
bs_element_opaque_t *o;
void *v;
} as;
#if !defined(MACRUBY_STATIC)
Type *type;
#endif
VALUE klass;
} rb_vm_bs_boxed_t;
#endif /* __cplusplus */
#endif /* __BRIDGESUPPORT_H_ */