summaryrefslogtreecommitdiffstats
path: root/byterun/custom.h
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2000-02-10 14:04:59 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2000-02-10 14:04:59 +0000
commit9e206909f48d5d2579b6ec17764d3273df23ff08 (patch)
tree3319a3e0c3383ed812f781859aadffd7f1462fdf /byterun/custom.h
parent7175ab048dcaaa39649ebc386ae37750baaf27e1 (diff)
Introduction des blocs de type Custom.
Remplacement des blocs de type Final par des blocs de type Custom. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2804 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/custom.h')
-rw-r--r--byterun/custom.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/byterun/custom.h b/byterun/custom.h
new file mode 100644
index 000000000..6f1d7f324
--- /dev/null
+++ b/byterun/custom.h
@@ -0,0 +1,44 @@
+/***********************************************************************/
+/* */
+/* Objective Caml */
+/* */
+/* Manuel Serrano and Xavier Leroy, INRIA Rocquencourt */
+/* */
+/* Copyright 2000 Institut National de Recherche en Informatique et */
+/* en Automatique. All rights reserved. This file is distributed */
+/* under the terms of the GNU Library General Public License. */
+/* */
+/***********************************************************************/
+
+/* $Id$ */
+
+#ifndef _custom_
+#define _custom_
+
+
+#include "mlvalues.h"
+
+struct custom_operations {
+ char *identifier;
+ void (*finalize)(value v);
+ int (*compare)(value v1, value v2);
+ long (*hash)(value v);
+ void (*serialize)(value v,
+ /*out*/ unsigned long * wsize_32 /*size in bytes*/,
+ /*out*/ unsigned long * wsize_64 /*size in bytes*/);
+ unsigned long (*deserialize)(void * dst);
+};
+
+#define custom_finalize_default NULL
+extern int custom_compare_default(value v1, value v2);
+#define custom_hash_default NULL
+extern void custom_serialize_default(value v, unsigned long * wsize_32,
+ unsigned long * wsize_64);
+#define custom_deserialize_default NULL
+
+#define Custom_ops_val(v) (*((struct custom_operations **) (v)))
+
+extern void register_custom_operations(struct custom_operations * ops);
+extern struct custom_operations * find_custom_operations(char * ident);
+
+#endif