Since dc_mimeparser_parse() called `dc_mimeparser_empty()' on passed reference
anyway, it makes more sense to create new instance of `dc_mimeparser_t' and
return it instead.
Previously, usage pattern was following:
dc_mimeparser_new()
dc_mimeparser_empty() // semantically no-op, called inside dc_mimeparser_parse
Now call to dc_mimeparser_empty() is avoided.
* Make dc_dehtml() function safe
* Change type of is_msgrmsg parameter to bool
* Narrow type of local variable in simplify_plain_text()
* Export less fields of `Simplify' record
* Demote is_cut_* from fields of `Simplify' to local variables
* Refactor part of simplify_plain_text()
Refactor footer ("-- " and similar) code into separate function,
and re-implement it with standard Rust string methods.
It simplifies code and allows removing one mutable local variable.
* Replace dc_split_into_lines with String.split()
* src/dc_simplify.rs(find_message_footer): adjust type signature to accept
slice of &str, not slice of pointers
* src/dc_simplify.rs(simplify_plain_text): adjust code to use '==' operator
instead of strcmp(3).
* src/dc_simplify.rs(is_empty_line, is_quoted_headline, is_plain_quote):
+ adjust type signatures to accept &str, not 'const char *'
+ remove no longer needed 'unsafe' qualifier
* src/dc_tools(dc_split_into_lines, dc_free_splitted_lines): remove no longer
used functions.
In addition to additional type-safety, this change reduces number of
allocations: String.split returns iterator of &str.
* Make simplify_plain_text() safe
* Make Simplify.simplify return String, not pointer
* Refactor Simplify.simplify to use String methods, not pointers
* Make Simplify.simplify() safe
* Avoid neeless allocation in Simplify.simplify when input is html
* Add tests for simplify utilities
* Document discussion about is_empty_line() discussion
* refactor(contact): rename and rusty memory allocations
* refactor(contact): use enum to indidcate origin
* refactor(contact): safe blocking and unblocking api
* refactor(contact): only safe and no more cstrings
Add a trait for str.strdup() to replace to_cstring() which avoid the
signature ambiguity with .to_string().
Also instruduce CString::yolo() as a shortcut to
CString::new().unwrap() and use it whenever the variable does can be
deallocated by going out of scope. This is less error prone.
Use some Path.to_c_string() functions where possible.
This change removes global override of `non_shake_case' warning and replaces it
with per-function overrrides. This way, compiler will complain about style
guide violation in new code.
It should be noted, that `rustc' is not smart enough to emit warning when
override is no longer needed, it must be checked manually.
* refactor: safe sql access
* Clean up the worst rebase mistakes
* Some more progress on the rebase fallout and this branch
* upgrade and compile again
* cleanup from rebase
* example of how to prepare now
* rebase fixes
* add sql.query_map
* less preparation
* more improvements in sql code
* fix string truncation
* more prepare conversions
* most prep done
* fix tests
* fix ffi
* fix last prepares
* fix segfaults and some queries
* use r2d2 pool
* fix dc_job sql call, to reduce contention
* try newer rust
* No more vararg printing (drop dc_log_)
* ignore expected errors
* fix: uses exists instead of execute where needed
* fix: get_contacts logic was broken
* fix: contact creation
* test on 32bit linux
* ci: try running 32bit without cross
* undo 32bit tests
* refactor: rename dc_sqlite3 to sql
* fix: safer string conversions
* more string fixes
* try fixing appveyor build to 64bit
* chore(ci): hardcode target
* chore(ci): appveyor
* some cleanup work
* try fix darwin
* fix and improve sql escaping
* fix various bugs
* fix chat deletion
* refactor: cleanup config values and move to their own file
* refactor: move more methods onto the sql struct
* dont panic on failed state loading
* first round of cr
* one more cr fix
* stop using strange defaults
* remove unused escapes
The function does a cast and does not create a new objects. The
stdlib convention is to use to_*() for functions which return new
objects and as_*() for functions which keep referring to the same data
but using a different type. Follow that convention.
* 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.