From 1684c70f7d3902d0299944e845abf30edd49e225 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 22 Jan 2019 17:18:27 +0000 Subject: [PATCH] Document the libsolc API --- libsolc/libsolc.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libsolc/libsolc.h b/libsolc/libsolc.h index b58ee8053..baa39fd44 100644 --- a/libsolc/libsolc.h +++ b/libsolc/libsolc.h @@ -34,12 +34,25 @@ extern "C" { #endif -/// Callback used to retrieve additional source files. "Returns" two pointers that should be -/// heap-allocated and are free'd by the caller. +/// Callback used to retrieve additional source files. +/// +/// "Returns" two pointers that should be heap-allocated and are free'd by the caller. typedef void (*CStyleReadFileCallback)(char const* _path, char** o_contents, char** o_error); +/// Returns the complete license document. +/// +/// The pointer returned must not be freed by the caller. char const* solidity_license() SOLC_NOEXCEPT; + +/// Returns the compiler version. +/// +/// The pointer returned must not be freed by the caller. char const* solidity_version() SOLC_NOEXCEPT; + +/// Takes a "Standard Input JSON" and an optional callback (can be set to null). Returns +/// a "Standard Output JSON". Both are to be UTF-8 encoded. +/// +/// The pointer returned must not be freed by the caller. char const* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback) SOLC_NOEXCEPT; #ifdef __cplusplus