summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/lib-marshal/intextaux.c
blob: 03688462d6b63f949ab9aaffbb5244173c25bdbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/***********************************************************************/
/*                                                                     */
/*                                OCaml                                */
/*                                                                     */
/*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
/*                                                                     */
/*  Copyright 2001 Institut National de Recherche en Informatique et   */
/*  en Automatique.  All rights reserved.  This file is distributed    */
/*  under the terms of the Q Public License version 1.0.               */
/*                                                                     */
/***********************************************************************/

#include <caml/mlvalues.h>
#include <caml/intext.h>

value marshal_to_block(value vbuf, value vlen, value v, value vflags)
{
  return Val_long(output_value_to_block(v, vflags,
                                        (char *) vbuf, Long_val(vlen)));
}

value marshal_from_block(value vbuf, value vlen)
{
  return input_value_from_block((char *) vbuf, Long_val(vlen));
}