From 69e693b437125e93c8dad216c7af402aa66e2d48 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Mon, 2 Sep 2019 17:34:18 +0200
Subject: [PATCH] Fix 'Kbanking plugin crashes on opening aqbanking settings'

The crash is caused by missing GWENHYWFAR_CB definitions of the corresponding callback functions.
See https://bugs.kde.org/show_bug.cgi?id=380119

---
 src/base/idmap_p.h        | 22 ++++++-------
 src/base/refptr.h         |  4 +--
 src/crypt3/mdigest_be.h   | 10 +++---
 src/gui/gui_be.h          | 79 +++++++++++++++++++++++------------------------
 src/parser/configmgr_be.h | 66 +++++++++++++++++++--------------------
 src/parser/xmlctx.h       | 20 ++++++------
 src/parser/xsdnode_l.h    | 12 +++----
 7 files changed, 106 insertions(+), 107 deletions(-)

diff --git a/src/base/idmap_p.h b/src/base/idmap_p.h
index 6fcd491..1100a39 100644
--- a/src/base/idmap_p.h
+++ b/src/base/idmap_p.h
@@ -31,21 +31,21 @@
 #include "idmap.h"
 
 
-typedef GWEN_IDMAP_RESULT (*GWEN_IDMAP_SETPAIR_FN)(GWEN_IDMAP *map,
-    uint32_t id,
-    void *ptr);
-typedef void* (*GWEN_IDMAP_GETPAIR_FN)(GWEN_IDMAP *map,
-                                       uint32_t id);
+typedef GWEN_IDMAP_RESULT GWENHYWFAR_CB (*GWEN_IDMAP_SETPAIR_FN)(GWEN_IDMAP *map,
+                                                                 uint32_t id,
+                                                                 void *ptr);
+typedef void* GWENHYWFAR_CB (*GWEN_IDMAP_GETPAIR_FN)(GWEN_IDMAP *map,
+                                                     uint32_t id);
 
-typedef GWEN_IDMAP_RESULT (*GWEN_IDMAP_FINDFIRST_FN)(const GWEN_IDMAP *map,
-    uint32_t *pid);
-typedef GWEN_IDMAP_RESULT (*GWEN_IDMAP_FINDNEXT_FN)(const GWEN_IDMAP *map,
-    uint32_t *pid);
+typedef GWEN_IDMAP_RESULT GWENHYWFAR_CB (*GWEN_IDMAP_FINDFIRST_FN)(const GWEN_IDMAP *map,
+                                                                   uint32_t *pid);
+typedef GWEN_IDMAP_RESULT GWENHYWFAR_CB (*GWEN_IDMAP_FINDNEXT_FN)(const GWEN_IDMAP *map,
+                                                                  uint32_t *pid);
 
-typedef void (*GWEN_IDMAP_DUMP_FN)(GWEN_IDMAP *map, FILE *f, int indent);
+typedef void GWENHYWFAR_CB (*GWEN_IDMAP_DUMP_FN)(GWEN_IDMAP *map, FILE *f, int indent);
 
 
-typedef void (*GWEN_IDMAP_FREEDATA_FN)(GWEN_IDMAP *map);
+typedef void GWENHYWFAR_CB (*GWEN_IDMAP_FREEDATA_FN)(GWEN_IDMAP *map);
 
 
 struct GWEN_IDMAP {
diff --git a/src/base/refptr.h b/src/base/refptr.h
index 3e30d33..6f4b65f 100644
--- a/src/base/refptr.h
+++ b/src/base/refptr.h
@@ -148,8 +148,8 @@ void GWEN_RefPtrInfo_DelFlags(GWEN_REFPTR_INFO *rpi, uint32_t fl);
  *
  */
 /*@{*/
-typedef void (*GWEN_REFPTR_INFO_FREE_FN)(void *dp);
-typedef void* (*GWEN_REFPTR_INFO_DUP_FN)(void *dp);
+typedef void GWENHYWFAR_CB (*GWEN_REFPTR_INFO_FREE_FN)(void *dp);
+typedef void* GWENHYWFAR_CB (*GWEN_REFPTR_INFO_DUP_FN)(void *dp);
 /*@}*/
 
 
diff --git a/src/crypt3/mdigest_be.h b/src/crypt3/mdigest_be.h
index deb2c78..d3fb9ef 100644
--- a/src/crypt3/mdigest_be.h
+++ b/src/crypt3/mdigest_be.h
@@ -21,11 +21,11 @@
 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_MDIGEST, GWENHYWFAR_API)
 
 
-typedef int (*GWEN_MDIGEST_BEGIN_FN)(GWEN_MDIGEST *md);
-typedef int (*GWEN_MDIGEST_END_FN)(GWEN_MDIGEST *md);
-typedef int (*GWEN_MDIGEST_UPDATE_FN)(GWEN_MDIGEST *md,
-                                      const uint8_t *buf,
-                                      unsigned int l);
+typedef int GWENHYWFAR_CB (*GWEN_MDIGEST_BEGIN_FN)(GWEN_MDIGEST *md);
+typedef int GWENHYWFAR_CB (*GWEN_MDIGEST_END_FN)(GWEN_MDIGEST *md);
+typedef int GWENHYWFAR_CB (*GWEN_MDIGEST_UPDATE_FN)(GWEN_MDIGEST *md,
+                                                    const uint8_t *buf,
+                                                    unsigned int l);
 
 
 GWENHYWFAR_API
diff --git a/src/gui/gui_be.h b/src/gui/gui_be.h
index 5bfe2ff..942cbfa 100644
--- a/src/gui/gui_be.h
+++ b/src/gui/gui_be.h
@@ -344,85 +344,84 @@ GWEN_GUI_GETSYNCIO_FN GWEN_Gui_SetGetSyncIoFn(GWEN_GUI *gui, GWEN_GUI_GETSYNCIO_
  * Please see @ref GWEN_Gui_MessageBox for details.
  *
  */
-typedef int (*GWEN_GUI_MESSAGEBOX_FN)(GWEN_GUI *gui,
-                                      uint32_t flags,
-                                      const char *title,
-                                      const char *text,
-                                      const char *b1,
-                                      const char *b2,
-                                      const char *b3,
-                                      uint32_t guiid);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_MESSAGEBOX_FN)(GWEN_GUI *gui,
+                                                    uint32_t flags,
+                                                    const char *title,
+                                                    const char *text,
+                                                    const char *b1,
+                                                    const char *b2,
+                                                    const char *b3,
+                                                    uint32_t guiid);
 
 /**
  * Please see @ref GWEN_Gui_InputBox for details.
  *
  */
-typedef int (*GWEN_GUI_INPUTBOX_FN)(GWEN_GUI *gui,
-                                    uint32_t flags,
-                                    const char *title,
-                                    const char *text,
-                                    char *buffer,
-                                    int minLen,
-                                    int maxLen,
-                                    uint32_t guiid);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_INPUTBOX_FN)(GWEN_GUI *gui,
+                                                  uint32_t flags,
+                                                  const char *title,
+                                                  const char *text,
+                                                  char *buffer,
+                                                  int minLen,
+                                                  int maxLen,
+                                                  uint32_t guiid);
 
 /**
  * Please see @ref GWEN_Gui_ShowBox for details.
  *
  */
-typedef uint32_t (*GWEN_GUI_SHOWBOX_FN)(GWEN_GUI *gui,
-                                        uint32_t flags,
-                                        const char *title,
-                                        const char *text,
-                                        uint32_t guiid);
+typedef uint32_t GWENHYWFAR_CB (*GWEN_GUI_SHOWBOX_FN)(GWEN_GUI *gui,
+                                                      uint32_t flags,
+                                                      const char *title,
+                                                      const char *text,
+                                                      uint32_t guiid);
 
 /**
  * Please see @ref GWEN_Gui_HideBox for details.
  *
  */
-typedef void (*GWEN_GUI_HIDEBOX_FN)(GWEN_GUI *gui, uint32_t id);
+typedef void GWENHYWFAR_CB (*GWEN_GUI_HIDEBOX_FN)(GWEN_GUI *gui, uint32_t id);
 
 /**
  * Please see @ref GWEN_Gui_ProgressStart for details.
  *
  */
-typedef uint32_t (*GWEN_GUI_PROGRESS_START_FN)(GWEN_GUI *gui,
-					       uint32_t progressFlags,
-					       const char *title,
-					       const char *text,
-					       uint64_t total,
-					       uint32_t guiid);
-
+typedef uint32_t GWENHYWFAR_CB (*GWEN_GUI_PROGRESS_START_FN)(GWEN_GUI *gui,
+                                                             uint32_t progressFlags,
+                                                             const char *title,
+                                                             const char *text,
+                                                             uint64_t total,
+                                                             uint32_t guiid);
 /**
  * Please see @ref GWEN_Gui_ProgressAdvance for details.
  *
  */
