<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/bindings/ruby/database.c, branch nmweb</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=nmweb</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=nmweb'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2023-05-29T10:51:02Z</updated>
<entry>
<title>ruby: db: reorganize initializer</title>
<updated>2023-05-29T10:51:02Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2023-03-31T20:40:50Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=95a4bf38173311597bcc4fa7f597d58bb11ed119'/>
<id>urn:sha1:95a4bf38173311597bcc4fa7f597d58bb11ed119</id>
<content type='text'>
In order to make it more extensible.

No functional changes.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: add tags helper</title>
<updated>2023-04-02T22:00:49Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2023-03-22T23:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=ae1336dea5cc6a221699fff260d8b44cee677f77'/>
<id>urn:sha1:ae1336dea5cc6a221699fff260d8b44cee677f77</id>
<content type='text'>
Right now it doesn't do much, but it will help for further
reorganization.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: database: make path arg optional</title>
<updated>2023-03-31T10:56:03Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2023-03-23T02:05:23Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=4152e1bc20fa2803186740c76579b495f4c77fb6'/>
<id>urn:sha1:4152e1bc20fa2803186740c76579b495f4c77fb6</id>
<content type='text'>
It can be automatically loaded from the configuration now.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: use database_open_with_config</title>
<updated>2023-03-31T10:53:00Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2023-03-23T02:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=83ea220178f771bf5a4f6e2f4fe3a3dd2e96676e'/>
<id>urn:sha1:83ea220178f771bf5a4f6e2f4fe3a3dd2e96676e</id>
<content type='text'>
Fixes warning:

  warning: ‘notmuch_database_open’ is deprecated: function deprecated as of libnotmuch 5.4

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: split database close and destroy</title>
<updated>2021-08-02T16:49:29Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-07-07T03:45:32Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7415b53fa568a3156ae3e3a47544a4784e024653'/>
<id>urn:sha1:7415b53fa568a3156ae3e3a47544a4784e024653</id>
<content type='text'>
Mirrors the C API: 7864350c (Split notmuch_database_close into two
functions, 2012-04-25).

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: enable garbage collection using talloc</title>
<updated>2021-07-18T20:08:53Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-17T19:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=1a7f9fe055fb40b9646bb8efac107601009723bd'/>
<id>urn:sha1:1a7f9fe055fb40b9646bb8efac107601009723bd</id>
<content type='text'>
We basically steal all the objects from their notmuch parents, therefore
they are completely under Ruby's gc control.

The order at which these objects are freed does not matter any more,
because destroying the database does not destroy all the children
objects, since they belong to Ruby now.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: create an actual wrapper struct</title>
<updated>2021-07-18T20:08:42Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-17T19:39:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=02b162116079a0b2e35823e5590a82056d22c8af'/>
<id>urn:sha1:02b162116079a0b2e35823e5590a82056d22c8af</id>
<content type='text'>
Currently Ruby data points directly to a notmuch object (e.g.
notmuch_database_t), since we don't need any extra data that is fine.

However, in the next commit we will need extra data, therefore we create
a new struct notmuch_rb_object_t wrapper which contains nothing but a
pointer to the current pointer (e.g. notmuch_database_t).

This struct is tied to the Ruby object, and is freed when the Ruby
object is freed by the garbage collector.

We do nothing with this wrapper, so no functionality should be changed.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: add keyword arguments to db.query</title>
<updated>2021-06-27T17:13:03Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-24T02:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=814abafc3e4280de115d4bc0ac01f8d026a0a7f9'/>
<id>urn:sha1:814abafc3e4280de115d4bc0ac01f8d026a0a7f9</id>
<content type='text'>
That way we don't need pass them to the query object ourselves.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: new notmuch_rb_object_destroy() helper</title>
<updated>2021-05-17T10:25:14Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-15T21:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5f49e3421f5d1f98951b55dd5ba106c2a106aba7'/>
<id>urn:sha1:5f49e3421f5d1f98951b55dd5ba106c2a106aba7</id>
<content type='text'>
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-&gt;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 &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: add all data types</title>
<updated>2021-05-17T10:25:14Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-15T21:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9574fb60991fa81799fbd1d26d41693ca2794e6b'/>
<id>urn:sha1:9574fb60991fa81799fbd1d26d41693ca2794e6b</id>
<content type='text'>
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
</feed>
