~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to otherlibs/num/nat_stubs.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
/*                                                                     */
12
12
/***********************************************************************/
13
13
 
14
 
/* $Id: nat_stubs.c,v 1.16.10.1 2007/10/25 09:23:30 xleroy Exp $ */
 
14
/* $Id: nat_stubs.c,v 1.18 2008/01/11 16:13:16 doligez Exp $ */
15
15
 
16
16
#include "alloc.h"
17
17
#include "config.h"
84
84
  return Val_long(Digit_val(nat, Long_val(ofs)));
85
85
}
86
86
 
 
87
CAMLprim value set_digit_nat_native(value nat, value ofs, value digit)
 
88
{
 
89
  Digit_val(nat, Long_val(ofs)) = Nativeint_val(digit);
 
90
  return Val_unit;
 
91
}
 
92
 
 
93
CAMLprim value nth_digit_nat_native(value nat, value ofs)
 
94
{
 
95
  return caml_copy_nativeint(Digit_val(nat, Long_val(ofs)));
 
96
}
 
97
 
87
98
CAMLprim value num_digits_nat(value nat, value ofs, value len)
88
99
{
89
100
  return Val_long(bng_num_digits(&Digit_val(nat, Long_val(ofs)),