mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 18:36:00 +01:00
add _attachment_save
This commit is contained in:
parent
33173e018e
commit
82501190af
2 changed files with 21 additions and 6 deletions
14
document.c
14
document.c
|
@ -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*
|
||||
|
|
13
document.h
13
document.h
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue