Function notmuch_sys::notmuch_database_add_message [] [src]

pub unsafe extern "C" fn notmuch_database_add_message(
    database: *mut notmuch_database_t,
    filename: *const c_char,
    message: *mut *mut notmuch_message_t
) -> notmuch_status_t

Add a new message to the given notmuch database or associate an additional filename with an existing message.

Here, 'filename' should be a path relative to the path of 'database' (see notmuch_database_get_path), or else should be an absolute filename with initial components that match the path of 'database'.

The file should be a single mail message (not a multi-message mbox) that is expected to remain at its current location, (since the notmuch database will reference the filename, and will not copy the entire contents of the file.

If another message with the same message ID already exists in the database, rather than creating a new message, this adds 'filename' to the list of the filenames for the existing message.

If 'message' is not NULL, then, on successful return (notmuch_status_t::SUCCESS or notmuch_status_t::DUPLICATE_MESSAGE_ID) '*message' will be initialized to a message object that can be used for things such as adding tags to the just-added message. The user should call notmuch_message_destroy when done with the message. On any failure '*message' will be set to NULL.

Return value: