aboutsummaryrefslogtreecommitdiff
path: root/lib/notmuch.h
AgeCommit message (Collapse)Author
2020-08-09Fix typosJonas Bernoulli
2020-08-03test: regression test for traversing config list with closed dbDavid Bremner
Also mention error return in API docs
2020-08-03lib: catch exceptions in n_directory_get_child_filesDavid Bremner
Also clarify API in error case.
2020-08-03lib: catch exceptions in n_directory_get_child_directoriesDavid Bremner
Also clarify API in error case.
2020-08-03lib: return NULL from n_d_get_default_indexopts on errorDavid Bremner
This is a rare and probably serious programming error, so better not to silently return a default value.
2020-07-22lib/n_d_needs_upgrade: handle error return from n_d_get_versionDavid Bremner
Also clarify documentation of error return from n_d_needs_upgrade.
2020-07-22lib/n_d_get_version: catch exceptions and clarify the APIDavid Bremner
notmuch_database_get_version previously returned 0 on some errors, but did not document this. Luckily 0 is not a valid database version.
2020-07-20lib: fix return value for n_m_reindexDavid Bremner
Also update the documentation for the behaviour of n_m_get_thread_id that this fix relies on.
2020-07-20lib: handle xapian exception in n_m_remove_all_tagsDavid Bremner
At least the exception we already catch should be reported properly.
2020-07-20lib: add notmuch_message_has_maildir_flag_stDavid Bremner
Initially the new function is mainly tested indirectly via the wrapper.
2020-07-18lib: catch exceptions in n_m_get_flag, provide n_m_get_flag_stDavid Bremner
It's not very nice to return FALSE for an error, so provide notmuch_message_get_flag_st as a migration path. Bump LIBNOTMUCH_MINOR_VERSION because the API is extended.
2020-07-14lib: catch Xapian exceptions in n_m_count_filesDavid Bremner
This will require some care for the caller to check the sign, and not just add error returns into a running total.
2020-07-14lib: add regression test for n_m_get_date; clarify APIDavid Bremner
This function catches Xapian exceptions. The test is intended to make sure it stays that way.
2020-07-13lib: catch exceptions in n_m_get_filenamesDavid Bremner
This is essentially copied from the change to notmuch_message_get_filename
2020-07-13lib/n_m_g_filename: catch Xapian exceptions, document NULL returnDavid Bremner
This is the same machinery as applied for notmuch_message_get_{thread,message}_id
2020-07-13lib/n_m_get_replies: doc return, initial regression testDavid Bremner
We need to to set a query and retrieve the threads to meaningfully test this function.
2020-07-03lib: catch error from closed db in n_m_get_message_idDavid Bremner
By catching it at the library top level, we can return an error value.
2020-03-19Correct doxygen framing for libnotmuch.hDaniel Kahn Gillmor
Apparently doxygen needs its comments formatted in a specific way to notice that the group is closed. Without this fix, with doxygen 1.8.16-2 we see: ``` doxygen ./doc/doxygen.cfg …/notmuch/lib/notmuch.h:2322: warning: end of file while inside a group ``` Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-14lib: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc in the lib directory
2019-01-25docs: Use correct call to notmuch_query_search_threads in usage examplerhn
Amended by db: simplify (subjectively) the example.
2019-01-25lib: Explicitly state when replies will be destroyedrhn
Without an explicit guarantee, it's not clear how to use the reference.
2018-05-26lib: make notmuch_message_get_database() take a const notmuch_message_t*Daniel Kahn Gillmor
This is technically an API change, but it is not an ABI change, and it's merely a statement that limits what the library can do. This is in parallel to notmuch_query_get_database(), which also takes a const pointer.
2018-05-26properties: add notmuch_message_count_propertiesDaniel Kahn Gillmor
The user can already do this manually, of course, but (a) it's nice to have a convenience function, and (b) exposing this interface means that someone more clever with a _notmuch_string_map_t than i am can write a more efficient version if they like, and it will just accelerate the users of the convenience function.
2018-05-26lib: bump minor versionDavid Bremner
This recognizes the addition of (at least) notmuch_message_get_database to the API.
2018-05-26lib: expose notmuch_message_get_database()Daniel Kahn Gillmor
We've had _notmuch_message_database() internally for a while, and it's useful. It turns out to be useful on the other side of the library interface as well (i'll use it later in this series for "notmuch show"), so we expose it publicly now.
2018-04-07Merge branch 'release'David Bremner
2018-04-02lib: bump LIBRARY_MINOR_VERSIONDavid Bremner
We added several new functions, at least notmuch_database_get_default_indexopts notmuch_database_index_file notmuch_indexopts_destroy notmuch_indexopts_get_decrypt_policy notmuch_indexopts_set_decrypt_policy notmuch_message_count_files notmuch_message_has_maildir_flag notmuch_message_reindex notmuch_message_remove_all_properties_with_prefix notmuch_thread_get_total_files
2018-01-04fix typosDaniel Kahn Gillmor
2017-12-08crypto: add --decrypt=nostash to avoid stashing session keysDaniel Kahn Gillmor
Here's the configuration choice for people who want a cleartext index, but don't want stashed session keys. Interestingly, this "nostash" decryption policy is actually the same policy that should be used by "notmuch show" and "notmuch reply", since they never modify the index or database when they are invoked with --decrypt. We take advantage of this parallel to tune the behavior of those programs so that we're not requesting session keys from GnuPG during "show" and "reply" that we would then otherwise just throw away.
2017-12-08crypto: new decryption policy "auto"Daniel Kahn Gillmor
This new automatic decryption policy should make it possible to decrypt messages that we have stashed session keys for, without incurring a call to the user's asymmetric keys.
2017-12-08lib: convert notmuch decryption policy to an enumDaniel Kahn Gillmor
Future patches in this series will introduce new policies; this merely readies the way for them. We also convert --try-decrypt to a keyword argument instead of a boolean.
2017-12-08indexopts: change _try_decrypt to _decrypt_policyDaniel Kahn Gillmor
This terminology makes it clearer what's going on at the API layer, and paves the way for future changesets that offer more nuanced decryption policy.
2017-10-21reindex: drop all properties named with prefix "index."Daniel Kahn Gillmor
This allows us to create new properties that will be automatically set during indexing, and cleared during re-indexing, just by choice of property name.
2017-10-21index: implement notmuch_indexopts_t with try_decryptDaniel Kahn Gillmor
This is currently mostly a wrapper around _notmuch_crypto_t that keeps its internals private and doesn't expose any of the GMime API. However, non-crypto indexing options might also be added later (e.g. filters or other transformations).
2017-10-20properties: add notmuch_message_remove_all_properties_with_prefix()Daniel Kahn Gillmor
Subsequent patches will introduce a convention that properties whose name starts with "index." will be stripped (and possibly re-added) during re-indexing. This patch lays the groundwork for doing that.
2017-10-20crypto: make shared crypto code behave library-likeDaniel Kahn Gillmor
If we're going to reuse the crypto code across both the library and the client, then it needs to report error states properly and not write to stderr.
2017-09-24fix reference to notmuch_message_get_propertiesDaniel Kahn Gillmor
2017-09-05fix documentation bug (leading quotes break documentation)Daniel Kahn Gillmor
2017-08-29lib: add notmuch_message_has_maildir_flagDavid Bremner
I considered a higher level interface where the caller passes a tag name rather than a flag character, but the role of the "unread" tag is particularly confusing with such an interface.
2017-08-23reindex: drop notmuch_param_t, use notmuch_indexopts_t insteadDaniel Kahn Gillmor
There are at least three places in notmuch that can trigger an indexing action: * notmuch new * notmuch insert * notmuch reindex I have plans to add some indexing options (e.g. indexing the cleartext of encrypted parts, external filters, automated property injection) that should properly be available in all places where indexing happens. I also want those indexing options to be exposed by (and constrained by) the libnotmuch C API. This isn't yet an API break because we've never made a release with notmuch_param_t. These indexing options are relevant in the listed places (and in the libnotmuch analogues), but they aren't relevant in the other kinds of functionality that notmuch offers (e.g. dump/restore, tagging, search, show, reply). So i think a generic "param" object isn't well-suited for this case. In particular: * a param object sounds like it could contain parameters for some other (non-indexing) operation. This sounds confusing -- why would i pass non-indexing parameters to a function that only does indexing? * bremner suggests online a generic param object would actually be passed as a list of param objects, argv-style. In this case (at least in the obvious argv implementation), the params might be some sort of generic string. This introduces a problem where the API of the library doesn't grow as new options are added, which means that when code outside the library tries to use a feature, it first has to test for it, and have code to handle it not being available. The indexopts approach proposed here instead makes it clear at compile time and at dynamic link time that there is an explicit dependency on that feature, which allows automated tools to keep track of what's needed and keeps the actual code simple. My proposal adds the notmuch_indexopts_t as an opaque struct, so that we can extend the list of options without causing ABI breakage. The cost of this proposal appears to be that the "boilerplate" API increases a little bit, with a generic constructor and destructor function for the indexopts struct. More patches will follow that make use of this indexopts approach.
2017-08-23database: add n_d_index_file (deprecates n_d_add_message)Daniel Kahn Gillmor
We need a way to pass parameters to the indexing functionality on the first index, not just on reindexing. The obvious place is in notmuch_database_add_message. But since modifying the argument list would break both API and ABI, we needed a new name. I considered notmuch_database_add_message_with_params(), but the functionality we're talking about doesn't always add a message. It tries to index a specific file, possibly adding a message, but possibly doing other things, like adding terms to an existing message, or failing to deal with message objects entirely (e.g. because the file didn't contain a message). So i chose the function name notmuch_database_index_file. I confess i'm a little concerned about confusing future notmuch developers with the new name, since we already have a private _notmuch_message_index_file function, and the two do rather different things. But i think the added clarity for people linking against the future libnotmuch and the capacity for using index parameters makes this a worthwhile tradeoff. (that said, if anyone has another name that they strongly prefer, i'd be happy to go with it) This changeset also adjusts the tests so that we test whether the new, preferred function returns bad values (since the deprecated function just calls the new one). We can keep the deprecated n_d_add_message function around as long as we like, but at the next place where we're forced to break API or ABI we can probably choose to drop the name relatively safely. NOTE: there is probably more cleanup to do in the ruby and go bindings to complete the deprecation directly. I don't know those languages well enough to attempt a fix; i don't know how to test them; and i don't know the culture around those languages about API additions or deprecations.
2017-08-20lib: clarify description of notmuch_database_add_messageDaniel Kahn Gillmor
Since we're accumulating the index when we add a new file to the message, the semantics have slightly changed. This tries to align the documentation with the actual functionality.
2017-08-01lib: add notmuch_message_reindexDaniel Kahn Gillmor
This new function asks the database to reindex a given message. The parameter `indexopts` is currently ignored, but is intended to provide an extensible API to support e.g. changing the encryption or filtering status (e.g. whether and how certain non-plaintext parts are indexed).
2017-08-01lib: add notmuch_thread_get_total_filesDavid Bremner
This is relatively inexpensive in terms of run time and implementation cost as we are already traversing the list of messages in a thread.
2017-08-01lib: add notmuch_message_count_filesDavid Bremner
This operation is relatively inexpensive, as the needed metadata is already computed by our lazy metadata fetching. The goal is to support better UI for messages with multipile files.
2017-07-18fix the generated documentation outputDaniel Kahn Gillmor
2017-07-18Fix orthographyDaniel Kahn Gillmor
2017-05-12build: switch to hiding libnotmuch symbols by defaultJani Nikula
The dynamic generation of the linker version script for libnotmuch exports has grown rather complicated. Reverse the visibility control by hiding symbols by default using -fvisibility=hidden, and explicitly exporting symbols in notmuch.h using #pragma GCC visibility. (We could also use __attribute__ ((visibility ("default"))) for each exported function, but the pragma is more convenient.) The above is not quite enough alone, as it would "leak" a number of weak symbols from Xapian and C++ standard library. Combine it with a small static version script that filters out everything except the notmuch_* symbols that we explicitly exposed, and the C++ RTTI typeinfo symbols for exception handling. Finally, as the symbol hiding test can no longer look at the generated symbol table, switch the test to parse the functions from notmuch.h.
2017-03-22lib: make notmuch_query_add_tag_exclude return a status valueDavid Bremner
Since this is an ABI breaking change, but we already bumped the SONAME for the next release
2017-03-22lib: replace deprecated n_q_count_threads with status returning versionDavid Bremner
This function was deprecated in notmuch 0.21. We re-use the name for a status returning version, and deprecate the _st name.