gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libfints] branch master updated: New API.


From: gnunet
Subject: [GNUnet-SVN] [libfints] branch master updated: New API.
Date: Fri, 12 Oct 2018 16:17:06 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libfints.

The following commit(s) were added to refs/heads/master by this push:
     new b013c2c  New API.
b013c2c is described below

commit b013c2c79c3a3c1702511380752bd62e5bdfa55e
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Oct 12 16:16:36 2018 +0200

    New API.
    
    Adapting remaining generators to the new API.
---
 src/libebics.c | 114 ++++++++++++++++++++++++++++++++++++++-------------------
 src/libebics.h |  46 ++++++++++++++++-------
 2 files changed, 110 insertions(+), 50 deletions(-)

diff --git a/src/libebics.c b/src/libebics.c
index 6038f05..a37e579 100644
--- a/src/libebics.c
+++ b/src/libebics.c
@@ -792,80 +792,120 @@ EBICS_generate_message_ini
 
 
 /**
- * _Looks like_ that 'document' gets the header
- * and 'hiaArgs->document' gets the "body" content.
+ * Generator of HIA messages.
  *
+ * @param header_args TODO
+ * @param hia_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
  */
-int
-EBICS_generate_message_hia (struct EBICS_genex_document *document,
-                            struct EBICS_ARGS_build_header *headerArgs,
-                            struct EBICS_ARGS_build_content_hia *hiaArgs)
+struct EBICS_genex_document *
+EBICS_generate_message_hia (struct EBICS_ARGS_build_header *header_args,
+                            struct EBICS_ARGS_build_content_hia *hia_args)
 {
 
+  struct EBICS_genex_document *instance;
+
+  if (NULL == (instance = get_genex_instance
+    (EBICS_INI_BASE_DOCUMENT)))
+  {
+    LOG (EBICS_ERROR,
+         "Could not allocate genex instance\n");
+    return NULL;
+  }
+
+
   struct EBICS_MSG_Spec spec[] = {
 
     EBICS_MSG_op_subcommand (EBICS_build_header_ebicsUnsecuredRequest,
-                             headerArgs),
+                             header_args),
     EBICS_MSG_op_subcommand (EBICS_build_content_hia,
-                             hiaArgs),
-
+                             hia_args),
     EBICS_MSG_op_clean (),
     EBICS_MSG_op_end ()
   };
 
-
-  EBICS_MSG_parse_spec (spec, document);
+  EBICS_MSG_parse_spec (spec,
+                        instance);
+  return instance;
 }
 
-int
-EBICS_generate_message_hpb (struct EBICS_genex_document *document,
-                            struct EBICS_ARGS_build_header *headerArgs,
-                            struct EBICS_ARGS_build_auth *authArgs)
+/**
+ * Generator of HPB messages.
+ *
+ * @param header_args TODO
+ * @param auth_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
+ */
+struct EBICS_genex_document *
+EBICS_generate_message_hpb (struct EBICS_ARGS_build_header *header_args,
+                            struct EBICS_ARGS_build_auth *auth_args)
 {
 
+  struct EBICS_genex_document *instance;
+
+  if (NULL == (instance = get_genex_instance
+    (EBICS_INI_BASE_DOCUMENT)))
+  {
+    LOG (EBICS_ERROR,
+         "Could not allocate genex instance\n");
+    return NULL;
+  }
+
   struct EBICS_MSG_Spec foo[] = {
 
     EBICS_MSG_op_subcommand (EBICS_build_header_ebicsNoPubKeyDigestsRequest,
-                             headerArgs),
-
+                             header_args),
     EBICS_MSG_op_set_string ("//ebics:OrderDetails//ebics:OrderType",
                              "HPB"),
-
     EBICS_MSG_op_del_node ("//ds:X509Data"),
-
     EBICS_MSG_op_subcommand (EBICS_build_auth_signature,
-                             authArgs),
+                             auth_args),
     EBICS_MSG_op_clean (),
     EBICS_MSG_op_end ()
   };
 
-
-  EBICS_MSG_parse_spec(foo, document);
+  EBICS_MSG_parse_spec(foo,
+                       instance);
 }
 
