diff --git a/runtime/caml/io.h b/runtime/caml/io.h index 475323993..9102a8291 100644 --- a/runtime/caml/io.h +++ b/runtime/caml/io.h @@ -70,7 +70,11 @@ enum { CAMLextern struct channel * caml_open_descriptor_in (int); CAMLextern struct channel * caml_open_descriptor_out (int); CAMLextern void caml_close_channel (struct channel *); - +CAMLextern file_offset caml_channel_size (struct channel *); +CAMLextern void caml_seek_in (struct channel *, file_offset); +CAMLextern void caml_seek_out (struct channel *, file_offset); +CAMLextern file_offset caml_pos_in (struct channel *); +CAMLextern file_offset caml_pos_out (struct channel *); /* I/O on channels from C. The channel must be locked (see below) before calling any of the functions and macros below */ diff --git a/runtime/io.c b/runtime/io.c index 92874752c..b5dbb606d 100644 --- a/runtime/io.c +++ b/runtime/io.c @@ -275,8 +275,7 @@ CAMLexport file_offset caml_pos_out(struct channel *channel) /* Input */ -/* caml_do_read is exported for Cash */ -CAMLexport int caml_do_read(int fd, char *p, unsigned int n) +int caml_do_read(int fd, char *p, unsigned int n) { int r; do { @@ -379,7 +378,7 @@ CAMLexport file_offset caml_pos_in(struct channel *channel) return channel->offset - (file_offset)(channel->max - channel->curr); } -CAMLexport intnat caml_input_scan_line(struct channel *channel) +intnat caml_input_scan_line(struct channel *channel) { char * p; int n; @@ -426,8 +425,7 @@ CAMLexport intnat caml_input_scan_line(struct channel *channel) objects into a heap-allocated object. Perform locking and unlocking around the I/O operations. */ -/* FIXME CAMLexport, but not in io.h exported for Cash ? */ -CAMLexport void caml_finalize_channel(value vchan) +void caml_finalize_channel(value vchan) { struct channel * chan = Channel(vchan); if ((chan->flags & CHANNEL_FLAG_MANAGED_BY_GC) == 0) return;