refactor checkpoint

This commit is contained in:
John Smith
2022-06-07 21:31:05 -04:00
parent 182af30b97
commit 1d8c63786a
28 changed files with 822 additions and 626 deletions

View File

@@ -35,9 +35,9 @@ typedef _StartupVeilidCoreDart = void Function(int, Pointer<Utf8>);
// fn get_veilid_state(port: i64)
typedef _GetVeilidStateC = Void Function(Int64);
typedef _GetVeilidStateDart = void Function(int);
// fn change_log_level(port: i64, log_level: FfiStr)
typedef _ChangeLogLevelC = Void Function(Int64, Pointer<Utf8>);
typedef _ChangeLogLevelDart = void Function(int, Pointer<Utf8>);
// fn change_api_log_level(port: i64, log_level: FfiStr)
typedef _ChangeApiLogLevelC = Void Function(Int64, Pointer<Utf8>);
typedef _ChangeApiLogLevelDart = void Function(int, Pointer<Utf8>);
// fn debug(port: i64, log_level: FfiStr)
typedef _DebugC = Void Function(Int64, Pointer<Utf8>);
typedef _DebugDart = void Function(int, Pointer<Utf8>);
@@ -243,7 +243,7 @@ class VeilidFFI implements Veilid {
final _FreeStringDart _freeString;
final _StartupVeilidCoreDart _startupVeilidCore;
final _GetVeilidStateDart _getVeilidState;
final _ChangeLogLevelDart _changeLogLevel;
final _ChangeApiLogLevelDart _changeApiLogLevel;
final _ShutdownVeilidCoreDart _shutdownVeilidCore;
final _DebugDart _debug;
final _VeilidVersionStringDart _veilidVersionString;
@@ -259,9 +259,9 @@ class VeilidFFI implements Veilid {
_getVeilidState =
dylib.lookupFunction<_GetVeilidStateC, _GetVeilidStateDart>(
'get_veilid_state'),
_changeLogLevel =
dylib.lookupFunction<_ChangeLogLevelC, _ChangeLogLevelDart>(
'change_log_level'),
_changeApiLogLevel =
dylib.lookupFunction<_ChangeApiLogLevelC, _ChangeApiLogLevelDart>(
'change_api_log_level'),
_shutdownVeilidCore =
dylib.lookupFunction<_ShutdownVeilidCoreC, _ShutdownVeilidCoreDart>(
'shutdown_veilid_core'),
@@ -299,11 +299,11 @@ class VeilidFFI implements Veilid {
}
@override
Future<void> changeLogLevel(VeilidConfigLogLevel logLevel) async {
Future<void> changeApiLogLevel(VeilidConfigLogLevel logLevel) async {
var nativeLogLevel = logLevel.json.toNativeUtf8();
final recvPort = ReceivePort("change_log_level");
final recvPort = ReceivePort("change_api_log_level");
final sendPort = recvPort.sendPort;
_changeLogLevel(sendPort.nativePort, nativeLogLevel);
_changeApiLogLevel(sendPort.nativePort, nativeLogLevel);
malloc.free(nativeLogLevel);
return processFutureVoid(recvPort.first);
}