Commit 677b9aea authored by Michal Piotrowski's avatar Michal Piotrowski
Browse files

flutter lib p1

flutter lib p2

flutter lib p3

flutter lib p4

flutter lib p5

flutter lib p6

flutter lib p7

flutter lib p8

flutter lib p9

flutter lib p10

flutter lib p11

flutter lib p12

flutter lib p13

flutter lib p14

flutter lib p15

flutter lib p16

flutter lib p17

flutter lib p18

flutter lib p19

flutter lib p20
parent 459c71bd
Showing with 2188 additions and 0 deletions
+2188 -0
......@@ -18,3 +18,4 @@ target/
# mac
.DS_Store
memripod-flutter/.dart_tool/pub/
......@@ -1402,6 +1402,7 @@ dependencies = [
"num_cpus",
"oauth-client",
"oauth2",
"openssl",
"percent-encoding",
"r2d2",
"r2d2_sqlite",
......@@ -1695,6 +1696,15 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "111.25.0+1.1.1t"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.80"
......@@ -1704,6 +1714,7 @@ dependencies = [
"autocfg",
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
......
......@@ -27,6 +27,7 @@ md5 = "0.7.0"
num_cpus = "1.13.1"
oauth2 = "4.2.3"
oauth-client = { version = "0.8.0", default-features = true }
openssl = { version = "0.10.35", features = ["vendored"] }
percent-encoding = { workspace = true }
r2d2_sqlite = "0.20.0"
r2d2 = "0.8.10"
......
.DEFAULT_GOAL := help
PROJECTNAME=$(shell basename "$(PWD)")
SOURCES=$(sort $(wildcard ./src/*.rs ./src/**/*.rs))
OS_NAME=$(shell uname | tr '[:upper:]' '[:lower:]')
PATH := $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin:$(PATH)
ANDROID_AARCH64_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/aarch64-linux-android29-clang
ANDROID_ARMV7_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/armv7a-linux-androideabi29-clang
ANDROID_I686_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/i686-linux-android29-clang
ANDROID_X86_64_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/x86_64-linux-android29-clang
SHELL := /bin/bash
# ##############################################################################
# # GENERAL
# ##############################################################################
.PHONY: help
help: Makefile
@echo
@echo " Available actions in "$(PROJECTNAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
## init: Install missing dependencies.
.PHONY: init
init:
rustup target add aarch64-apple-ios x86_64-apple-ios
rustup target add aarch64-apple-darwin x86_64-apple-darwin
#rustup target add armv7-apple-ios armv7s-apple-ios i386-apple-ios ## deprecated
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
@if [ $$(uname) == "Darwin" ] ; then cargo install cargo-lipo ; fi
cargo install cbindgen
## :
# ##############################################################################
# # RECIPES
# ##############################################################################
## all: Compile iOS, Android and bindings targets
all: ios macos android bindings
## ios: Compile the iOS universal library
ios: target/universal/release/liblibpod.a
target/universal/release/liblibpod.a: $(SOURCES) ndk-home
@if [ $$(uname) == "Darwin" ] ; then \
cargo lipo --release ; \
else echo "Skipping iOS compilation on $$(uname)" ; \
fi
@echo "[DONE] $@"
## macos: Compile the macOS libraries
macos: target/x86_64-apple-darwin/release/liblibpod.dylib target/aarch64-apple-darwin/release/liblibpod.dylib
target/x86_64-apple-darwin/release/liblibpod.dylib: $(SOURCES)
@if [ $$(uname) == "Darwin" ] ; then \
cargo lipo --release --targets x86_64-apple-darwin ; \
else echo "Skipping macOS compilation on $$(uname)" ; \
fi
@echo "[DONE] $@"
target/aarch64-apple-darwin/release/liblibpod.dylib: $(SOURCES)
@if [ $$(uname) == "Darwin" ] ; then \
cargo lipo --release --targets aarch64-apple-darwin ; \
else echo "Skipping macOS compilation on $$(uname)" ; \
fi
@echo "[DONE] $@"
## android: Compile the android targets (arm64, armv7 and i686)
android: target/aarch64-linux-android/release/liblibpod.so target/armv7-linux-androideabi/release/liblibpod.so target/i686-linux-android/release/liblibpod.so target/x86_64-linux-android/release/liblibpod.so
target/aarch64-linux-android/release/liblibpod.so: $(SOURCES) ndk-home
C_INCLUDE_PATH=/usr/include/ \
CC_aarch64_linux_android=$(ANDROID_AARCH64_LINKER) \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$(ANDROID_AARCH64_LINKER) \
cargo build --target aarch64-linux-android --release
@echo "[DONE] $@"
target/armv7-linux-androideabi/release/liblibpod.so: $(SOURCES) ndk-home
CC_armv7_linux_androideabi=$(ANDROID_ARMV7_LINKER) \
CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=$(ANDROID_ARMV7_LINKER) \
cargo build --target armv7-linux-androideabi --release
@echo "[DONE] $@"
target/i686-linux-android/release/liblibpod.so: $(SOURCES) ndk-home
CC_i686_linux_android=$(ANDROID_I686_LINKER) \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=$(ANDROID_I686_LINKER) \
cargo build --target i686-linux-android --release
@echo "[DONE] $@"
target/x86_64-linux-android/release/liblibpod.so: $(SOURCES) ndk-home
CC_x86_64_linux_android=$(ANDROID_X86_64_LINKER) \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=$(ANDROID_X86_64_LINKER) \
cargo build --target x86_64-linux-android --release
@echo "[DONE] $@"
.PHONY: ndk-home
ndk-home:
@if [ ! -d "${ANDROID_NDK_HOME}" ] ; then \
echo "Error: Please, set the ANDROID_NDK_HOME env variable to point to your NDK folder" ; \
exit 1 ; \
fi
## bindings: Generate the .h file for iOS
bindings: target/bindings.h
target/bindings.h: $(SOURCES)
cbindgen $^ -c cbindgen.toml | grep -v \#include | uniq > $@
@echo "[DONE] $@"
## :
# ##############################################################################
# # OTHER
# ##############################################################################
## clean:
.PHONY: clean
clean:
cargo clean
rm -f target/bindings.h target/bindings.src.h
## test:
.PHONY: test
test:
cargo test
{
"configVersion": 2,
"packages": [
{
"name": "args",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/args-2.4.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "async",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/async-2.10.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "boolean_selector",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "characters",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/characters-1.2.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "cli_util",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/cli_util-0.4.0",
"packageUri": "lib/",
"languageVersion": "2.19"
},
{
"name": "clock",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/clock-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "collection",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/collection-1.17.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "fake_async",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/fake_async-1.3.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "ffi",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/ffi-2.0.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "ffigen",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/ffigen-7.2.10",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "file",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/file-6.1.4",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter",
"rootUri": "file:///home/michal/snap/flutter/common/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "flutter_test",
"rootUri": "file:///home/michal/snap/flutter/common/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "glob",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/glob-2.1.1",
"packageUri": "lib/",
"languageVersion": "2.15"
},
{
"name": "js",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/js-0.6.5",
"packageUri": "lib/",
"languageVersion": "2.16"
},
{
"name": "logging",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/logging-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "matcher",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/matcher-0.12.13",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "material_color_utilities",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0",
"packageUri": "lib/",
"languageVersion": "2.13"
},
{
"name": "meta",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/meta-1.8.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "package_config",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/package_config-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "path",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/path-1.8.2",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "quiver",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/quiver-3.2.1",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "sky_engine",
"rootUri": "file:///home/michal/snap/flutter/common/flutter/bin/cache/pkg/sky_engine",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "source_span",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/source_span-1.9.1",
"packageUri": "lib/",
"languageVersion": "2.14"
},
{
"name": "stack_trace",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/stack_trace-1.11.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "stream_channel",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/stream_channel-2.1.1",
"packageUri": "lib/",
"languageVersion": "2.14"
},
{
"name": "string_scanner",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/string_scanner-1.2.0",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "term_glyph",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/term_glyph-1.2.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "test_api",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/test_api-0.4.16",
"packageUri": "lib/",
"languageVersion": "2.18"
},
{
"name": "vector_math",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/vector_math-2.1.4",
"packageUri": "lib/",
"languageVersion": "2.14"
},
{
"name": "yaml",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/yaml-3.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "yaml_edit",
"rootUri": "file:///home/michal/.pub-cache/hosted/pub.dev/yaml_edit-2.1.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "memripod",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.12"
}
],
"generated": "2023-04-07T10:28:37.908041Z",
"generator": "pub",
"generatorVersion": "2.19.6"
}
This diff is collapsed.
import 'dart:ffi';
import 'dart:io';
import 'package:ffi/ffi.dart';
import './bindings.dart';
const DYNAMIC_LIBRARY_FILE_NAME_ANDROID = "liblibpod.so";
const DYNAMIC_LIBRARY_FILE_NAME_MACOS = "liblibpod.dylib";
/// Wraps the native functions and converts specific data types in order to
/// handle C strings.
class PodLib {
static final PodLibBindings _bindings =
PodLibBindings(PodLib._loadLibrary());
static DynamicLibrary _loadLibrary() {
return Platform.isAndroid
? DynamicLibrary.open(DYNAMIC_LIBRARY_FILE_NAME_ANDROID)
: Platform.isMacOS
? DynamicLibrary.open(DYNAMIC_LIBRARY_FILE_NAME_MACOS)
: DynamicLibrary.process();
}
static String bulk(String bulk, String databaseKey, String ownerKey) {
final bulkPtr = bulk.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.bulk(bulkPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String createAccount(String createUserReq) {
final createUserReqPtr = createUserReq.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.create_account(createUserReqPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String createEdge(String createEdge, String databaseKey, String ownerKey) {
final createEdgePtr = createEdge.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.create_edge(createEdgePtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String createItem(String createItem, String databaseKey, String ownerKey) {
final createItemPtr = createItem.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.create_item(createItemPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String deleteEdge(String deleteEdgeBySourceTarget, String databaseKey, String ownerKey) {
final deleteEdgeBySourceTargetPtr = deleteEdgeBySourceTarget.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.delete_edge(deleteEdgeBySourceTargetPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String deleteItem(String item, String databaseKey, String ownerKey) {
final itemPtr = item.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.delete_item(itemPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String deleteUser(String databaseKey, String ownerKey) {
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.delete_user(databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String getEdges(String getEdges, String databaseKey, String ownerKey) {
final getEdgesPtr = getEdges.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.get_edges(getEdgesPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String getFile(String getFile, String databaseKey, String ownerKey) {
final getFilePtr = getFile.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.get_file(getFilePtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String getItem(String getItem, String databaseKey, String ownerKey) {
final getItemPtr = getItem.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.get_item(getItemPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String graphql(String item, String databaseKey, String ownerKey) {
final itemPtr = item.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.graphql(itemPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String oauth1AccessToken(String oauthAccessTokenPayload) {
final oauthAccessTokenPayloadPtr = oauthAccessTokenPayload.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.oauth1_access_token(oauthAccessTokenPayloadPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String oauth1RequestToken(String oauthRequestTokenPayload) {
final oauthRequestTokenPayloadPtr = oauthRequestTokenPayload.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.oauth1_request_token(oauthRequestTokenPayloadPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String oauth2AccessToken(String oauth2AccessTokenRequest, String databaseKey, String ownerKey) {
final oauth2AccessTokenRequestPtr = oauth2AccessTokenRequest.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.oauth2_access_token(itemPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String oauth2AuthUrl(String oauth2AuthUrlRequest) {
final oauth2AuthUrlRequestPtr = oauth2AuthUrlRequest.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.oauth2_auth_url(oauth2AuthUrlRequestPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String oauth2Authorize(String oauth2AuthorizeTokenRequest, String databaseKey, String ownerKey) {
final oauth2AuthorizeTokenRequestPtr = oauth2AuthorizeTokenRequest.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.oauth2_authorize(oauth2AuthorizeTokenRequestPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String search(String search, String databaseKey, String ownerKey) {
final searchPtr = search.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.search(oauth2AuthorizeTokenRequestPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String sendEmail(String sendEmail, String databaseKey, String ownerKey) {
final sendEmailPtr = sendEmail.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.send_email(sendEmailPtr, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
static String updateItem(String updateItem, String databaseKey, String ownerKey) {
final updateItemPtr = updateItem.toNativeUtf8().cast<Int8>();
final databaseKeyPtr = databaseKey.toNativeUtf8().cast<Int8>();
final ownerKeyPtr = ownerKey.toNativeUtf8().cast<Int8>();
// Native call
final ptrResult = _bindings.update_item(updateItem, databaseKeyPtr, ownerKeyPtr);
// Cast the result pointer to a Dart string
final result = ptrResult.cast<Utf8>().toDartString();
// Clone the given result, so that the original string can be freed
final resultCopy = "" + result;
// Free the native value
PodLib._free(result);
return resultCopy;
}
/// Releases the memory allocated to handle the given (result) value
static void _free(String value) {
final ptr = value.toNativeUtf8().cast<Int8>();
return _bindings.rust_cstr_free(ptr);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/kotlin" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
</component>
</module>
\ No newline at end of file
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
async:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.dev"
source: hosted
version: "2.10.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.dev"
source: hosted
version: "1.2.1"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7
url: "https://pub.dev"
source: hosted
version: "0.4.0"
clock:
dependency: transitive
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.dev"
source: hosted
version: "1.17.0"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: "direct main"
description:
name: ffi
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
url: "https://pub.dev"
source: hosted
version: "2.0.1"
ffigen:
dependency: "direct dev"
description:
name: ffigen
sha256: "94587f4c9699a4d0a25da95dc0b41903ddc69201d9bac3ca128ade8e67d56015"
url: "https://pub.dev"
source: hosted
version: "7.2.10"
file:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.5"
logging:
dependency: transitive
description:
name: logging
sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.dev"
source: hosted
version: "1.8.2"
quiver:
dependency: transitive
description:
name: quiver
sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47
url: "https://pub.dev"
source: hosted
version: "3.2.1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_span:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
version: "1.9.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.dev"
source: hosted
version: "0.4.16"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
yaml:
dependency: transitive
description:
name: yaml
sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
yaml_edit:
dependency: transitive
description:
name: yaml_edit
sha256: "0b968021754d8fbd3e9c83563b538ee417d88b2cc587606da5615546b7ee033b"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
sdks:
dart: ">=2.19.0 <3.0.0"
name: memripod
description: A Flutter plugin for memri pod.
version: 1.0.0
dependencies:
ffi: ^2.0.1
flutter:
sdk: flutter
dev_dependencies:
ffigen: ^7.2.10
flutter_test:
sdk: flutter
environment:
sdk: '^2.12.0'
flutter:
plugin:
platforms:
android:
package: com.memri.pod_plugin
pluginClass: MemriPodPlugin
ios:
pluginClass: MemriPodPlugin
ffigen:
output: lib/bindings.dart
headers:
entry-points:
- ../memripod/memripod.h
name: MemriPodBindings
description: Dart bindings to call memri pod functions
functions:
include:
- bulk
- create_account
- create_edge
- create_item
- delete_edge
- delete_item
- delete_user
- get_edges
- get_file
- get_item
- graphql
- oauth1_access_token
- oauth1_request_token
- oauth2_access_token
- oauth2_auth_url
- oauth2_authorize
- search
- send_email
- update_item
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment