summaryrefslogtreecommitdiff
path: root/bindings/ruby/query.c
AgeCommit message (Collapse)Author
2023-05-25ruby: query: fix get sortFelipe Contreras
The order was wrong, right now `query.sort` doesn't return a number. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-23ruby: use notmuch_exclude_t enumFelipe Contreras
It exists since 2013, let's allow it to be used in Ruby. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: new notmuch_rb_object_destroy() helperFelipe Contreras
The struct used to store the types (rb_data_type_t) contains a "data" field where we can store whatever we want. I use that field to store a pointer to the corresponding destroy function. For example notmuch_rb_database_type contains a pointer to notmuch_database_destroy. I cast that pointer as a notmuch_status_t (func*)(void *) and call that function passing the internal object (e.g. notmuch_database_t). Using the rb_data_type_t data we can call the correct notmuch destroy function. Therefore this: ret = ((notmuch_status_t (*)(void *)) type->data) (nm_object); Is effectively the same as this: ret = notmuch_database_destroy (database); The advantage of doing it this way is that much less code is necesary since each rb_data_type_t has the corresponding destroy function stored in it. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: add all data typesFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17ruby: create Data_Wrap_Notmuch_Object helperFelipe Contreras
This makes the code more maintainable and will help in further patches. No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
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.
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.
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.
2015-10-05ruby: use new query_search APIDavid Bremner
These changes should not be too surprising for users because the routines were already potentially throwing exceptions.
2015-10-05ruby: use new count APIDavid Bremner
This change of replacing ignoring errors with exceptions is intended, and indeed one of the main motivations for the libnotmuch API changes.
2014-05-18ruby: Add wrapper for notmuch_query_count_threadsWael M. Nasreddine
2013-05-23ruby: fix missing symbol UINT2FIX()Felipe Contreras
It has never existed in Ruby (maybe JRuby). Fortunately the symbols are loaded lazily, so nobody would notice unless they try 'query::count_messages'. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2012-05-08ruby: Add wrapper for notmuch_query_set_omit_excluded()Ali Polatel
2012-05-08ruby: Add wrapper for notmuch_query_add_tag_excludeAli Polatel
2012-05-08ruby: Add wrapper for notmuch_query_count_messagesAli Polatel
2011-10-04ruby: be consistent with notmuch's coding styleAli Polatel
No functional change, just indentation
2011-09-24ruby: Rename destroy to destroy!Ali Polatel
According to the common Ruby function naming convention, potentially dangerous functions or functions which operate on the object itself are suffixed with an exclamation mark. Both of these are true for object destroying functions. The following modules are affected: - Notmuch::Directory - Notmuch::FileNames - Notmuch::Query - Notmuch::Threads - Notmuch::Thread - Notmuch::Messages - Notmuch::Message - Notmuch::Tags
2011-01-25ruby: Add wrappers for query_get_s{ort,tring}Ali Polatel
New wrappers: notmuch_query_get_sort(): QUERY.sort notmuch_query_get_query_string(): QUERY.to_s
2010-06-06ruby: Don't barf if an object is destroyed more than onceAli Polatel
Raise RuntimeError instead. Also revise Notmuch::Database a bit. Add Notmuch::Database.open singleton method.
2010-06-06ruby: Kill garbage collection related cruft.Ali Polatel
Let the user destroy objects that she wants explicitly. It's not possible to specify the order objects are garbage collected. See id:86y6f8v838.fsf@harikalardiyari.ev on ruby-talk for more information.
2010-06-06Initial ruby bindingsAli Polatel