Skip to content

Commit af6e78f

Browse files
committed
update C lib dependency to 0.15.1
1 parent 07cb074 commit af6e78f

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

build/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd "${script_dir}/.." # move to project root dir
77

88
args="$@"
99

10-
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-c/main/download.sh) --quiet --sync 0.15.0
10+
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-c/main/download.sh) --quiet --sync 0.15.1
1111
export CGO_LDFLAGS="-L$(pwd -P)/lib -Wl,-rpath -Wl,$(pwd -P)/lib"
1212

1313
if [[ "$(uname)" == MINGW* ]]; then

install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $ErrorActionPreference = "Stop"
77
# Configure supported HTTPS protocols
88
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12, [Net.SecurityProtocolType]::Tls11, [Net.SecurityProtocolType]::Tls
99

10-
$libVersion = '0.15.0'
10+
$libVersion = '0.15.1'
1111
$libVariant = 'objectbox' # or 'objectbox-sync'
1212
$downloadDir = 'download'
1313
$extractedLibDir = "$downloadDir\objectbox-$libVersion"

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
cLibVersion=0.15.0
4+
cLibVersion=0.15.1
55
os=$(uname)
66
cLibArgs="$*"
77

objectbox/objectbox-sync.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "objectbox.h"
3535

3636
#if defined(static_assert) || defined(__cplusplus)
37-
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 0,
37+
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 1,
3838
"Versions of objectbox.h and objectbox-sync.h files do not match, please update");
3939
#endif
4040

@@ -318,7 +318,7 @@ typedef struct OBX_sync_server OBX_sync_server;
318318
/// E.g. a client with an incompatible model will be rejected during login.
319319
/// @param store_options Options for the server's store.
320320
/// It is freed automatically (same as with obx_store_open()) - don't use or free it afterwards.
321-
/// @param uri The URI (following the pattern protocol:://IP:port) the server should listen on.
321+
/// @param uri The URI (following the pattern "protocol://IP:port") the server should listen on.
322322
/// Supported \b protocols are "ws" (WebSockets) and "wss" (secure WebSockets).
323323
/// To use the latter ("wss"), you must also call obx_sync_server_certificate_path().
324324
/// To bind to all available \b interfaces, including those that are available from the "outside", use 0.0.0.0 as
@@ -383,7 +383,12 @@ OBX_C_API uint64_t obx_sync_server_connections(OBX_sync_server* server);
383383
/// The returned char* is valid until another call to obx_sync_server_stats_string() or the server is closed.
384384
OBX_C_API const char* obx_sync_server_stats_string(OBX_sync_server* server, bool include_zero_values);
385385

386-
// TODO admin UI ("browser")
386+
/// Configure admin with a sync server, attaching the store and enabling custom sync-server functionality in the UI.
387+
/// This is a replacement for obx_admin_opt_store() and obx_admin_opt_store_path() - don't set them for the server.
388+
/// After configuring, this acts as obx_admin() - see for more details.
389+
/// You must use obx_admin_close() to stop & free resources after you're done; obx_sync_server_stop() doesn't do that.
390+
/// @param options configuration set up with obx_admin_opt_*. You can pass NULL to use the default options.
391+
OBX_C_API OBX_admin* obx_sync_server_admin(OBX_sync_server* server, OBX_admin_options* options);
387392

388393
#ifdef __cplusplus
389394
}

objectbox/objectbox.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 ObjectBox Ltd. All rights reserved.
2+
* Copyright 2018-2022 ObjectBox Ltd. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ extern "C" {
5151
/// obx_version() or obx_version_is_at_least().
5252
#define OBX_VERSION_MAJOR 0
5353
#define OBX_VERSION_MINOR 15
54-
#define OBX_VERSION_PATCH 0 // values >= 100 are reserved for dev releases leading to the next minor/major increase
54+
#define OBX_VERSION_PATCH 1 // values >= 100 are reserved for dev releases leading to the next minor/major increase
5555

5656
//----------------------------------------------
5757
// Common types
@@ -692,7 +692,9 @@ OBX_C_API OBX_store* obx_store_open(OBX_store_options* opt);
692692
/// Check if an open store was found for the given path (i.e. opened before and not yet closed).
693693
OBX_C_API bool obx_store_is_open(const char* path);
694694

695-
/// Get a store previously opened with createShared() matching the given path of the DB directory.
695+
/// Attach to a previously opened store matching the path of the DB directory, which was used for opening the store.
696+
/// The returned store is a new instance (e.g. different pointer value) with its own lifetime and must also be closed.
697+
/// The actual underlying store is only closed when the last store OBX_store instance is closed.
696698
/// @returns nullptr if no open store was found (i.e. not opened before or already closed)
697699
OBX_C_API OBX_store* obx_store_attach(const char* path);
698700

@@ -1829,7 +1831,7 @@ typedef struct OBX_admin OBX_admin;
18291831

18301832
/// Initialize the http-server with the given options.
18311833
/// Note: the given options are always freed by this function, including when an error occurs.
1832-
/// @param opt required parameter holding the options (see obx_admin_opt_*())
1834+
/// @param options required parameter holding the options (see obx_admin_opt_*())
18331835
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
18341836
OBX_C_API OBX_admin* obx_admin(OBX_admin_options* options);
18351837

test/version_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestVersion(t *testing.T) {
4646
t.Errorf("ObjectBox-C version %v doesn't match expected regexp %v", versionLibString, format)
4747
}
4848
versionLibInt := versionLib.Major*10000 + versionLib.Minor*100 + versionLib.Patch
49-
assert.True(t, versionLibInt >= 1500) // Update with new releases (won't fail if forgotten)
49+
assert.True(t, versionLibInt >= 1501) // Update with new releases (won't fail if forgotten)
5050
assert.True(t, versionLibInt < 10000) // Future next major release
5151

5252
assert.Eq(t, true, strings.Contains(versionInfo, versionGoString))

0 commit comments

Comments
 (0)