gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libfints] branch master updated: Cosmetics


From: gnunet
Subject: [GNUnet-SVN] [libfints] branch master updated: Cosmetics
Date: Tue, 09 Oct 2018 15:36:40 +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 9d6834a  Cosmetics
9d6834a is described below

commit 9d6834a6426be09bc80e659f67a63f9fc09787bf
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Oct 9 15:36:32 2018 +0200

    Cosmetics
---
 src/libebics.c     |  64 +++++++++++++--------
 src/message_dump.c |   7 ++-
 src/util.c         |  15 +++--
 src/util.h         |   5 +-
 src/xmlmessages.c  | 163 ++++++++++++++++++++++++++++++-----------------------
 src/xmlproto.c     | 126 ++++++++++++++++++++++++-----------------
 6 files changed, 223 insertions(+), 157 deletions(-)

diff --git a/src/libebics.c b/src/libebics.c
index a079f2e..20b234b 100644
--- a/src/libebics.c
+++ b/src/libebics.c
@@ -412,21 +412,27 @@ EBICS_generate_message_ini (struct EBICS_genex_document 
*document,
 
   struct EBICS_MSG_Spec spec[] = {
     /* Notably, it sets the HostID in the request document.  */
-    EBICS_MSG_op_subcommand(EBICS_build_header_ebicsUnsecuredRequest,
-                            headerArgs,
-                            NULL),
+    EBICS_MSG_op_subcommand (EBICS_build_header_ebicsUnsecuredRequest,
+                             headerArgs,
+                             NULL),
 
     /* Set a bunch of nodes (mostly strings) taking values from 'iniArgs'.  */
-    EBICS_MSG_op_subcommand(EBICS_build_content_ini,
-                            iniArgs,
-                            iniArgs->document),
-    EBICS_MSG_op_clean(),
-    EBICS_MSG_op_end()
+    EBICS_MSG_op_subcommand (EBICS_build_content_ini,
+                             iniArgs, // has _another_ document in it
+                             iniArgs->document), // out
+    EBICS_MSG_op_clean (),
+    EBICS_MSG_op_end ()
   };
 
-  EBICS_MSG_parse_spec(spec, document);
+  EBICS_MSG_parse_spec (spec, document);
 }
 
