@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -173,6 +187,23 @@ typedef struct P {
|
||||
};
|
||||
} P;
|
||||
|
||||
typedef enum Q_Tag {
|
||||
Ok,
|
||||
Err,
|
||||
} Q_Tag;
|
||||
|
||||
typedef struct Q {
|
||||
Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
} Q;
|
||||
|
||||
void root(struct Opaque *opaque,
|
||||
A a,
|
||||
B b,
|
||||
@@ -189,7 +220,8 @@ void root(struct Opaque *opaque,
|
||||
M m,
|
||||
enum N n,
|
||||
O o,
|
||||
struct P p);
|
||||
struct P p,
|
||||
struct Q q);
|
||||
|
||||
#if 0
|
||||
''' '
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -239,6 +253,23 @@ typedef struct P {
|
||||
};
|
||||
} P;
|
||||
|
||||
typedef enum Q_Tag {
|
||||
Ok,
|
||||
Err,
|
||||
} Q_Tag;
|
||||
|
||||
typedef struct Q {
|
||||
Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
} Q;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
@@ -259,7 +290,8 @@ void root(struct Opaque *opaque,
|
||||
M m,
|
||||
enum N n,
|
||||
O o,
|
||||
struct P p);
|
||||
struct P p,
|
||||
struct Q q);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -173,6 +187,23 @@ typedef struct {
|
||||
};
|
||||
} P;
|
||||
|
||||
typedef enum {
|
||||
Ok,
|
||||
Err,
|
||||
} Q_Tag;
|
||||
|
||||
typedef struct {
|
||||
Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
} Q;
|
||||
|
||||
void root(Opaque *opaque,
|
||||
A a,
|
||||
B b,
|
||||
@@ -189,7 +220,8 @@ void root(Opaque *opaque,
|
||||
M m,
|
||||
N n,
|
||||
O o,
|
||||
P p);
|
||||
P p,
|
||||
Q q);
|
||||
|
||||
#if 0
|
||||
''' '
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -239,6 +253,23 @@ typedef struct {
|
||||
};
|
||||
} P;
|
||||
|
||||
typedef enum {
|
||||
Ok,
|
||||
Err,
|
||||
} Q_Tag;
|
||||
|
||||
typedef struct {
|
||||
Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
} Q;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
@@ -259,7 +290,8 @@ void root(Opaque *opaque,
|
||||
M m,
|
||||
N n,
|
||||
O o,
|
||||
P p);
|
||||
P p,
|
||||
Q q);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
@@ -173,6 +187,27 @@ struct P {
|
||||
};
|
||||
};
|
||||
|
||||
struct Q {
|
||||
enum class Tag {
|
||||
Ok,
|
||||
Err,
|
||||
};
|
||||
|
||||
struct Ok_Body {
|
||||
Box<uint32_t> _0;
|
||||
};
|
||||
|
||||
struct Err_Body {
|
||||
uint32_t _0;
|
||||
};
|
||||
|
||||
Tag tag;
|
||||
union {
|
||||
Ok_Body ok;
|
||||
Err_Body err;
|
||||
};
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void root(Opaque *opaque,
|
||||
@@ -191,7 +226,8 @@ void root(Opaque *opaque,
|
||||
M m,
|
||||
N n,
|
||||
O o,
|
||||
P p);
|
||||
P p,
|
||||
Q q);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t
|
||||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
|
||||
cdef extern from *:
|
||||
@@ -142,6 +156,15 @@ cdef extern from *:
|
||||
uint8_t p0;
|
||||
P1_Body p1;
|
||||
|
||||
ctypedef enum Q_Tag:
|
||||
Ok,
|
||||
Err,
|
||||
|
||||
ctypedef struct Q:
|
||||
Q_Tag tag;
|
||||
uint32_t *ok;
|
||||
uint32_t err;
|
||||
|
||||
void root(Opaque *opaque,
|
||||
A a,
|
||||
B b,
|
||||
@@ -158,7 +181,8 @@ cdef extern from *:
|
||||
M m,
|
||||
N n,
|
||||
O o,
|
||||
P p);
|
||||
P p,
|
||||
Q q);
|
||||
|
||||
#if 0
|
||||
''' '
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -173,6 +187,23 @@ struct P {
|
||||
};
|
||||
};
|
||||
|
||||
enum Q_Tag {
|
||||
Ok,
|
||||
Err,
|
||||
};
|
||||
|
||||
struct Q {
|
||||
enum Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
void root(struct Opaque *opaque,
|
||||
A a,
|
||||
B b,
|
||||
@@ -189,7 +220,8 @@ void root(struct Opaque *opaque,
|
||||
M m,
|
||||
enum N n,
|
||||
O o,
|
||||
struct P p);
|
||||
struct P p,
|
||||
struct Q q);
|
||||
|
||||
#if 0
|
||||
''' '
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -239,6 +253,23 @@ struct P {
|
||||
};
|
||||
};
|
||||
|
||||
enum Q_Tag {
|
||||
Ok,
|
||||
Err,
|
||||
};
|
||||
|
||||
struct Q {
|
||||
enum Q_Tag tag;
|
||||
union {
|
||||
struct {
|
||||
uint32_t *ok;
|
||||
};
|
||||
struct {
|
||||
uint32_t err;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
@@ -259,7 +290,8 @@ void root(struct Opaque *opaque,
|
||||
M m,
|
||||
enum N n,
|
||||
O o,
|
||||
struct P p);
|
||||
struct P p,
|
||||
struct Q q);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
|
||||
|
||||
from libc.stdint cimport int8_t, int16_t, int32_t, int64_t, intptr_t
|
||||
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
|
||||
cdef extern from *:
|
||||
@@ -142,6 +156,15 @@ cdef extern from *:
|
||||
uint8_t p0;
|
||||
P1_Body p1;
|
||||
|
||||
cdef enum Q_Tag:
|
||||
Ok,
|
||||
Err,
|
||||
|
||||
cdef struct Q:
|
||||
Q_Tag tag;
|
||||
uint32_t *ok;
|
||||
uint32_t err;
|
||||
|
||||
void root(Opaque *opaque,
|
||||
A a,
|
||||
B b,
|
||||
@@ -158,7 +181,8 @@ cdef extern from *:
|
||||
M m,
|
||||
N n,
|
||||
O o,
|
||||
P p);
|
||||
P p,
|
||||
Q q);
|
||||
|
||||
#if 0
|
||||
''' '
|
||||
|
||||
@@ -127,6 +127,12 @@ enum P {
|
||||
P1(u8, u8, u8),
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
enum Q {
|
||||
Ok(Box<u32>),
|
||||
Err(u32),
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn root(
|
||||
opaque: *mut Opaque,
|
||||
@@ -146,5 +152,6 @@ pub extern "C" fn root(
|
||||
n: N,
|
||||
o: O,
|
||||
p: P,
|
||||
q: Q,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
header = """
|
||||
#if 0
|
||||
''' '
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T>
|
||||
using Box = T*;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
' '''
|
||||
#endif
|
||||
"""
|
||||
|
||||
trailer = """
|
||||
#if 0
|
||||
''' '
|
||||
@@ -15,5 +30,10 @@ static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P");
|
||||
#endif
|
||||
"""
|
||||
|
||||
[export]
|
||||
exclude = [
|
||||
"Box",
|
||||
]
|
||||
|
||||
[export.rename]
|
||||
"I" = "ExI"
|
||||
|
||||
Reference in New Issue
Block a user