-typedef int (*GWEN_GUI_PROGRESS_ADVANCE_FN)(GWEN_GUI *gui,
-					    uint32_t id,
-					    uint64_t progress);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_PROGRESS_ADVANCE_FN)(GWEN_GUI *gui,
+                                                          uint32_t id,
+                                                          uint64_t progress);
 
 
 /**
  * Please see @ref GWEN_Gui_ProgressSetTotal for details.
  *
  */
-typedef int (*GWEN_GUI_PROGRESS_SETTOTAL_FN)(GWEN_GUI *gui,
-					     uint32_t id,
-					     uint64_t total);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_PROGRESS_SETTOTAL_FN)(GWEN_GUI *gui,
+                                                           uint32_t id,
+                                                           uint64_t total);
 
 /**
  * Please see @ref GWEN_Gui_ProgressLog for details.
  *
  */
-typedef int (*GWEN_GUI_PROGRESS_LOG_FN)(GWEN_GUI *gui,
-                                        uint32_t id,
-                                        GWEN_LOGGER_LEVEL level,
-                                        const char *text);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_PROGRESS_LOG_FN)(GWEN_GUI *gui,
+                                                      uint32_t id,
+                                                      GWEN_LOGGER_LEVEL level,
+                                                      const char *text);
 /**
  * Please see @ref GWEN_Gui_ProgressEnd for details.
  *
  */
-typedef int (*GWEN_GUI_PROGRESS_END_FN)(GWEN_GUI *gui, uint32_t id);
+typedef int GWENHYWFAR_CB (*GWEN_GUI_PROGRESS_END_FN)(GWEN_GUI *gui, uint32_t id);
 /*@}*/
 
 
diff --git a/src/parser/configmgr_be.h b/src/parser/configmgr_be.h
index 89a8a5d..9599d44 100644
--- a/src/parser/configmgr_be.h
+++ b/src/parser/configmgr_be.h
@@ -36,39 +36,39 @@ GWENHYWFAR_API
 GWEN_CONFIGMGR *GWEN_ConfigMgr_new(const char *url);
 
 
-typedef int (*GWEN_CONFIGMGR_GETGROUP_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    const char *subGroupName,
-    GWEN_DB_NODE **pDb);
-
-typedef int (*GWEN_CONFIGMGR_SETGROUP_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    const char *subGroupName,
-    GWEN_DB_NODE *db);
-
-typedef int (*GWEN_CONFIGMGR_LOCKGROUP_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    const char *subGroupName);
-
-typedef int (*GWEN_CONFIGMGR_UNLOCKGROUP_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    const char *subGroupName);
-
-typedef int (*GWEN_CONFIGMGR_GETUNIQUEID_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    char *buffer,
-    uint32_t bufferLen);
-
-typedef int (*GWEN_CONFIGMGR_DELETEGROUP_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    const char *subGroupName);
-
-typedef int (*GWEN_CONFIGMGR_LISTGROUPS_FN)(GWEN_CONFIGMGR *mgr,
-    GWEN_STRINGLIST *sl);
-
-typedef int (*GWEN_CONFIGMGR_LISTSUBGROUPS_FN)(GWEN_CONFIGMGR *mgr,
-    const char *groupName,
-    GWEN_STRINGLIST *sl);
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_GETGROUP_FN)(GWEN_CONFIGMGR *mgr,
+                                                        const char *groupName,
+                                                        const char *subGroupName,
+                                                        GWEN_DB_NODE **pDb);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_SETGROUP_FN)(GWEN_CONFIGMGR *mgr,
+                                                        const char *groupName,
+                                                        const char *subGroupName,
+                                                        GWEN_DB_NODE *db);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_LOCKGROUP_FN)(GWEN_CONFIGMGR *mgr,
+                                                         const char *groupName,
+                                                         const char *subGroupName);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_UNLOCKGROUP_FN)(GWEN_CONFIGMGR *mgr,
+                                                           const char *groupName,
+                                                           const char *subGroupName);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_GETUNIQUEID_FN)(GWEN_CONFIGMGR *mgr,
+                                                           const char *groupName,
+                                                           char *buffer,
+                                                           uint32_t bufferLen);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_DELETEGROUP_FN)(GWEN_CONFIGMGR *mgr,
+                                                           const char *groupName,
+                                                           const char *subGroupName);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_LISTGROUPS_FN)(GWEN_CONFIGMGR *mgr,
+                                                          GWEN_STRINGLIST *sl);
+
+typedef int GWENHYWFAR_CB (*GWEN_CONFIGMGR_LISTSUBGROUPS_FN)(GWEN_CONFIGMGR *mgr,
+                                                             const char *groupName,
+                                                             GWEN_STRINGLIST *sl);
 
 
 
