summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/struct.c')
-rw-r--r--plugins/pychrysalide/struct.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/pychrysalide/struct.c b/plugins/pychrysalide/struct.c
index d4d6a9f..e7dbdcd 100644
--- a/plugins/pychrysalide/struct.c
+++ b/plugins/pychrysalide/struct.c
@@ -30,6 +30,20 @@
+#define STRUCT_OBJ_DOC \
+ "PyStructObject is a sugar glue used to transmit C structures to Python." \
+ "\n" \
+ "For instance, let's consider the following C structure :\n" \
+ "\n" \
+ " struct _my_struct_t { int a; int b } var;\n" \
+ "\n" \
+ "Such a structure will be translated into a Python dictionary.\n" \
+ "\n" \
+ "Each previous field gets then accessible using :\n" \
+ "* a direct access: *var.a*;\n" \
+ "* an access by name thanks to the dictionary: *var['b']*."
+
+
/* Objet à vocation abstraite */
typedef struct _PyStructObject
{
@@ -119,7 +133,7 @@ PyTypeObject *get_python_py_struct_type(void)
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
- .tp_doc = "PyChrysalide structure",
+ .tp_doc = STRUCT_OBJ_DOC,
.tp_methods = py_struct_methods,
.tp_getset = py_struct_getseters,