All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [libnftables PATCH 3/6] internal: rework parsing symbol logic
Date: Tue, 07 Jan 2014 12:47:27 +0100	[thread overview]
Message-ID: <20140107114726.12841.59406.stgit@nfdev.cica.es> (raw)
In-Reply-To: <20140107114518.12841.35778.stgit@nfdev.cica.es>

Rework parsing symbols logic, so we get a cleaner file.

Also, this allows us to use XML(libmxml)/JSON(libjannson) internal datatypes
without fear.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 0 files changed

diff --git a/src/internal.h b/src/internal.h
index 5fef6d6..83cb4e8 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -40,6 +40,10 @@ struct nft_parse_err {
 
 #ifdef XML_PARSING
 #include <mxml.h>
+#else
+#define mxml_node_t void
+#endif /* XML_PARSING */
+
 #define NFT_XML_MAND 0
 #define NFT_XML_OPT (1 << 0)
 mxml_node_t *nft_mxml_build_tree(const char *xml, const char *treename,
@@ -78,10 +82,13 @@ int nft_mxml_rule_parse(mxml_node_t *tree, struct nft_rule *r,
 struct nft_set;
 int nft_mxml_set_parse(mxml_node_t *tree, struct nft_set *s,
 		       struct nft_parse_err *err);
-#endif
 
 #ifdef JSON_PARSING
 #include <jansson.h>
+#else
+#define json_t void
+#define json_err_t void
+#endif /* JSON_PARSING */
 
 int nft_jansson_parse_val(json_t *root, const char *node_name, int type,
 			  void *out, struct nft_parse_err *err);
@@ -119,7 +126,6 @@ int nft_jansson_parse_rule(struct nft_rule *r, json_t *tree,
 struct nft_set;
 int nft_jansson_parse_set(struct nft_set *s, json_t *tree,
 			  struct nft_parse_err *err);
-#endif
 
 const char *nft_family2str(uint32_t family);
 int nft_str2family(const char *family);


  parent reply	other threads:[~2014-01-07 11:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 11:47 [libnftables PATCH 0/6] parsing update Arturo Borrero Gonzalez
2014-01-07 11:47 ` [libnftables PATCH 1/6] mxml: add error reference of the top node Arturo Borrero Gonzalez
2014-01-07 23:16   ` Pablo Neira Ayuso
2014-01-07 11:47 ` [libnftables PATCH 2/6] set_elem: add json parsing to API Arturo Borrero Gonzalez
2014-01-07 23:16   ` Pablo Neira Ayuso
2014-01-07 11:47 ` Arturo Borrero Gonzalez [this message]
2014-01-07 23:18   ` [libnftables PATCH 3/6] internal: rework parsing symbol logic Pablo Neira Ayuso
2014-01-08 12:20     ` Arturo Borrero Gonzalez
2014-01-08 12:25       ` Pablo Neira Ayuso
2014-01-07 11:47 ` [libnftables PATCH 4/6] internal: add a selector for parsing ops Arturo Borrero Gonzalez
2014-01-07 23:29   ` Pablo Neira Ayuso
2014-01-08 12:31     ` Arturo Borrero Gonzalez
2014-01-08 13:36       ` Pablo Neira Ayuso
2014-01-07 11:47 ` [libnftables PATCH 5/6] parsing: add interface to parse from file Arturo Borrero Gonzalez
2014-01-07 11:47 ` [libnftables PATCH 6/6] tests: update tests with nft_*_parse_file() Arturo Borrero Gonzalez
2014-01-07 23:32   ` Pablo Neira Ayuso
2014-01-08 12:21     ` Arturo Borrero Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140107114726.12841.59406.stgit@nfdev.cica.es \
    --to=arturo.borrero.glez@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.