aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/filenames.c
Commit message (Collapse)AuthorAge
* lib: fix NULL checks for filenames iteratorsGravatar Sascha Silbe2012-09-01
| | | | | | | | The API documentation (notmuch.h) states that the parameter may be NULL, but the implementation only checked the current element, potentially dereferencing a NULL pointer in the process. Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
* Implement an internal generic string list and use it.Gravatar Austin Clements2011-03-21
| | | | | | | | | | | | This replaces the guts of the filename list and tag list, making those interfaces simple iterators over the generic string list. The directory, message filename, and tags-related code now build generic string lists and then wraps them in specific iterators. The real wins come in later patches, when we use these for even more generic functionality. As a nice side-effect, this also eliminates the annoying dependency on GList in the tag list.
* notmuch_filenames_create: Take a reference to underlying filename listGravatar Carl Worth2010-11-11
| | | | | The notmuch_filenames_t object might easily outlive the original object owning the filename list. So take a talloc reference to keep things safe.
* lib: Add new, public notmuch_message_get_filenamesGravatar Carl Worth2010-11-11
| | | | | | | | | | | | | | | | | | This augments the existing notmuch_message_get_filename by allowing the caller access to all filenames in the case of multiple files for a single message. To support this, we split the iterator (notmuch_filenames_t) away from the list storage (notmuch_filename_list_t) where previously these were a single object (notmuch_filenames_t). Then, whenever the user asks for a file or filename, the message object lazily creates a complete notmuch_filename_list_t and then: For notmuch_message_get_filename, returns the first filename in the list. For notmuch_message_get_filenames, creates and returns a new iterator for the filename list.
* lib: Add new implementation of notmuch_filenames_tGravatar Carl Worth2010-11-11
The new implementation is simply a talloc-based list of strings. The former support (a list of database terms with a common prefix) is implemented by simply pre-iterating over the terms and populating the list. This should provide no performance disadvantage as callers of thigns like notmuch_directory_get_child_files are very likely to always iterate over all filenames anyway. This new implementation of notmuch_filenames_t is in preparation for adding API to query all of the filenames for a single message.