Experiment with refactoring the internal sql interface a bit. My
original goal was to modify the schema and thus refactor to a state
where it would be sane to write tests for dc_sqlite_open() (and/or
however it ends up refactored) to assert schame changes before/after.
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
* 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
dc_mimeparser_new() constructor takes both blobdir and context, but only
uses the blobdir from the context and doesn't care about parser.blobdir,
this can be removed safely since only used internally.
* 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
* Start by comparing strings instead of result of strcmp()
* Add failing tests for dc_trim, dc_ltrim and dc_rtrim
* Fix failing tests (use libc:isspace() which counts \r, \n etc)
* Remove FIXME for first dc_simplify_simplify()
* Fix formatting
* Fix tests for dc_param_set()
* Fix remaining FIXMEs in stress.rs
* Don't wrap libc::isspace()
* Wrap unit tests with mod tests
* Fix format