diff --git a/src/parser/xmlctx.h b/src/parser/xmlctx.h
index 2b03319..afc6093 100644
--- a/src/parser/xmlctx.h
+++ b/src/parser/xmlctx.h
@@ -44,16 +44,16 @@ GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_XML_CONTEXT, GWENHYWFAR_API)
 
 
 
-typedef int (*GWEN_XMLCTX_STARTTAG_FN)(GWEN_XML_CONTEXT *ctx,
-                                       const char *tagName);
-typedef int (*GWEN_XMLCTX_ENDTAG_FN)(GWEN_XML_CONTEXT *ctx, int closing);
-typedef int (*GWEN_XMLCTX_ADDDATA_FN)(GWEN_XML_CONTEXT *ctx,
-                                      const char *data);
-typedef int (*GWEN_XMLCTX_ADDCOMMENT_FN)(GWEN_XML_CONTEXT *ctx,
-    const char *data);
-typedef int (*GWEN_XMLCTX_ADDATTR_FN)(GWEN_XML_CONTEXT *ctx,
-                                      const char *attrName,
-                                      const char *attrData);
+typedef int GWENHYWFAR_CB (*GWEN_XMLCTX_STARTTAG_FN)(GWEN_XML_CONTEXT *ctx,
+                                                     const char *tagName);
+typedef int GWENHYWFAR_CB (*GWEN_XMLCTX_ENDTAG_FN)(GWEN_XML_CONTEXT *ctx, int closing);
+typedef int GWENHYWFAR_CB (*GWEN_XMLCTX_ADDDATA_FN)(GWEN_XML_CONTEXT *ctx,
+                                                    const char *data);
+typedef int GWENHYWFAR_CB (*GWEN_XMLCTX_ADDCOMMENT_FN)(GWEN_XML_CONTEXT *ctx,
+                                                       const char *data);
+typedef int GWENHYWFAR_CB (*GWEN_XMLCTX_ADDATTR_FN)(GWEN_XML_CONTEXT *ctx,
+                                                    const char *attrName,
+                                                    const char *attrData);
 
 
 
diff --git a/src/parser/xsdnode_l.h b/src/parser/xsdnode_l.h
index 252a3e6..b1e1a6a 100644
--- a/src/parser/xsdnode_l.h
+++ b/src/parser/xsdnode_l.h
@@ -28,12 +28,12 @@
 #include <gwenhywfar/xsdnode.h>
 
 
-typedef int (*GWEN_XSDNODE_READ_FN)(GWEN_XSD_NODE *xsdNode,
-                                    GWEN_XMLNODE *xmlNode,
-                                    GWEN_DB_NODE *db);
-typedef int (*GWEN_XSDNODE_WRITE_FN)(GWEN_XSD_NODE *xsdNode,
-                                     GWEN_XMLNODE *xmlNode,
-                                     GWEN_DB_NODE *db);
+typedef int GWENHYWFAR_CB (*GWEN_XSDNODE_READ_FN)(GWEN_XSD_NODE *xsdNode,
+                                                  GWEN_XMLNODE *xmlNode,
+                                                  GWEN_DB_NODE *db);
+typedef int GWENHYWFAR_CB (*GWEN_XSDNODE_WRITE_FN)(GWEN_XSD_NODE *xsdNode,
+                                                   GWEN_XMLNODE *xmlNode,
+                                                   GWEN_DB_NODE *db);
 
 GWEN_XSDNODE_READ_FN GWEN_XsdNode_SetReadFn(GWEN_XSD_NODE *xsdNode,
     GWEN_XSDNODE_READ_FN fn);
-- 
1.8.4.5

