Skip to content

Commit 1076799

Browse files
authored
Merge pull request #50 from mrkn/public_c_api
Introduce public C APIs
2 parents c2b83d2 + 835472e commit 1076799

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

ext/pycall/pycall.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "pycall_internal.h"
2+
#include "pycall.h"
23
#include <ruby/encoding.h>
34

45
#include <stdarg.h>
@@ -143,6 +144,12 @@ get_pyobj_ptr(VALUE obj)
143144
return pyobj;
144145
}
145146

147+
PyObject *
148+
pycall_pyptr_get_pyobj_ptr(VALUE pyptr)
149+
{
150+
return get_pyobj_ptr(pyptr);
151+
}
152+
146153
static inline PyObject*
147154
try_get_pyobj_ptr(VALUE obj)
148155
{

ext/pycall/pycall.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef PYCALL_H
2+
#define PYCALL_H 1
3+
4+
#if defined(__cplusplus)
5+
extern "C" {
6+
#if 0
7+
} /* satisfy cc-mode */
8+
#endif
9+
#endif
10+
11+
VALUE pycall_pyptr_new(PyObject *pyobj);
12+
PyObject *pycall_pyptr_get_pyobj_ptr(VALUE pyptr);
13+
14+
#if defined(__cplusplus)
15+
#if 0
16+
{ /* satisfy cc-mode */
17+
#endif
18+
} /* extern "C" { */
19+
#endif
20+
21+
#endif /* PYCALL_H */

0 commit comments

Comments
 (0)