diff --git a/partials/libbson/Bcon.vapi b/partials/libbson/Bcon.vapi index a6fe797..b385e02 100644 --- a/partials/libbson/Bcon.vapi +++ b/partials/libbson/Bcon.vapi @@ -36,8 +36,9 @@ public BconType BCON_DATE_TIME (int64 val); [CCode (cname = "BCON_NULL")] public BconType BCON_NULL (); +//FIXME [CCode (cname = "BCON_REGEX")] -public BconType BCON_REGEX (string regex, string flags);//FIXME +public BconType BCON_REGEX (string regex, string flags); [CCode (cname = "BCON_DBPOINTER")] public BconType BCON_DBPOINTER (Collection coll, BsonOid oid); diff --git a/partials/libbson/Bson.vapi b/partials/libbson/Bson.vapi index 9b2a81e..58c4fee 100644 --- a/partials/libbson/Bson.vapi +++ b/partials/libbson/Bson.vapi @@ -1,4 +1,11 @@ +/** + * bson_realloc_func + */ + +[CCode (cname = "bson_realloc_func", simple_generics = true)] +public delegate T? ReallocFunc (T? mem, size_t num_bytes, C? ctx); + /** * bson_t */ @@ -11,9 +18,9 @@ public class Bson { [CCode (cname = "bson_new")] public Bson (); - //FIXME - // [CCode (cname = "bson_new_from_buffer")] - // public Bson.from_buffer (ref uint8 buf, size_t buf_len, ReallocFunc func); + //FIXME: Array or pointer for the buffer? + [CCode (cname = "bson_new_from_buffer")] + public Bson.from_buffer (ref uint8 buf, size_t buf_len, ReallocFunc func); [CCode (cname = "bson_new_from_data")] public Bson.from_data (uint8 data, size_t length); diff --git a/partials/libbson/BsonString.vapi b/partials/libbson/BsonString.vapi index 9c5924e..29deb08 100644 --- a/partials/libbson/BsonString.vapi +++ b/partials/libbson/BsonString.vapi @@ -46,9 +46,8 @@ public struct BsonUnichar { * Various chars and string methods */ -//FIXME -// [CCode (cname = "bson_ascii_strtoll")] -// public int64 ascii_strtoll (string str, ref char? endptr, int base); +[CCode (cname = "bson_ascii_strtoll")] +public int64 ascii_strtoll (string str, out string? endptr, int _base); [CCode (cname = "bson_isspace")] public bool is_space (char c); @@ -80,9 +79,8 @@ public void strndup (string str, size_t size); [CCode (cname = "bson_strnlen")] public size_t strnlen (string dst, size_t max); -//FIXME -// [CCode (cname = "bson_uint32_to_string")] -// public size_t uint32_to_string (uint32 value, ref string strptr, string str, size_t size); +[CCode (cname = "bson_uint32_to_string")] +public size_t uint32_to_string (uint32 value, out string strptr, string str, size_t size); [CCode (cname = "bson_utf8_escape_for_json")] public string utf8_escape_for_json (string utf8, ssize_t utf8_len); diff --git a/partials/libmongoc/Client.vapi b/partials/libmongoc/Client.vapi index d31075c..da479de 100644 --- a/partials/libmongoc/Client.vapi +++ b/partials/libmongoc/Client.vapi @@ -60,9 +60,9 @@ public class Client { [CCode (cname = "mongoc_client_get_server_description")] public ServerDescription get_server_description (uint32 server_id); - //FIXME - [CCode (cname = "mongoc_client_get_server_descriptions", array_length_type = "size_t")] - public ServerDescription[] get_server_descriptions (size_t n); + //FIXME: Fix array length + [CCode (cname = "mongoc_client_get_server_descriptions", array_length_pos = 1, array_length_type = "size_t")] + public ServerDescription[] get_server_descriptions (); [CCode (cname = "mongoc_client_get_server_status")] public bool get_server_status (ReadPrefs read_prefs, Bson reply, BsonError? error); diff --git a/partials/libmongoc/ClientPool.vapi b/partials/libmongoc/ClientPool.vapi index b7d74ab..a7577c1 100644 --- a/partials/libmongoc/ClientPool.vapi +++ b/partials/libmongoc/ClientPool.vapi @@ -12,35 +12,34 @@ public class ClientPool { public ClientPool (Uri uri); //Methods - [CCode (cname = "client_pool_enable_auto_encryption")] + [CCode (cname = "mongoc_client_pool_enable_auto_encryption")] public bool enable_auto_encryption (Bson? opts, BsonError? error); - [CCode (cname = "client_pool_max_size")] + [CCode (cname = "mongoc_client_pool_max_size")] public void max_size (uint32 max_pool_size); - [CCode (cname = "client_pool_min_size")] + [CCode (cname = "mongoc_client_pool_min_size")] public void min_size (uint32 min_pool_size); - [CCode (cname = "client_pool_pop")] + [CCode (cname = "mongoc_client_pool_pop")] public Client pop (); - [CCode (cname = "client_pool_push")] + [CCode (cname = "mongoc_client_pool_push")] public void push (Client client); - [CCode (cname = "client_pool_set_apm_callbacks", simple_generics = true)] + [CCode (cname = "mongoc_client_pool_set_apm_callbacks", simple_generics = true)] public bool set_apm_callbacks (APMCallbacks callbacks, T? context = null); - [CCode (cname = "client_pool_set_appname")] + [CCode (cname = "mongoc_client_pool_set_appname")] public bool set_appname (string name); - [CCode (cname = "client_pool_set_error_api")] + [CCode (cname = "mongoc_client_pool_set_error_api")] public bool set_error_api (int32 version); - //XXX - [CCode (cname = "client_pool_set_ssl_opts")] + [CCode (cname = "mongoc_client_pool_set_ssl_opts")] public void set_ssl_opts (SSLOpts opts); - [CCode (cname = "client_pool_try_pop")] + [CCode (cname = "mongoc_client_pool_try_pop")] public Client? try_pop (); } diff --git a/partials/libmongoc/Opts.vapi b/partials/libmongoc/Opts.vapi index 3bfcb47..0dc5078 100644 --- a/partials/libmongoc/Opts.vapi +++ b/partials/libmongoc/Opts.vapi @@ -72,7 +72,20 @@ public class SessionOpt { [CCode (cname = "mongoc_ssl_opt_t")] public struct SSLOpts { - //FIXME + public const string pem_file; + + public const string pem_pwd; + + public const string ca_file; + + public const string ca_dir; + + public const string crl_file; + + public bool weak_cert_validation; + + public bool allow_invalid_hostname; + [CCode (cname = "mongoc_ssl_opt_get_default")] public static SSLOpts get_default (); diff --git a/partials/libmongoc/Stream.vapi b/partials/libmongoc/Stream.vapi index 00aca4f..fa4ca2a 100644 --- a/partials/libmongoc/Stream.vapi +++ b/partials/libmongoc/Stream.vapi @@ -7,11 +7,12 @@ [Compact] public class Stream { - //Methods + //Constructions //FIXME [CCode (cname = "mongoc_stream_buffered_new")] public Stream (Stream base_stream, size_t buffer); + //Methods [CCode (cname = "mongoc_stream_close")] public int close (); @@ -59,9 +60,9 @@ public class Stream { public class ChangeStream { //Methods - //FIXME: bson must be location reference + //FIXME: needs a bson reference [CCode (cname = "mongoc_change_stream_next")] - public bool next (Bson bson); + public bool next (ref Bson bson); [CCode (cname = "mongoc_change_stream_next")] public Bson? get_resume_token (ChangeStream stream); @@ -98,7 +99,6 @@ public struct StreamFile { [CCode (cname = "mongoc_stream_file_new_for_path")] public static Stream? new_for_path (string path, int flags, int mode); - //FIXME [CCode (cname = "mongoc_stream_file_get_fd")] public int get_fd ();