aboutsummaryrefslogtreecommitdiff
path: root/lib/notmuch.h
AgeCommit message (Collapse)Author
2017-03-22lib: replace deprecated n_q_count_messages 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. One or two remaining uses of the (removed) non-status returning version fixed at the same time
2017-03-22lib: replace deprecated n_q_search_messages 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.
2017-03-22lib: replace n_query_search_threads with status returning versionDavid Bremner
This function was deprecated in notmuch 0.21. We finally remove the deprecated API, and rename the status returning version to the simpler name. The status returning is kept as a deprecated alias.
2017-03-22lib: bump SONAME to libnotmuch5David Bremner
We plan a sequence of ABI breaking changes. Put the SONAME change in a separate commit to make reordering easier.
2017-01-15docs: fix notmuch_message_properties_value documentationSteven Allen
It returns the value, not the key.
2017-01-07lib: fix the todo comment placement on NOTMUCH_STATUS_XAPIAN_EXCEPTIONJani Nikula
The todo comment got separated from the status it's related to at commit 3f32fd8a1c06 ("Add missing comment for NOTMUCH_STATUS_READONLY_DATABASE."). Later, commit b65ca8e0ba5e ("lib: modify notmuch.h for automatic document generation") moved it, but to the wrong place. Fix the location.
2016-10-06lib: document API added in 0.23David Bremner
The API was already documented, but for future readers note when the functions were added,
2016-10-01lib: bump minor version to mark added symbolsDavid Bremner
This should not change the SONAME, and therefore won't change the dynamic linking behaviour, but it may help some users debug missing symbols in case their libnotmuch is too old.
2016-09-21lib: iterator API for message propertiesDavid Bremner
This is a thin wrapper around the string map iterator API just introduced.
2016-09-21lib: basic message-property APIDavid Bremner
Initially, support get, set and removal of single key/value pair, as well as removing all properties.
2016-06-28doc: forbid further operations on a closed databaseDavid Bremner
We could add many null pointer checks, but currently I don't see a use case that justifies it.
2016-06-11lib: fix definition of LIBNOTMUCH_CHECK_VERSIONDavid Bremner
Fix bug reported in id:20160606124522.g2y2eazhhrwjsa4h@flatcap.org Although the C99 standard 6.10 is a little non-obvious on this point, the docs for e.g. gcc are unambiguous. And indeed in practice with the extra space, this code fails #include <stdio.h> #define foo (x) (x+1) int main(int argc, char **argv){ printf("%d\n",foo(1)); }
2016-06-05Use https instead of http where possibleDaniel Kahn Gillmor
Many of the external links found in the notmuch source can be resolved using https instead of http. This changeset addresses as many as i could find, without touching the e-mail corpus or expected outputs found in tests.
2016-05-25lib: config list iteratorsDavid Bremner
Since xapian provides the ability to restrict the iterator to a given prefix, we expose this ability to the user. Otherwise we mimic the other iterator interfances in notmuch (e.g. tags.c).
2016-05-24lib: provide config APIDavid Bremner
This is a thin wrapper around the Xapian metadata API. The job of this layer is to keep the config key value pairs from colliding with other metadata by transparently prefixing the keys, along with the usual glue to provide a C interface. The split of _get_config into two functions is to allow returning of the return value with different memory ownership semantics.
2016-05-13lib/cli: add library API / CLI for compile time optionsDavid Bremner
This is intentionally low tech; if we have more than two options it may make sense to build up what infrastructure is provided.
2016-03-14lib: NOTMUCH_DEPRECATED macro also for older compilersTomi Ollila
Some compilers (older than gcc 4.5 and clang 2.9) do support __attribute__ ((deprecated)) but not __attribute__ ((deprecated("message"))). Check if clang version is at least 3.0, or gcc version is at least 4.5 to define NOTMUCH_DEPRECATED as the latter variant above. Otherwise define NOTMUCH_DEPRECATED as the former variant above. For a bit simpler implementation clang 2.9 is not included to use the newer variant. It is just one release, and the older one works fine. Clang 3.0 was released around 2011-11 and gcc 5.1 2015-04-22 (therefore newer macro for gcc 4.5+)
2015-10-27Documentation: fix type name spellingSteven Allen
2015-10-10lib: add interface to delete directory documentsJani Nikula
As mentioned in acd66cdec075312944e527febd46382e54d99367 we don't have an interface to delete directory documents, and they're left behind. Add the interface.
2015-10-05lib: update doxygen comments to add @since for the new _st APIDavid Bremner
We should probably to this for all new functions introduced from now on.
2015-10-05lib: add versions of n_q_count_{message,threads} with status returnDavid Bremner
Although I think it's a pretty bad idea to continue using the old API, this allows both a more gentle transition for clients of the library, and allows us to break one monolithic change into a series
2015-09-23lib: constify arguments to notmuch_query_get_*David Bremner
These functions are all just accessors, and it's pretty clear they don't modify the query struct. This also fixes one warning I created when I introduced status.c.
2015-09-04lib: constify argument to notmuch_database_status_stringDavid Bremner
We don't modify the database struct, so no harm in committing to that.
2015-08-13lib: API to retrieve database revision and UUIDAustin Clements
This exposes the committed database revision to library users along with a UUID that can be used to detect when revision numbers are no longer comparable (e.g., because the database has been replaced).
2015-08-10build: extract library versions from notmuch.hDavid Bremner
- Make lib/notmuch.h the canonical location for the library versioning information. - Since the release-check should never fail now, remove it to reduce complexity. - Make the version numbers in notmuch.h consistent with the (now deleted) ones in lib/Makefile.local
2015-08-04lib: add public accessor for database from queryDavid Bremner
This is to make it easier for clients of the library to update to the new error code returning versions of notmuch_query_search_messages
2015-08-04lib: deprecate notmuch_query_search_{threads, messages}David Bremner
The CLI (and bindings) code should really be updated to use the new status-code-returning versions. Here are some warnings to prod us (and other clients) to do so.
2015-08-04lib: define NOTMUCH_DEPRECATED macro, document its use.David Bremner
This has been tested with gcc and clang.
2015-06-12lib: add NOTMUCH_STATUS_PATH_ERRORDavid Bremner
The difference with FILE_ERROR is that this is for things that are wrong with the path before looking at the disk. Add some 3 tests; two broken as a reminder to actually use this new code.
2015-03-29lib: add a log function with output to a string in notmuch_database_tDavid Bremner
In principle in the future this could do something fancier than asprintf.
2015-03-29lib: add "verbose" versions of notmuch_database_{open,create}David Bremner
The compatibility wrapper ensures that clients calling notmuch_database_open will receive consistent output for now. The changes to notmuch-{new,search} and test/symbol-test are just to make the test suite pass. The use of IGNORE_RESULT is justified by two things. 1) I don't know what else to do. 2) asprintf guarantees the output string is NULL if an error occurs, so at least we are not passing garbage back.
2015-03-13lib: make notmuch_query_count_messages explicitely exactJani Nikula
The default is actually exact if no checkatleast parameter is specified. This change makes that explicit, mainly for documentation, but also to be safe in the unlikely event of a change of default. [ commit message rewritten by db based on id:87lho0nlkk.fsf@nikula.org ]
2015-03-07lib: bump library minor versionDavid Bremner
This should have happened in commit 326e18856, but it didn't.
2015-03-01lib: add new status reporting API for notmuch_query_search_{m,t}David Bremner
This at least allows distinguishing between out of memory and Xapian exceptions. Adding finer grained status codes would allow different Xapian exceptions to be preserved. Adding wrappers allows people to transition gradually to the new API, at the cost of bloating the library API a bit.
2014-11-06lib: bump LIBNOTMUCH_MAJOR_VERSION to 4David Bremner
This should have been done at the same time as the SONAME bump.
2014-10-25lib: Internal support for querying and creating ghost messagesAustin Clements
This updates the message abstraction to support ghost messages: it adds a message flag that distinguishes regular messages from ghost messages, and an internal function for initializing a newly created (blank) message as a ghost message.
2014-10-03lib: Simplify close and codify aborting atomic sectionAustin Clements
In Xapian, closing a database implicitly aborts any outstanding transaction and commits changes. For historical reasons, notmuch_database_close had grown to almost, but not quite duplicate this behavior. Before closing the database, it would explicitly (and unnecessarily) commit it. However, if there was an outstanding transaction (ie atomic section), commit would throw a Xapian exception, which notmuch_database_close would unnecessarily print to stderr, even though notmuch_database_close would ultimately abort the transaction anyway when it called close. This patch simplifies notmuch_database_close to explicitly abort any outstanding transaction and then just call Database::close. This works for both read-only and read/write databases, takes care of committing changes, unifies the exception handling path, and codifies aborting outstanding transactions. This is currently the only way to abort an atomic section (and may remain so, since it would be difficult to roll back things we may have cached from rolled-back modifications).
2014-09-13notmuch_thread_get_authors: document match grouping with |Gaute Hope
as stated in thread.cc:115 /* Construct an authors string from matched_authors_array and * authors_array. The string contains matched authors first, then * non-matched authors (with the two groups separated by '|'). Within * each group, authors are listed in date order. */ this is, however, not reflected in the public API documentation in notmuch.h:970. This patch a paragraph explaining how | separates the group of authors of messages matching the query and those of messages that do not, but are still contained in the thread.
2014-08-30lib: Update doc of notmuch_database_{needs_upgrade,upgrade}Austin Clements
Clients are no longer required to call these functions after opening a database in read/write mode (which is good, because almost none of them do!).
2014-08-30lib: Return an error from operations that require an upgradeAustin Clements
Previously, there was no protection against a caller invoking an operation on an old database version that would effectively corrupt the database by treating it like a newer version. According to notmuch.h, any caller that opens the database in read/write mode is supposed to check if the database needs upgrading and perform an upgrade if it does. This would protect against this, but nobody (even the CLI) actually does this. However, with features, it's easy to protect against incompatible operations on a fine-grained basis. This lightweight change allows callers to safely operate on old database versions, while preventing specific operations that would corrupt the database with an informative error message.
2014-07-09lib: add return status to database close and destroyJani Nikula
notmuch_database_close may fail in Xapian ->flush() or ->close(), so report the status. Similarly for notmuch_database_destroy which calls close. This is required for notmuch insert to report error status if message indexing failed.
2014-02-13doc: notmuch_result_move_to_next -> notmuch_tags_move_to_nextGaute Hope
Fix typo in docs.
2014-01-26lib: update documentation for notmuch_database_get_directoryDavid Bremner
Clarify that using the directory after destroying the corresponding database is not permitted. This is implicit in the description of notmuch_database_destroy, but it doesn't hurt to be explicit, and we do express similar "ownership" relationships at other places in the docs.
2014-01-24lib: make notmuch_threads_valid return FALSE when passed NULLDavid Bremner
Without this patch, the example code in the header docs crashes for certain invalid queries (see id:871u00oimv.fsf@approx.mit.edu)
2014-01-05lib: modify notmuch.h for automatic document generationJani Nikula
Minimal changes to produce a sensible result.
2013-12-07lib: Bump library version from 3.0.0 to 3.1.0Austin Clements
This version of the library introduces LIBNOTMUCH_CHECK_VERSION and the *_VERSION macros. Bumping the version number is also necessary to make the comment on LIBNOTMUCH_CHECK_VERSION no longer a lie.
2013-12-07lib: Replace NOTMUCH_*_VERSION with LIBNOTMUCH_*_VERSIONAustin Clements
This makes it clear that these macros refer to the *library* version, and not to the notmuch application-level release. Since there are no consumers of these macros yet, this is now or never.
2013-12-07lib: Make VERSION macros agree with soname versionAustin Clements
We have two distinct "library version" numbers: the soname version and the version macros. We need both for different reasons: the version macros enable easy compile-time version detection (and conditional compilation), while the soname version enables runtime version detection (which includes the version checking done by things like the Python bindings). However, currently, these two version numbers are different, which is unnecessary and can lead to confusion (especially in things like Debian, which include the soname version in the package name). This patch makes them the same by bumping the version macros up to agree with the soname version. (We should probably keep the version number in just one place so they can't get out of sync, but that can be done in another patch.)
2013-11-08lib: Document extent of some return valuesAustin Clements
This documents the extent of the notmuch_messages_t* pointers returned by notmuch_thread_get_toplevel_messages and notmuch_thread_get_messages.
2013-11-07lib: add library version check macroJani Nikula
There have been some plans for making build incompatible changes to the library API. This is inconvenient, but it is much more so without a way to easily conditional build against multiple versions of notmuch. The macro has been lifted from glib.