mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-21 21:35:30 +01:00
Switch return value and error argument
This commit is contained in:
parent
afdfb6b476
commit
00c9a6e683
2 changed files with 6 additions and 14 deletions
|
@ -413,15 +413,7 @@ zathura_page_get_label(zathura_page_t* page, zathura_error_t* error)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
girara_list_t* zathura_page_get_signatures(zathura_page_t* page, zathura_error_t* error) {
|
||||||
sig_free(void* sig)
|
|
||||||
{
|
|
||||||
zathura_signature_info_free(sig);
|
|
||||||
}
|
|
||||||
|
|
||||||
girara_list_t*
|
|
||||||
zathura_page_get_signatures(zathura_page_t* page, zathura_error_t* error)
|
|
||||||
{
|
|
||||||
if (page == NULL || page->document == NULL) {
|
if (page == NULL || page->document == NULL) {
|
||||||
if (error) {
|
if (error) {
|
||||||
*error = ZATHURA_ERROR_INVALID_ARGUMENTS;
|
*error = ZATHURA_ERROR_INVALID_ARGUMENTS;
|
||||||
|
@ -429,7 +421,7 @@ zathura_page_get_signatures(zathura_page_t* page, zathura_error_t* error)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
zathura_plugin_t* plugin = zathura_document_get_plugin(page->document);
|
zathura_plugin_t* plugin = zathura_document_get_plugin(page->document);
|
||||||
const zathura_plugin_functions_t* functions = zathura_plugin_get_functions(plugin);
|
const zathura_plugin_functions_t* functions = zathura_plugin_get_functions(plugin);
|
||||||
if (functions->page_get_signatures == NULL) {
|
if (functions->page_get_signatures == NULL) {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -438,8 +430,8 @@ zathura_page_get_signatures(zathura_page_t* page, zathura_error_t* error)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
girara_list_t* ret = girara_list_new2(sig_free);
|
zathura_error_t e = ZATHURA_ERROR_OK;
|
||||||
zathura_error_t e = functions->page_get_signatures(page, page->data, ret);
|
girara_list_t* ret = functions->page_get_signatures(page, page->data, &e);
|
||||||
if (e != ZATHURA_ERROR_OK) {
|
if (e != ZATHURA_ERROR_OK) {
|
||||||
if (error) {
|
if (error) {
|
||||||
*error = e;
|
*error = e;
|
||||||
|
|
|
@ -111,7 +111,7 @@ typedef zathura_error_t (*zathura_plugin_page_get_label_t)(zathura_page_t* page,
|
||||||
/**
|
/**
|
||||||
* Get signatures
|
* Get signatures
|
||||||
*/
|
*/
|
||||||
typedef zathura_error_t (*zathura_plugin_page_get_signatures)(zathura_page_t* page, void* data, girara_list_t*);
|
typedef girara_list_t* (*zathura_plugin_page_get_signatures)(zathura_page_t* page, void* data, zathura_error_t* error);
|
||||||
|
|
||||||
struct zathura_plugin_functions_s
|
struct zathura_plugin_functions_s
|
||||||
{
|
{
|
||||||
|
@ -219,7 +219,7 @@ struct zathura_plugin_functions_s
|
||||||
typedef struct zathura_plugin_version_s {
|
typedef struct zathura_plugin_version_s {
|
||||||
unsigned int major; /**< Major */
|
unsigned int major; /**< Major */
|
||||||
unsigned int minor; /**< Minor */
|
unsigned int minor; /**< Minor */
|
||||||
unsigned int rev; /**< Revision */
|
unsigned int rev; /**< Revision */
|
||||||
} zathura_plugin_version_t;
|
} zathura_plugin_version_t;
|
||||||
|
|
||||||
typedef struct zathura_plugin_definition_s {
|
typedef struct zathura_plugin_definition_s {
|
||||||
|
|
Loading…
Add table
Reference in a new issue