1 /**
2   Mirror _structmember.h
3 
4 Interface to map C struct members to Python object attributes 
5 */
6 module deimos.python.structmember;
7 
8 import deimos.python.pyport;
9 import deimos.python.object;
10 
11 extern(C):
12 // Python-header-file: Include/structmember.h:
13 
14 /// _
15 struct PyMemberDef {
16     /** Current version, use this */
17     char* name;
18     /// _
19     int type;
20     /// _
21     Py_ssize_t offset;
22     /// _
23     int flags;
24     /// _
25     char* doc;
26 }
27 
28 /** Types */
29 enum T_SHORT = 0;
30 /// ditto
31 enum T_INT = 1;
32 /// ditto
33 enum T_LONG = 2;
34 /// ditto
35 enum T_FLOAT = 3;
36 /// ditto
37 enum T_DOUBLE = 4;
38 /// ditto
39 enum T_STRING = 5;
40 /// ditto
41 enum T_OBJECT = 6;
42 /// ditto
43 enum T_CHAR = 7;
44 /// ditto
45 enum T_BYTE = 8;
46 /// ditto
47 enum T_UBYTE = 9;
48 /// ditto
49 enum T_USHORT = 10;
50 /// ditto
51 enum T_UINT = 11;
52 /// ditto
53 enum T_ULONG = 12;
54 /// ditto
55 enum T_STRING_INPLACE = 13;
56 version(Python_2_6_Or_Later){
57     /// Availability: >= 2.6
58     enum T_BOOL = 14;
59 }
60 /// _
61 enum T_OBJECT_EX = 16;
62 version(Python_2_5_Or_Later){
63     /// Availability: >= 2.5
64     enum T_LONGLONG = 17;
65     /// Availability: >= 2.5
66     enum T_ULONGLONG = 18;
67 }
68 version(Python_2_6_Or_Later){
69     /// Availability: >= 2.6
70     enum T_PYSSIZET = 19;
71 }
72 version(Python_3_2_Or_Later) {
73     /// Availability: >= 3.2
74     enum T_NONE = 20;
75 }
76 
77 /// _
78 enum READONLY = 1;
79 /// _
80 alias READONLY RO;
81 /// _
82 enum READ_RESTRICTED = 2;
83 /// _
84 enum WRITE_RESTRICTED = 4;
85 /// _
86 enum RESTRICTED = (READ_RESTRICTED | WRITE_RESTRICTED);
87 
88 /// _
89 PyObject* PyMember_GetOne(const(char)*, PyMemberDef*);
90 /// _
91 int PyMember_SetOne(char*, PyMemberDef*, PyObject*);
92 
93