This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor rust library into crates * Refactor library to make the store properties of logins and list rather than logins and list properties of store. Also provide a Toodle interface through which to instantiate logins and list * Update iOS project to reflect new library structure * Address review comments @rnewman. * Better description for library in Cargo.toml * Nicer result handling in login and list managers. Couldn't get the "when_ok" ResultEffect working properly. Will take a deeper look * Rename ComplexRust.xcodeproj to Toodle.xcodeproj (#26) * Rename ComplexRust.xcodeproj to Toodle.xcodeproj * Rename source code folder to Toodle * Rollback accidental changes to `ListManager` These changes were part of the "Enable Async" issue (#4) and accidentally made their way into this commit when renaming the iOS source code folder.
- Loading branch information
Emily Toop
authored
Nov 15, 2017
1 parent
b15c292
commit 6c0636d
Showing
44 changed files
with
791 additions
and
668 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
[package] | ||
name = "greetings" | ||
version = "0.1.1" | ||
authors = ["fluffyemily <[email protected]>"] | ||
description = "Example static library project built for iOS" | ||
publish = false | ||
|
||
[target.'cfg(target_os="android")'.dependencies] | ||
jni = { version = "0.5", default-features = false } | ||
name = "toodle" | ||
version = "0.1.0" | ||
authors = ["Emily Toop <[email protected]>"] | ||
description = "Cross Platform Library for providing To Do List data" | ||
|
||
[lib] | ||
name = "greetings" | ||
name = "toodle" | ||
crate-type = ["staticlib", "cdylib"] | ||
|
||
[dependencies] | ||
time = "0.1.38" | ||
uuid = { version = "0.4", features = ["v4"] } | ||
libc = "0.2.32" | ||
[dependencies.ffi-utils] | ||
path = "ffi-utils" | ||
|
||
[dependencies.store] | ||
path = "store" | ||
|
||
[dependencies.logins] | ||
path = "logins" | ||
|
||
[dependencies.rusqlite] | ||
version = "0.12" | ||
# System sqlite might be very old. | ||
features = ["bundled", "limits"] | ||
[dependencies.list] | ||
path = "list" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "ffi-utils" | ||
version = "0.1.0" | ||
authors = ["Emily Toop <[email protected]>"] | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2016 Mozilla | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
// this file except in compliance with the License. You may obtain a copy of the | ||
// License at http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software distributed | ||
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | ||
// CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations under the License. | ||
|
||
pub mod strings { | ||
use std::os::raw::c_char; | ||
use std::ffi::{ | ||
CString, | ||
CStr | ||
}; | ||
|
||
pub fn c_char_to_string(cchar: *const c_char) -> String { | ||
let c_str = unsafe { CStr::from_ptr(cchar) }; | ||
let r_str = match c_str.to_str() { | ||
Err(_) => "", | ||
Ok(string) => string, | ||
}; | ||
r_str.to_string() | ||
} | ||
|
||
pub fn string_to_c_char(r_string: String) -> *mut c_char { | ||
CString::new(r_string).unwrap().into_raw() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "list" | ||
version = "0.1.0" | ||
authors = ["Emily Toop <[email protected]>"] | ||
|
||
[target.'cfg(target_os="android")'.dependencies] | ||
jni = { version = "0.5", default-features = false } | ||
|
||
[dependencies] | ||
time = "0.1.38" | ||
uuid = { version = "0.4", features = ["v4"] } | ||
libc = "0.2.32" | ||
|
||
[dependencies.store] | ||
path = "../store" | ||
|
||
[dependencies.ffi-utils] | ||
path = "../ffi-utils" | ||
|
||
[dependencies.rusqlite] | ||
version = "0.12" | ||
# System sqlite might be very old. | ||
features = ["bundled", "limits"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.