+
+/**
+ * _Looks like_ that 'document' gets the header
+ * and 'hiaArgs->document' gets the "body" content.
+ *
+ */
 int
 EBICS_generate_message_hia (struct EBICS_genex_document *document,
                             struct EBICS_ARGS_build_header *headerArgs,
@@ -434,18 +440,20 @@ EBICS_generate_message_hia (struct EBICS_genex_document 
*document,
 {
 
   struct EBICS_MSG_Spec spec[] = {
-    EBICS_MSG_op_subcommand(EBICS_build_header_ebicsUnsecuredRequest,
-                            headerArgs,
-                            NULL),
-    EBICS_MSG_op_subcommand(EBICS_build_content_hia,
-                            hiaArgs,
-                            hiaArgs->document),
-    EBICS_MSG_op_clean(),
-    EBICS_MSG_op_end()
+
+    EBICS_MSG_op_subcommand (EBICS_build_header_ebicsUnsecuredRequest,
+                             headerArgs,
+                             NULL),
+
+    EBICS_MSG_op_subcommand (EBICS_build_content_hia,
+                             hiaArgs,
+                             hiaArgs->document), // target, gets _this_ change.
+    EBICS_MSG_op_clean (),
+    EBICS_MSG_op_end ()
   };
 
 
-  EBICS_MSG_parse_spec(spec, document);
+  EBICS_MSG_parse_spec (spec, document);
 }
 
 int
@@ -474,12 +482,20 @@ EBICS_generate_message_camt053 (struct 
EBICS_genex_document *document,
                                 struct EBICS_ARGS_build_content_camt053 
*camt053Args)
 {
   struct EBICS_MSG_Spec foo[] = {
-    EBICS_MSG_op_subcommand(EBICS_build_header_ebicsRequest, headerArgs,NULL),
-    EBICS_MSG_op_subcommand(EBICS_build_content_camt053, camt053Args, NULL),
-    EBICS_MSG_op_subcommand(EBICS_build_bankPubKeyDigest ,authArgs, NULL),
-    EBICS_MSG_op_subcommand(EBICS_build_auth_signature ,authArgs, NULL),
-    EBICS_MSG_op_clean(),
-    EBICS_MSG_op_end()
+    EBICS_MSG_op_subcommand (EBICS_build_header_ebicsRequest,
+                             headerArgs,
+                             NULL),
+    EBICS_MSG_op_subcommand (EBICS_build_content_camt053,
+                             camt053Args,
+                             NULL),
+    EBICS_MSG_op_subcommand (EBICS_build_bankPubKeyDigest,
+                             authArgs,
+                             NULL),
+    EBICS_MSG_op_subcommand (EBICS_build_auth_signature,
+                             authArgs,
+                             NULL),
+    EBICS_MSG_op_clean (),
+    EBICS_MSG_op_end ()
   };
 
   EBICS_MSG_parse_spec(foo, document);
diff --git a/src/message_dump.c b/src/message_dump.c
index 6de6ebb..fce66d5 100644
--- a/src/message_dump.c
+++ b/src/message_dump.c
@@ -35,7 +35,7 @@ main (int argc, char **argv)
     "SignaturePubKeyOrderData.xml", 
     "HIARequestOrderData.xml",
     "ebicsUnsecuredRequest.xml", 
-    "ebicsNoPubKeyDigestsRequeST.XMl",
+    "ebicsNoPubKeyDigestsRequest.xml",
     NULL};
 
   /* Load all existing/needed keys from disk. */
@@ -132,9 +132,10 @@ main (int argc, char **argv)
   retv = EBICS_init_genex_documents (genexList,
                                      arg_genexpath,
                                      genexFiles);
-  retv = EBICS_generate_message_hia (&genexList[3],
+
+  retv = EBICS_generate_message_hia (&genexList[3], // 'document'
                                      &headerArgs,
-                                     &hiaArgs); 
+                                     &hiaArgs); // hiaArgs->document does 
exist too.
   util_dump_message(&genexList[3]);
   retv = EBICS_free_genex_documents(genexList);
 
diff --git a/src/util.c b/src/util.c
index 7139133..8151023 100644
--- a/src/util.c
+++ b/src/util.c
@@ -159,16 +159,23 @@ EBICS_UTIL_base64_encode (const char *data,
 /**
  * Dump a EBICS_genex_document to LOG_DEBUG.
  *
+ * @param document the document to dump.
  */
 void
-util_dump_message ( struct EBICS_genex_document *document)
+util_dump_message (struct EBICS_genex_document *document)
 { 
   int buffersize;
   xmlChar* xmlbuf;
 
-  xmlDocDumpFormatMemoryEnc(document->document, &xmlbuf, &buffersize, "UTF-8", 
1);
-  LOG (EBICS_LOGLEVEL_DEBUG, "Dumping Document: INI Message\n%s", xmlbuf);
-  xmlFree(xmlbuf);
+  xmlDocDumpFormatMemoryEnc (document->document,
+                             &xmlbuf,
+                             &buffersize,
+                             "UTF-8",
+                             1);
+  LOG (EBICS_LOGLEVEL_DEBUG,
+       "Dumping Document: INI Message\n%s",
+       xmlbuf);
+  xmlFree (xmlbuf);
 }
 
 struct EBICS_genex_document*
diff --git a/src/util.h b/src/util.h
index 4a91066..a674d36 100644
--- a/src/util.h
+++ b/src/util.h
@@ -48,8 +48,9 @@
 #define EBICS_LOGLEVEL_NONE   -1
 #define EBICS_LOGLEVEL_FATAL   0
 #define EBICS_LOGLEVEL_ERROR   1 
-#define EBICS_LOGLEVEL_INFO    2
-#define EBICS_LOGLEVEL_DEBUG   3
+#define EBICS_LOGLEVEL_WARNING 2 
+#define EBICS_LOGLEVEL_INFO    3
+#define EBICS_LOGLEVEL_DEBUG   4
 
 /**
  * central logging function
diff --git a/src/xmlmessages.c b/src/xmlmessages.c
index c9c83fd..0699277 100644
--- a/src/xmlmessages.c
+++ b/src/xmlmessages.c
@@ -181,7 +181,9 @@ EBICS_build_content_ini (void *cls,
   /* RSAKeyValue content */
   char *modulus;
   char *exponent;
-  util_extract_public_RSAKeyValue(data->userAuthKey->publickey, &exponent, 
&modulus);
+  util_extract_public_RSAKeyValue (data->userAuthKey->publickey,
+                                   &exponent,
+                                   &modulus);
 
   /* SignaturePubKeyOrderData content*/
   char date[DATE_STR_SIZE];
@@ -197,8 +199,8 @@ EBICS_build_content_ini (void *cls,
     EBICS_MSG_op_del_node("//schema:ANY"),
     EBICS_MSG_op_end()
   };
-  EBICS_MSG_parse_spec(content, data->document);
-
+  EBICS_MSG_parse_spec (content,
+                        data->document);
   free(modulus);
   free(exponent);
   
@@ -235,43 +237,44 @@ EBICS_build_content_ini (void *cls,
 }
 
 void
-EBICS_build_content_hia (void *cls, struct EBICS_genex_document *document)
+EBICS_build_content_hia (void *cls,
+                         struct EBICS_genex_document *document)
 {
-  struct EBICS_ARGS_build_content_hia *data = (struct 
EBICS_ARGS_build_content_hia*)cls;
+  struct EBICS_ARGS_build_content_hia *data = (struct 
EBICS_ARGS_build_content_hia*) cls;
   int retv;
 
   /* RSAKeyValue content */
   char *encMod, *encExp;
   char *sigMod, *sigExp;
-  util_extract_public_RSAKeyValue(data->userEncKey->publickey, &encExp, 
&encMod);
-  util_extract_public_RSAKeyValue(data->userSigKey->publickey, &sigExp, 
&sigMod);
+  util_extract_public_RSAKeyValue (data->userEncKey->publickey, &encExp, 
&encMod);
+  util_extract_public_RSAKeyValue (data->userSigKey->publickey, &sigExp, 
&sigMod);
 
   /* SignaturePubKeyOrderData content*/
   char date[DATE_STR_SIZE];
   struct EBICS_MSG_Spec content[] = {
-    EBICS_MSG_op_unique_choice("//ebics:AuthenticationPubKeyInfo"),
-    EBICS_MSG_op_del_node("//ds:X509Data"),
-    EBICS_MSG_op_set_string("//ebics:AuthenticationVersion", "X002"),
-    EBICS_MSG_op_set_string("//ebics:AuthenticationPubKeyInfo//ds:Modulus", 
sigMod),
-    
EBICS_MSG_op_set_string("//ebics:AuthenticationPubKeyInfo//ds:Exponent",sigExp),
-    
EBICS_MSG_op_set_string("//ebics:AuthenticationPubKeyInfo//ebics:TimeStamp", 
tools_get_timestamp(date)),
-    EBICS_MSG_op_set_string("//ebics:EncryptionVersion", "E002"),
-    EBICS_MSG_op_set_string("//ebics:EncryptionPubKeyInfo//ds:Modulus", 
encMod),
-    
EBICS_MSG_op_set_string("//ebics:EncryptionPubKeyInfo//ds:Exponent",encExp),
-    EBICS_MSG_op_set_string("//ebics:EncryptionPubKeyInfo//ebics:TimeStamp", 
tools_get_timestamp(date)),
-    EBICS_MSG_op_set_string("//ebics:PartnerID", data->partnerID),
-    EBICS_MSG_op_set_string("//ebics:UserID", data->userID),
-    EBICS_MSG_op_del_node("//schema:ANY"),
-    EBICS_MSG_op_end()
+    EBICS_MSG_op_unique_choice ("//ebics:AuthenticationPubKeyInfo"),
+    EBICS_MSG_op_del_node ("//ds:X509Data"),
+    EBICS_MSG_op_set_string ("//ebics:AuthenticationVersion", "X002"),
+    EBICS_MSG_op_set_string ("//ebics:AuthenticationPubKeyInfo//ds:Modulus", 
sigMod),
+    EBICS_MSG_op_set_string 
("//ebics:AuthenticationPubKeyInfo//ds:Exponent",sigExp),
+    EBICS_MSG_op_set_string 
("//ebics:AuthenticationPubKeyInfo//ebics:TimeStamp", 
tools_get_timestamp(date)),
+    EBICS_MSG_op_set_string ("//ebics:EncryptionVersion", "E002"),
+    EBICS_MSG_op_set_string ("//ebics:EncryptionPubKeyInfo//ds:Modulus", 
encMod),
+    EBICS_MSG_op_set_string 
("//ebics:EncryptionPubKeyInfo//ds:Exponent",encExp),
+    EBICS_MSG_op_set_string ("//ebics:EncryptionPubKeyInfo//ebics:TimeStamp", 
tools_get_timestamp(date)),
+    EBICS_MSG_op_set_string ("//ebics:PartnerID", data->partnerID),
+    EBICS_MSG_op_set_string ("//ebics:UserID", data->userID),
+    EBICS_MSG_op_del_node ("//schema:ANY"),
+    EBICS_MSG_op_end ()
   };
-  EBICS_MSG_parse_spec(content, data->document);
+  EBICS_MSG_parse_spec (content, data->document);
 
   LOG (EBICS_LOGLEVEL_DEBUG, "Leaving critical");
 
-  free(encMod);
-  free(encExp);
-  free(sigMod);
-  free(sigExp);
+  free (encMod);
+  free (encExp);
+  free (sigMod);
+  free (sigExp);
   
   /* insert base64'ed and zlib'ed data */
   xmlChar *iniContent;
@@ -279,30 +282,41 @@ EBICS_build_content_hia (void *cls, struct 
EBICS_genex_document *document)
   size_t zLen, b64Len;
   int xLen;
   LOG (EBICS_LOGLEVEL_DEBUG, "DUMPING CONTENT!");
-  dump_message(data->document);
-  xmlDocDumpMemoryEnc(data->document->document, &iniContent, &xLen, "utf-8");
+  dump_message (data->document);
+  xmlDocDumpMemoryEnc (data->document->document, &iniContent, &xLen, "utf-8");
 
   zLen = compressBound ((size_t)xLen);
-  char *zData = malloc(zLen);
+  char *zData = malloc (zLen);
   retv = compress ((unsigned char*) zData, &zLen, iniContent, xLen);
-  LOG (EBICS_LOGLEVEL_INFO, "Size: %lu, FinalSize: %lu", (size_t)xLen, zLen);
+  LOG (EBICS_LOGLEVEL_INFO,
+       "Size: %lu, FinalSize: %lu",
+       (size_t) xLen,
+       zLen);
 
-  b64Len = EBICS_UTIL_base64_encode((char*)zData, zLen, &base64Content);
-  char *b64Data = realloc(base64Content, b64Len+1);
+  b64Len = EBICS_UTIL_base64_encode ((char*)zData,
+                                     zLen,
+                                     &base64Content);
+
+  char *b64Data = realloc (base64Content,
+                           b64Len+1);
   b64Data[b64Len] = 0;
   base64Content = b64Data;
 
-  LOG (EBICS_LOGLEVEL_INFO, "Compressed and base64ed. len: %lu, Content:\n%s", 
b64Len,base64Content);
+  LOG (EBICS_LOGLEVEL_INFO,
+       "Compressed and base64ed. len: %lu, Content:\n%s",
+       b64Len,
+       base64Content);
 
   struct EBICS_MSG_Spec body[] = {
-    EBICS_MSG_op_set_string("//ebics:OrderDetails/ebics:OrderType", "HIA"),
-    
EBICS_MSG_op_set_string("//ebics:body//ebics:DataTransfer/ebics:OrderData", 
base64Content),
+    EBICS_MSG_op_set_string ("//ebics:OrderDetails/ebics:OrderType", "HIA"),
+    EBICS_MSG_op_set_string 
("//ebics:body//ebics:DataTransfer/ebics:OrderData", base64Content),
     EBICS_MSG_op_end()
   };
-  EBICS_MSG_parse_spec(body, document);
-  xmlFree(iniContent);
-  free(base64Content);
-  free(zData);
+  EBICS_MSG_parse_spec (body,
+                        document);
+  xmlFree (iniContent);
+  free (base64Content);
+  free (zData);
 }
 
 void
@@ -351,44 +365,49 @@ EBICS_build_bankPubKeyDigest (void *cls, struct 
EBICS_genex_document *document)
 }
 
 void
-EBICS_build_auth_signature (void *cls, struct EBICS_genex_document *document)
+EBICS_build_auth_signature (void *cls,
+                            struct EBICS_genex_document *document)
 {
-  char *hash_mapping[2] = {"http://www.w3.org/2001/04/xmlenc#sha256";, 
"http://www.w3.org/2001/04/xmlenc#sha512"; };
-  struct EBICS_ARGS_build_auth *data = (struct EBICS_ARGS_build_auth*)cls;
+  char *hash_mapping[2] = {"http://www.w3.org/2001/04/xmlenc#sha256";,
+                           "http://www.w3.org/2001/04/xmlenc#sha512"; };
+  struct EBICS_ARGS_build_auth *data = (struct EBICS_ARGS_build_auth*) cls;
 
   struct EBICS_MSG_Spec auth[] = {
     /* Prepare Signature Part */
-    EBICS_MSG_op_del_attribute(
-                               "//ebics:AuthSignature/@Id"),
-    EBICS_MSG_op_del_attribute("//ebics:AuthSignature/ds:SignedInfo/@Id"),
-    
EBICS_MSG_op_set_attribute("//ebics:AuthSignature/ds:SignedInfo/ds:CanonicalizationMethod/@Algorithm",
-                               
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";),
-    
EBICS_MSG_op_set_attribute("//ebics:AuthSignature/ds:SignedInfo/ds:SignatureMethod/@Algorithm",
-                               
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";),
-    
EBICS_MSG_op_set_attribute("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@URI",
-                               "#xpointer(//address@hidden'true'])"),
-    
EBICS_MSG_op_del_attribute("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@Id"),
-    
EBICS_MSG_op_del_attribute("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@Type"),
-    
EBICS_MSG_op_set_attribute("//ebics:AuthSignature//ds:Transform/@Algorithm",
-                               
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";),
-    
EBICS_MSG_op_set_attribute("//ebics:AuthSignature//ds:DigestMethod/@Algorithm",
-                               "http://www.w3.org/2001/04/xmlenc#sha256";),
-    EBICS_MSG_op_set_string("//ebics:AuthSignature//ds:DigestValue",
-                               ""),
-    EBICS_MSG_op_del_attribute("//ebics:AuthSignature//ds:KeyInfo/@Id"),
-    EBICS_MSG_op_unique_choice("//ebics:AuthSignature//ds:KeyName"),
-    EBICS_MSG_op_del_node("//ebics:AuthSignature//ds:KeyName"),
-    EBICS_MSG_op_del_attribute("//ebics:AuthSignature/ds:SignatureValue/@Id"),
-    EBICS_MSG_op_set_string("//ebics:AuthSignature//ds:SignatureValue",
-                               ""),
-    EBICS_MSG_op_del_node("//ebics:AuthSignature//ds:Object"),
-
-
-    EBICS_MSG_op_end()
+    EBICS_MSG_op_del_attribute ("//ebics:AuthSignature/@Id"),
+    EBICS_MSG_op_del_attribute ("//ebics:AuthSignature/ds:SignedInfo/@Id"),
+    EBICS_MSG_op_set_attribute 
("//ebics:AuthSignature/ds:SignedInfo/ds:CanonicalizationMethod/@Algorithm",
+                                
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";),
+    EBICS_MSG_op_set_attribute 
("//ebics:AuthSignature/ds:SignedInfo/ds:SignatureMethod/@Algorithm",
+                                
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";),
+    EBICS_MSG_op_set_attribute 
("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@URI",
+                                "#xpointer(//address@hidden'true'])"),
+    EBICS_MSG_op_del_attribute 
("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@Id"),
+    EBICS_MSG_op_del_attribute 
("//ebics:AuthSignature/ds:SignedInfo/ds:Reference/@Type"),
+    EBICS_MSG_op_set_attribute 
("//ebics:AuthSignature//ds:Transform/@Algorithm",
+                                
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";),
+    EBICS_MSG_op_set_attribute 
("//ebics:AuthSignature//ds:DigestMethod/@Algorithm",
+                                "http://www.w3.org/2001/04/xmlenc#sha256";),
+    EBICS_MSG_op_set_string ("//ebics:AuthSignature//ds:DigestValue",
+                             ""),
+    EBICS_MSG_op_del_attribute ("//ebics:AuthSignature//ds:KeyInfo/@Id"),
+    EBICS_MSG_op_unique_choice ("//ebics:AuthSignature//ds:KeyName"),
+    EBICS_MSG_op_del_node ("//ebics:AuthSignature//ds:KeyName"),
+    EBICS_MSG_op_del_attribute ("//ebics:AuthSignature/ds:SignatureValue/@Id"),
+    EBICS_MSG_op_set_string ("//ebics:AuthSignature//ds:SignatureValue",
+                             ""),
+    EBICS_MSG_op_del_node ("//ebics:AuthSignature//ds:Object"),
+
+    EBICS_MSG_op_end ()
   };
-  EBICS_MSG_parse_spec(auth, document);
-  LOG (EBICS_LOGLEVEL_DEBUG, "Message building finished, now signign");
-  EBICS_sign_message(data->bankAuthentication, data->bankEncryption, 
data->userAuthentication, document);
+  EBICS_MSG_parse_spec (auth, document);
+  LOG (EBICS_LOGLEVEL_DEBUG,
+       "Message building finished, now signign");
+
+  EBICS_sign_message (data->bankAuthentication,
+                      data->bankEncryption,
+                      data->userAuthentication,
+                      document);
 }
 
 /* Sign a ebics message
diff --git a/src/xmlproto.c b/src/xmlproto.c
index 5d04e32..0953754 100644
--- a/src/xmlproto.c
+++ b/src/xmlproto.c
@@ -247,24 +247,28 @@ EBICS_MSG_op_del_node (const char *xpath)
 };
 
 /**
- * Add given node as a child to node.
- * Add to the node specified by the xpath expression the given node as a child.
+ * Make a "subcmd" operation.
  *
- * @param xpath XPath expression that specifies the node.
- * @param node Node that will be added as a child.
+ * @param subcmd the function that the interpreter
+ *        will call passing the rest of the arguments to.
+ * @param cls closure for the sub-command.
+ * @param target the document that will absorb the changes
+ *        carried out by the sub-command *IF* there is no
+ *        target document in the closure.
+ * @return a command runnable by the interpreter.
  */
 struct EBICS_MSG_Spec
 EBICS_MSG_op_subcommand (EBICS_MSG_subcommand_fn subcmd,
                          void *cls,
                          struct EBICS_genex_document *target) 
 {
-  struct EBICS_MSG_Spec result = 
-    {
-      .operation = EBICS_MSG_OP_SUBCOMMAND,
-      .data.subcommand.function = subcmd,
-      .data.subcommand.target = target,
-      .data.subcommand.cls = cls
-    };
+  struct EBICS_MSG_Spec result = {
+    .operation = EBICS_MSG_OP_SUBCOMMAND,
+    .data.subcommand.function = subcmd,
+    .data.subcommand.target = target,
+    .data.subcommand.cls = cls
+  };
+
   return result;
 };
 
@@ -830,32 +834,36 @@ process_del_node (const struct EBICS_MSG_Spec *operation,
 }
 
 /**
- * Process a subcommand
+ * Process a "subcommand" operation.
+ *
+ * @param operation the subcommand operation to run
+ * @param document the output document.  NOTE, that if the
+ *        operation has the target field, this document will
+ *        be left untouched.
  */
 static void
 process_subcommand (const struct EBICS_MSG_Spec *operation,
                     struct EBICS_genex_document *document)
 {
   if (NULL != operation->data.subcommand.target)
-  {
-    operation->data.subcommand.function (operation->data.subcommand.cls, 
document);
-  }
+    operation->data.subcommand.function
+      (operation->data.subcommand.cls,
+       operation->data.subcommand.target);
   else
-  {
-    /* FIXME  */
-    operation->data.subcommand.function (operation->data.subcommand.cls, 
document);
-  }
+    operation->data.subcommand.function
+      (operation->data.subcommand.cls,
+       document);
 }
 
 /**
- * Parse a operationlist end operation.
+ * Parse a end operation.
  */
 static void
 process_end (const struct EBICS_MSG_Spec *operation,
              struct EBICS_genex_document *document)
 {
-  remove_lfts_optional_nodes(document);
-  remove_any_nodes(document);
+  remove_lfts_optional_nodes (document);
+  remove_any_nodes (document);
 }
 
 /**
@@ -882,66 +890,80 @@ EBICS_MSG_parse_spec (const struct EBICS_MSG_Spec *ops,
     switch (op->operation)
     {
       case EBICS_MSG_OP_SELECT_CHOICE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'select_choice'");
-        process_choice(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'select_choice'");
+        process_choice (op, document);
         break;
       case EBICS_MSG_OP_UNIQUE_CHOICE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'unique_choice'");
-        process_unique(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'unique_choice'");
+        process_unique (op, document);
         break;
       case EBICS_MSG_OP_SET_UINT:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_uint'");
-        process_uint(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_uint'");
+        process_uint (op, document);
         break;
       case EBICS_MSG_OP_SET_INT:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_int'");
-        process_int(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_int'");
+        process_int (op, document);
         break;
       case EBICS_MSG_OP_SET_FLAG:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_flag'");
-        process_flag(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_flag'");
+        process_flag (op, document);
         break;
       case EBICS_MSG_OP_SET_STRING:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_string'");
-        process_string(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_string'");
+        process_string (op, document);
         break;
       case EBICS_MSG_OP_SET_DATE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_date'");
-        process_date(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_date'");
+        process_date (op, document);
         break;
       case EBICS_MSG_OP_SET_ATTRIBUTE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_attribute'");
-        process_attribute_set(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_attribute'");
+        process_attribute_set (op, document);
         break;
       case EBICS_MSG_OP_ADD_ATTRIBUTE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_attribute'");
-        process_attribute_add(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_attribute'");
+        process_attribute_add (op, document);
         break;
       case EBICS_MSG_OP_DEL_ATTRIBUTE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'set_attribute'");
-        process_attribute_del(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'set_attribute'");
+        process_attribute_del (op, document);
         break;
       case EBICS_MSG_OP_ADD_NODE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'add_node'");
-        process_add_node(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'add_node'");
+        process_add_node (op, document);
         break;
       case EBICS_MSG_OP_DEL_NODE:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'del_node'");
-        process_del_node(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'del_node'");
+        process_del_node (op, document);
         break;
       case EBICS_MSG_OP_SUBCOMMAND:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'subcommand'");
-        process_subcommand(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'subcommand'");
+        process_subcommand (op, document);
         break;
       case EBICS_MSG_OP_CLEAN:
-        LOG(EBICS_LOGLEVEL_INFO,"parse_spec: executing 'add_node'");
-        process_end(op, document);
+        LOG (EBICS_LOGLEVEL_INFO,
+             "parse_spec: executing 'add_node'");
+        process_end (op, document);
         break;
 
       default:
-
         /*TODO should this be the error case? */
-        break;
+        LOG (EBICS_LOGLEVEL_WARNING,
+             "Default case hit, what to do?\n");
     }
   }
 }

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



reply via email to

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