fix primitives for marshal
parent
ad6304d7ec
commit
e227fb007d
|
@ -694,7 +694,7 @@ CAMLprim value caml_output_value(value vchan, value v, value flags)
|
|||
CAMLreturn (Val_unit);
|
||||
}
|
||||
|
||||
CAMLprim value caml_output_value_to_string(value v, value flags)
|
||||
CAMLprim value caml_output_value_to_bytes(value v, value flags)
|
||||
{
|
||||
char header[32];
|
||||
int header_len;
|
||||
|
@ -722,6 +722,11 @@ CAMLprim value caml_output_value_to_string(value v, value flags)
|
|||
return res;
|
||||
}
|
||||
|
||||
CAMLprim value caml_output_value_to_string(value v, value flags)
|
||||
{
|
||||
return caml_output_value_to_bytes(v,flags);
|
||||
}
|
||||
|
||||
CAMLexport intnat caml_output_value_to_block(value v, value flags,
|
||||
char * buf, intnat len)
|
||||
{
|
||||
|
|
|
@ -777,7 +777,7 @@ CAMLprim value caml_input_value_to_outside_heap(value vchan)
|
|||
CAMLreturn (res);
|
||||
}
|
||||
|
||||
CAMLexport value caml_input_val_from_string(value str, intnat ofs)
|
||||
CAMLexport value caml_input_val_from_bytes(value str, intnat ofs)
|
||||
{
|
||||
CAMLparam1 (str);
|
||||
CAMLlocal1 (obj);
|
||||
|
@ -801,7 +801,12 @@ CAMLexport value caml_input_val_from_string(value str, intnat ofs)
|
|||
|
||||
CAMLprim value caml_input_value_from_string(value str, value ofs)
|
||||
{
|
||||
return caml_input_val_from_string(str, Long_val(ofs));
|
||||
return caml_input_val_from_bytes(str, Long_val(ofs));
|
||||
}
|
||||
|
||||
CAMLprim value caml_input_value_from_bytes(value str, value ofs)
|
||||
{
|
||||
return caml_input_val_from_bytes(str, Long_val(ofs));
|
||||
}
|
||||
|
||||
static value input_val_from_block(struct marshal_header * h)
|
||||
|
|
|
@ -19,7 +19,7 @@ type extern_flags =
|
|||
| Compat_32
|
||||
|
||||
external to_bytes: 'a -> extern_flags list -> bytes
|
||||
= "caml_output_value_to_string"
|
||||
= "caml_output_value_to_bytes"
|
||||
|
||||
external to_string: 'a -> extern_flags list -> string
|
||||
= "caml_output_value_to_string"
|
||||
|
@ -37,8 +37,7 @@ let to_buffer buff ofs len v flags =
|
|||
else to_buffer_unsafe buff ofs len v flags
|
||||
|
||||
external from_channel: in_channel -> 'a = "caml_input_value"
|
||||
external from_bytes_unsafe: bytes -> int -> 'a
|
||||
= "caml_input_value_from_string"
|
||||
external from_bytes_unsafe: bytes -> int -> 'a = "caml_input_value_from_bytes"
|
||||
external data_size_unsafe: bytes -> int -> int = "caml_marshal_data_size"
|
||||
|
||||
let header_size = 20
|
||||
|
|
|
@ -22,7 +22,7 @@ type extern_flags =
|
|||
external to_channel: out_channel -> 'a -> extern_flags list -> unit
|
||||
= "caml_output_value"
|
||||
external to_bytes: 'a -> extern_flags list -> bytes
|
||||
= "caml_output_value_to_string"
|
||||
= "caml_output_value_to_bytes"
|
||||
external to_string: 'a -> extern_flags list -> string
|
||||
= "caml_output_value_to_string"
|
||||
external to_buffer_unsafe:
|
||||
|
@ -41,8 +41,7 @@ let to_buffer buff ofs len v flags =
|
|||
*)
|
||||
|
||||
external from_channel: in_channel -> 'a = "caml_input_value"
|
||||
external from_bytes_unsafe: bytes -> int -> 'a
|
||||
= "caml_input_value_from_string"
|
||||
external from_bytes_unsafe: bytes -> int -> 'a = "caml_input_value_from_bytes"
|
||||
external data_size_unsafe: bytes -> int -> int = "caml_marshal_data_size"
|
||||
|
||||
let header_size = 20
|
||||
|
|
|
@ -112,7 +112,7 @@ val to_channel : out_channel -> 'a -> extern_flags list -> unit
|
|||
*)
|
||||
|
||||
external to_bytes :
|
||||
'a -> extern_flags list -> bytes = "caml_output_value_to_string"
|
||||
'a -> extern_flags list -> bytes = "caml_output_value_to_bytes"
|
||||
(** [Marshal.to_bytes v flags] returns a byte sequence containing
|
||||
the representation of [v].
|
||||
The [flags] argument has the same meaning as for
|
||||
|
|
Loading…
Reference in New Issue