Commit Graph

31 Commits

Author SHA1 Message Date
Floris Bruynooghe
4c646dc1e0 Rename dc_chat_t to Chat
This clears the way to start working on making the functions safe.
But small PRs are good PRs so let's get this rename out of the way and
have future PRs less noisy.

Also stop making this #[repr(C)] and start making fields that are not
used private. Lastly clean up some comments by moving them or
deleting them, so they make sense again after the translation.
2019-07-09 21:46:31 +02:00
dignifiedquire
286d1a99aa fixup 2019-07-06 11:29:13 +02:00
dignifiedquire
4fe99b21c9 feat: add better feature configurations 2019-07-06 11:25:01 +02:00
Floris Bruynooghe
6ccc75b1ed Arbitrarily bump the version
This allows me to create a new tag and play wity building flatpak
builds for this tag.
2019-06-30 19:48:44 +02:00
Floris Bruynooghe
db9bc15d3e Make the callback optional again
The C API allows passing a NULL pointer is for the callback function.
However when calling the callback nothing checks for this null pointer
and thus things fail badly.  Even worse since the C API is defined
using an "fn pointer" rather than a "*-ptr" or raw pointer to the
function rust does not realise this can be invalid and therefore the
typechecker does not catch this even though there are no unsafe casts.

Fix this by making the callback an Option in rust, this can be easily
checked when calling.  Also add a Context.call_cb() function which
simplifies calling the callback, hides the weird syntax due to the
function pointer and makes the call a little easier.  Finally it also
means the option checking is only needed in one place.

For the C API this needs to check if this is a NULL pointer or not,
this is implicitly done by rust using the "nullable pointer
optimisation":
https://doc.rust-lang.org/nomicon/ffi.html#the-nullable-pointer-optimization
2019-06-17 20:06:15 +02:00
Floris Bruynooghe
dc0de47b4b Clean up some warnings and use newer nightly compiler
This stops using the deprecated libc::uint32_t and libc::uint64_t
types in favour of the native u32 and u64 types.

It also uses a newer nightly compiler to get rid of the incorrect
"unused no_mangle" warning when compiling incrementally.

Finally the newer compiler prefers us to be explicit when implementing
traits using the new dyn keyword.
2019-06-16 15:32:15 +02:00
Lars-Magnus Skog
18c0d9f83b chore: update version to 1.0.0-alpha.0 2019-06-07 13:36:15 +02:00
dignifiedquire
0579382173 feat(ffi): add dc_str_unref 2019-06-02 00:08:04 +02:00
holger krekel
6ce8374513 feat: bring back and adapt python bindings with rust core
* import python, try to adapt for rust

* add missing wrapper functions

* - try to write up how to build python bindings
- strike some unused functions from deltachat.h

* adjustments to make tox work

* try to run circle-ci with python build

* don't do docs

* running cargo test as well

* don't run cargo test anymore, that's done in other ci jobs

* also build docs

* don't run doxygen anymore

* subst C with Rust

* a try to get better wheels

Closes #41
2019-05-30 23:17:38 +02:00
Friedel Ziegelmayer
a2fc127923 feat(ffi): install global panic handler (#108) 2019-05-30 15:18:34 +02:00
Lars-Magnus Skog
3ade0a1de8 chore: remove unused DC_EVENT_HTTP_GET and DC_EVENT_HTTP_POST defines (#87) 2019-05-28 18:00:58 +02:00
Friedel Ziegelmayer
0d51c7dd2e Prepare for android builds (#88)
* upgrade ci

* fixup

* update ci script

* Update run.sh

* refactor(time): drop libc time functions

* fix(ffi): use i64 instead off time_t

* fix(ci): install croos

* fix: remove unused dc_check_password

* fix(ffi): enable ssl vendoring by default

* chore: remove unused import

* fix(deps): add vendored flag for reqwest

* chore(ci): use cross fork

* fix: handle invalid  server configurations

Closes #90

* Disable android from circle ci for now
2019-05-28 17:41:50 +02:00
dignifiedquire
22868abe0e refactor: rename dc_context to context 2019-05-27 09:32:50 +02:00
Friedel Ziegelmayer
f0cfcef864 refactor: use reqwest to handle http-get requests
Closes #82
2019-05-27 09:06:55 +02:00
Friedel Ziegelmayer
a247e5b143 refactor(oauth): safe oauth2 and remove custom json parser (#80)
* refactor(oauth): safe oauth2 and remove custom json parser

Closes #46,#53
2019-05-26 22:49:52 +02:00
Lars-Magnus Skog
8678813051 fix: regressions in dc_msg_get_duration() and dc_delete_contact() (#73)
* fix: regression in dc_msg_get_duration, should return int

* fix: regression in dc_delete_contact()
2019-05-16 19:06:14 +02:00
dignifiedquire
ddbb8bd756 fix(ffi): rename generated lib to libdeltachat
Closes #68
2019-05-16 17:32:06 +02:00
Friedel Ziegelmayer
342e416b4e Ci updates & closer to windows builds
* chore: update some ci

* feat: no more libiconv

* refactor: updates for updated mmime api

* fixup: correct mmime path

* cleanup

* use newer visual studio

* Update appveyor.yml

* unify libc imports and improve windows situation

* refactor: use rust based sleep

* improve cross platform state of types

* docs: update readme badges
2019-05-16 17:16:07 +02:00
Lars-Magnus Skog
259f19ca5d refactor: cast bool functions to libc::c_int instead of if-else (#60) 2019-05-11 18:44:57 +02:00
Hocuri
569c924a0c Replace types that use only 0 and 1 with bool (#18) (#58)
* Start replacing int with bool where possible (#18)

* Continue replacing int with bool where possible (#18)

* Continue replacing int with bool where possible (#18)

* Run fmt
2019-05-11 12:07:09 +02:00
dignifiedquire
b1249b7bb7 fix(ffi): add dc_array_is_independent 2019-05-10 11:08:09 +01:00
dignifiedquire
31d50e7016 fix: ffi interface updates 2019-05-02 11:31:35 +02:00
dignifiedquire
6e931d3e7b more fixes for android builds 2019-04-28 21:41:08 +03:00
dignifiedquire
2acaf54f69 stop autogenerating the header 2019-04-28 18:06:26 +03:00
dignifiedquire
b3041c0c5c ffi: fixup types 2019-04-28 15:22:33 +03:00
dignifiedquire
e8a79f220e refactor: use architecture dependent sizes 2019-04-28 15:18:30 +03:00
B. Petersen
401bddf61a add dc_context_t and more to ffi 2019-04-28 13:10:31 +02:00
B. Petersen
3ecb122ee1 add dc_msg_t to ffi 2019-04-28 01:38:32 +02:00
B. Petersen
a153f915d5 add dc_chat_t to ffi 2019-04-28 01:38:32 +02:00
B. Petersen
5b4111922e add dc_chatlist_t to ffi 2019-04-27 22:38:24 +02:00
dignifiedquire
956609f565 feat: reorg code, and prepare for c bindings 2019-04-27 21:48:22 +03:00