X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.h;h=f568bc0a2da3458fad66b6b13f03d7fadb267f24;hp=02c743aa60b192ffd398d94a0b027006957c3910;hb=ce5d78296251b529838df0dbd4dc3b9a90030924;hpb=defd216487bb6549d6e866fe578d2c3d3de77fd6 diff --git a/notmuch.h b/notmuch.h index 02c743aa..f568bc0a 100644 --- a/notmuch.h +++ b/notmuch.h @@ -49,8 +49,16 @@ typedef int notmuch_bool_t; * * NOTMUCH_STATUS_SUCCESS: No error occurred. * + * XXX: We don't really want to expose this lame XAPIAN_EXCEPTION + * value. Instead we should map to things like DATABASE_LOCKED or + * whatever. + * * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred * + * NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to read or + * write to a file (this could be file not found, permission + * denied, etc.) + * * NOTMUCH_STATUS_FILE_NOT_EMAIL: A file was presented that doesn't * appear to be an email message. * @@ -65,6 +73,7 @@ typedef int notmuch_bool_t; typedef enum _notmuch_status { NOTMUCH_STATUS_SUCCESS = 0, NOTMUCH_STATUS_XAPIAN_EXCEPTION, + NOTMUCH_STATUS_FILE_ERROR, NOTMUCH_STATUS_FILE_NOT_EMAIL, NOTMUCH_STATUS_NULL_POINTER, NOTMUCH_STATUS_TAG_TOO_LONG, @@ -72,6 +81,13 @@ typedef enum _notmuch_status { NOTMUCH_STATUS_LAST_STATUS } notmuch_status_t; +/* Get a string representation of a notmuch_status_t value. + * + * The result is readonly. + */ +const char * +notmuch_status_to_string (notmuch_status_t status); + /* Various opaque data types. For each notmuch__t see the various * notmuch_ functions below. */ typedef struct _notmuch_database notmuch_database_t; @@ -169,6 +185,10 @@ notmuch_database_get_path (notmuch_database_t *database); * * NOTMUCH_STATUS_SUCCESS: Message successfully added to database. * + * NOTMUCH_STATUS_FILE_ERROR: an error occurred trying to open the + * file, (such as permission denied, or file not found, + * etc.). Nothing added to the database. + * * NOTMUCH_STATUS_FILE_NOT_EMAIL: the contents of filename don't look * like an email message. Nothing added to the database. */ @@ -318,10 +338,21 @@ notmuch_results_destroy (notmuch_results_t *results); * modified by the caller and will only be valid for as long as the * message is valid, (which is until the query from which it derived * is destroyed). + * + * This function will not return NULL since Notmuch ensures that every + * message has a unique message ID, (Notmuch will generate an ID for a + * message if the original file does not contain one). */ const char * notmuch_message_get_message_id (notmuch_message_t *message); +/* Get this filename for the email corresponding to 'message'. + * + * The returned filename is relative to the base of the database from + * which 'message' was obtained. See notmuch_database_get_path() .*/ +const char * +notmuch_message_get_filename (notmuch_message_t *message); + /* Get the tags for 'message', returning a notmuch_tags_t object which * can be used to iterate over all tags. *