add _attachment_save

This commit is contained in:
Sebastian Ramacher 2012-01-13 18:25:17 +01:00
parent 33173e018e
commit 82501190af
2 changed files with 21 additions and 6 deletions

View file

@ -386,10 +386,18 @@ zathura_document_attachments_get(zathura_document_t* document)
return document->functions.document_attachments_get(document);
}
bool
zathura_document_attachments_free(girara_list_t* UNUSED(list))
bool zathura_document_attachment_save(zathura_document_t* document, const char* attachment, const char* file)
{
return false;
if (document == NULL) {
return NULL;
}
if (document->functions.document_attachment_save == NULL) {
girara_error("%s not implemented", __FUNCTION__);
return NULL;
}
return document->functions.document_attachment_save(document, attachment, file);
}
char*

View file

@ -195,6 +195,11 @@ struct zathura_document_s
*/
girara_list_t* (*document_attachments_get)(zathura_document_t* document);
/**
* Save attachment to a file
*/
bool (*document_attachment_save)(zathura_document_t* document, const char* attachment, const char* file);
/**
* Get document information
*/
@ -302,10 +307,12 @@ girara_list_t* zathura_document_attachments_get(zathura_document_t* document);
/**
* Free document attachments
*
* @param list list of document attachments
* @return
* @param document The document objects
* @param attachment name of the attachment
* @param file the target filename
* @return true on success, false otherwise
*/
bool zathura_document_attachments_free(girara_list_t* list);
bool zathura_document_attachment_save(zathura_document_t* document, const char* attachment, const char* file);
/**
* Returns a string of the requested information