Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codiepp/ml-cpp-cstdio
OCaml embedded cross-platform C++ <cstdio>
https://github.com/codiepp/ml-cpp-cstdio
hacktoberfest
Last synced: about 18 hours ago
JSON representation
OCaml embedded cross-platform C++ <cstdio>
- Host: GitHub
- URL: https://github.com/codiepp/ml-cpp-cstdio
- Owner: CodiePP
- License: apache-2.0
- Created: 2022-09-17T10:41:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-22T21:56:09.000Z (7 months ago)
- Last Synced: 2025-01-20T21:16:48.103Z (1 day ago)
- Topics: hacktoberfest
- Language: OCaml
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ml-cpp-cstdio
OCaml embedded cross-platform C++ <[cstdio](https://en.cppreference.com/w/cpp/header/cstdio)>## the interface
```OCaml
module File :
sig
(* Buffer.ta represents a chunk of C-bytes *)
module Buffer :
sig
type ta
val create : int -> ta
val release : ta -> ta
val resize : ta -> int -> unit
val good : ta -> bool
val init : int -> (int -> char) -> ta
val to_string : ta -> string
val from_string : string -> ta
val size : ta -> int
val get : ta -> int -> char
val set : ta -> int -> char -> unit
val copy_sz_pos : ta -> pos1:int -> sz:int -> ta -> pos2:int -> int
val copy_string : string -> ta -> int -> unit
endtype file
type errinfo = (int * string)val to_string : file -> string
val fopen : string -> string -> (file, errinfo) result
val fclose : file -> (unit, errinfo) result
val fflush : file -> (unit, errinfo) result
val fflush_all : unit -> (unit, errinfo) result
val ftell : file -> (int, errinfo) result
val fseek : file -> int -> (unit, errinfo) result
val fseek_relative : file -> int -> (unit, errinfo) result
val fseek_end : file -> int -> (unit, errinfo) result
val fread : Buffer.ta -> int -> file -> (int, errinfo) result
val fwrite : Buffer.ta -> int -> file -> (int, errinfo) result
val fwrite_s : string -> file -> (int, errinfo) result
val ferror : file -> errinfo
val feof : file -> boolval content64k : string -> int -> (Buffer.ta, errinfo) result
val pp_file : Format.formatter -> file -> unit
val pp_err : Format.formatter -> errinfo -> unit
end
```