notmuch_bool_t
notmuch_filenames_has_more (notmuch_filenames_t *filenames)
{
+ if (filenames == NULL)
+ return NULL;
+
return (filenames->iterator != filenames->end);
}
const char *
notmuch_filenames_get (notmuch_filenames_t *filenames)
{
+ if (filenames == NULL || filenames->iterator == filenames->end)
+ return NULL;
+
if (filenames->filename == NULL) {
std::string term = *filenames->iterator;
void
notmuch_filenames_advance (notmuch_filenames_t *filenames)
{
+ if (filenames == NULL)
+ return;
+
if (filenames->filename) {
talloc_free (filenames->filename);
filenames->filename = NULL;
void
notmuch_filenames_destroy (notmuch_filenames_t *filenames)
{
+ if (filenames == NULL)
+ return;
+
talloc_free (filenames);
}
* When this function returns TRUE, notmuch_filenames_get will return
* a valid string. Whereas when this function returns FALSE,
* notmuch_filenames_get will return NULL.
+ *
+ * It is acceptable to pass NULL for 'filenames', in which case this
+ * function will always return FALSE.
*/
notmuch_bool_t
notmuch_filenames_has_more (notmuch_filenames_t *filenames);
*
* Note: The returned string belongs to 'filenames' and has a lifetime
* identical to it (and the directory to which it ultimately belongs).
+ *
+ * It is acceptable to pass NULL for 'filenames', in which case this
+ * function will always return NULL.
*/
const char *
notmuch_filenames_get (notmuch_filenames_t *filenames);
/* Advance the 'filenames' iterator to the next filename.
+ *
+ * It is acceptable to pass NULL for 'filenames', in which case this
+ * function will do nothing.
*/
void
notmuch_filenames_advance (notmuch_filenames_t *filenames);
* It's not strictly necessary to call this function. All memory from
* the notmuch_filenames_t object will be reclaimed when the
* containing directory object is destroyed.
+ *
+ * It is acceptable to pass NULL for 'filenames', in which case this
+ * function will do nothing.
*/
void
notmuch_filenames_destroy (notmuch_filenames_t *filenames);