swig/SWIG/Lib/ocaml/libswigocaml.swg
Dave Beazley 516036631c The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2002-11-30 22:01:28 +00:00

18 lines
560 B
Text

#include <stdio.h>
#include <stdlib.h>
#include "libswigocaml.h"
/* Ocaml runtime support ... not much here yet */
void *nullptr = 0;
oc_bool isnull( void *v ) { return v ? 0 : 1; }
void *get_char_ptr( char *str ) { return str; }
void *make_ptr_array( int size ) {
return (void *)malloc( sizeof( void * ) * size );
}
void *get_ptr( void *arrayptr, int elt ) {
return ((void **)arrayptr)[elt];
}
void set_ptr( void *arrayptr, int elt, void *elt_v ) {
((void **)arrayptr)[elt] = elt_v;
}
void *offset_ptr( void *p, int n ) { return ((char *)p) + n; }