Skip to content

Commit 5a78a87

Browse files
committed
ffi: add descriptor-related flags
1 parent 730867c commit 5a78a87

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/npyffi/flags.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::npy_uint32;
1+
use super::{npy_char, npy_uint32};
22
use std::os::raw::c_int;
33

44
pub const NPY_ARRAY_C_CONTIGUOUS: c_int = 0x0001;
@@ -62,3 +62,21 @@ pub const NPY_ITER_OVERLAP_ASSUME_ELEMENTWISE: npy_uint32 = 0x40000000;
6262

6363
pub const NPY_ITER_GLOBAL_FLAGS: npy_uint32 = 0x0000ffff;
6464
pub const NPY_ITER_PER_OP_FLAGS: npy_uint32 = 0xffff0000;
65+
66+
pub const NPY_ITEM_REFCOUNT: npy_char = 0x01;
67+
pub const NPY_ITEM_HASOBJECT: npy_char = 0x01;
68+
pub const NPY_LIST_PICKLE: npy_char = 0x02;
69+
pub const NPY_ITEM_IS_POINTER: npy_char = 0x04;
70+
pub const NPY_NEEDS_INIT: npy_char = 0x08;
71+
pub const NPY_NEEDS_PYAPI: npy_char = 0x10;
72+
pub const NPY_USE_GETITEM: npy_char = 0x20;
73+
pub const NPY_USE_SETITEM: npy_char = 0x40;
74+
pub const NPY_ALIGNED_STRUCT: npy_char = -128; // 0x80
75+
pub const NPY_FROM_FIELDS: npy_char =
76+
NPY_NEEDS_INIT | NPY_LIST_PICKLE | NPY_ITEM_REFCOUNT | NPY_NEEDS_PYAPI;
77+
pub const NPY_OBJECT_DTYPE_FLAGS: npy_char = NPY_LIST_PICKLE
78+
| NPY_USE_GETITEM
79+
| NPY_ITEM_IS_POINTER
80+
| NPY_ITEM_REFCOUNT
81+
| NPY_NEEDS_INIT
82+
| NPY_NEEDS_PYAPI;

0 commit comments

Comments
 (0)