summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates/object_tp_as_mapping
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/modulator/Templates/object_tp_as_mapping')
-rw-r--r--Tools/modulator/Templates/object_tp_as_mapping33
1 files changed, 33 insertions, 0 deletions
diff --git a/Tools/modulator/Templates/object_tp_as_mapping b/Tools/modulator/Templates/object_tp_as_mapping
new file mode 100644
index 0000000..c5edf3e
--- /dev/null
+++ b/Tools/modulator/Templates/object_tp_as_mapping
@@ -0,0 +1,33 @@
+/* Code to access $name$ objects as mappings */
+
+static int
+$abbrev$_length(self)
+ $abbrev$object *self;
+{
+ /* XXXX Return the size of the mapping */
+}
+
+static object *
+$abbrev$_subscript(self, key)
+ $abbrev$object *self;
+ object *key;
+{
+ /* XXXX Return the item of self indexed by key */
+}
+
+static int
+$abbrev$_ass_sub(self, v, w)
+ $abbrev$object *self;
+ object *v, *w;
+{
+ /* XXXX Put w in self under key v */
+ return 0;
+}
+
+static mapping_methods $abbrev$_as_mapping = {
+ (inquiry)$abbrev$_length, /*mp_length*/
+ (binaryfunc)$abbrev$_subscript, /*mp_subscript*/
+ (objobjargproc)$abbrev$_ass_sub, /*mp_ass_subscript*/
+};
+
+/* -------------------------------------------------------- */