-int
-EBICS_generate_message_camt053 (struct EBICS_genex_document *document, 
-                                struct EBICS_ARGS_build_header *headerArgs,
-                                struct EBICS_ARGS_build_auth *authArgs,
-                                struct EBICS_ARGS_build_content_camt053 
*camt053Args)
+/**
+ * Generator of CAMT.053 messages.
+ *
+ * @param header_args TODO
+ * @param auth_args TODO
+ * @param camt053_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
+ */
+struct EBICS_genex_document *
+EBICS_generate_message_camt053 (struct EBICS_ARGS_build_header *header_args,
+                                struct EBICS_ARGS_build_auth *auth_args,
+                                struct EBICS_ARGS_build_content_camt053 
*camt053_args)
 {
-  struct EBICS_MSG_Spec foo[] = {
 
-    EBICS_MSG_op_subcommand (EBICS_build_header_ebicsRequest,
-                             headerArgs),
+  struct EBICS_genex_document *instance;
 
-    EBICS_MSG_op_subcommand (EBICS_build_content_camt053,
-                             camt053Args),
+  if (NULL == (instance = get_genex_instance
+    (EBICS_INI_BASE_DOCUMENT)))
+  {
+    LOG (EBICS_ERROR,
+         "Could not allocate genex instance\n");
+    return NULL;
+  }
 
+  struct EBICS_MSG_Spec foo[] = {
+    EBICS_MSG_op_subcommand (EBICS_build_header_ebicsRequest,
+                             header_args),
+    EBICS_MSG_op_subcommand (EBICS_build_content_camt053,
+                             camt053_args),
     EBICS_MSG_op_subcommand (EBICS_build_bankPubKeyDigest,
-                             authArgs),
-
+                             auth_args),
     EBICS_MSG_op_subcommand (EBICS_build_auth_signature,
-                             authArgs),
-
+                             auth_args),
     EBICS_MSG_op_clean (),
     EBICS_MSG_op_end ()
   };
 
-  EBICS_MSG_parse_spec(foo, document);
+  EBICS_MSG_parse_spec (foo,
+                        instance);
+  return instance;
 }
diff --git a/src/libebics.h b/src/libebics.h
index 2dc7322..6e10c75 100644
--- a/src/libebics.h
+++ b/src/libebics.h
@@ -86,18 +86,38 @@ struct EBICS_genex_document *
 EBICS_generate_message_ini (struct EBICS_ARGS_build_header *header_args,
                             struct EBICS_ARGS_build_content_ini *ini_args);
 
-int
-EBICS_generate_message_hia (struct EBICS_genex_document *document,
-                            struct EBICS_ARGS_build_header *headerArgs,
-                            struct EBICS_ARGS_build_content_hia *hiaArgs);
-int
-EBICS_generate_message_hpb (struct EBICS_genex_document *document,
-                            struct EBICS_ARGS_build_header *headerArgs,
-                            struct EBICS_ARGS_build_auth *authArgs);
+/**
+ * Generator of HIA messages.
+ *
+ * @param header_args TODO
+ * @param hia_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
+ */
+struct EBICS_genex_document *
+EBICS_generate_message_hia (struct EBICS_ARGS_build_header *header_args,
+                            struct EBICS_ARGS_build_content_hia *hia_args);
 
-int
-EBICS_generate_message_camt053 (struct EBICS_genex_document *document, 
-                                struct EBICS_ARGS_build_header *headerArgs,
-                                struct EBICS_ARGS_build_auth *authArgs,
-                                struct EBICS_ARGS_build_content_camt053 
*camt053Args);
+/**
+ * Generator of HPB messages.
+ *
+ * @param header_args TODO
+ * @param auth_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
+ */
+struct EBICS_genex_document *
+EBICS_generate_message_hpb (struct EBICS_ARGS_build_header *header_args,
+                            struct EBICS_ARGS_build_auth *auth_args);
+
+/**
+ * Generator of CAMT.053 messages.
+ *
+ * @param header_args TODO
+ * @param auth_args TODO
+ * @param camt053_args TODO
+ * @return pointer to a freshly allocated document, NULL upon errors.
+ */
+struct EBICS_genex_document *
+EBICS_generate_message_camt053 (struct EBICS_ARGS_build_header *header_args,
+                                struct EBICS_ARGS_build_auth *auth_args,
+                                struct EBICS_ARGS_build_content_camt053 
*camt053_args);
 #endif

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]