netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: [PATCH nft 4/5] include: add cli.h
Date: Thu,  6 Nov 2014 19:25:48 +0100	[thread overview]
Message-ID: <1415298349-985-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1415298349-985-1-git-send-email-pablo@netfilter.org>

Needed by follow up patches to use autotools.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/cli.h      |   18 ++++++++++++++++++
 include/nftables.h |   14 ++------------
 src/cli.c          |    1 +
 src/main.c         |    1 +
 4 files changed, 22 insertions(+), 12 deletions(-)
 create mode 100644 include/cli.h

diff --git a/include/cli.h b/include/cli.h
new file mode 100644
index 0000000..89cb976
--- /dev/null
+++ b/include/cli.h
@@ -0,0 +1,18 @@
+#ifndef _NFT_CLI_H_
+#define _NFT_CLI_H_
+
+#include <config.h>
+
+struct parser_state;
+#ifdef HAVE_LIBREADLINE
+extern int cli_init(struct parser_state *state);
+#else
+static inline int cli_init(struct parser_state *state)
+{
+        return -1;
+}
+#endif
+extern void cli_exit(void);
+extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0);
+
+#endif
diff --git a/include/nftables.h b/include/nftables.h
index 4c33ec6..cf19de8 100644
--- a/include/nftables.h
+++ b/include/nftables.h
@@ -31,18 +31,6 @@ extern unsigned int handle_output;
 extern unsigned int debug_level;
 extern const char *include_paths[INCLUDE_PATHS_MAX];
 
-struct parser_state;
-#ifdef HAVE_LIBREADLINE
-extern int cli_init(struct parser_state *state);
-#else
-static inline int cli_init(struct parser_state *state)
-{
-	return -1;
-}
-#endif
-extern void cli_exit(void);
-extern void cli_display(const char *fmt, va_list ap) __fmtstring(1, 0);
-
 enum nftables_exit_codes {
 	NFT_EXIT_SUCCESS	= 0,
 	NFT_EXIT_FAILURE	= 1,
@@ -116,6 +104,8 @@ struct input_descriptor {
 	off_t				line_offset;
 };
 
+struct parser_state;
+
 int nft_run(void *scanner, struct parser_state *state, struct list_head *msgs);
 
 #endif /* NFTABLES_NFTABLES_H */
diff --git a/src/cli.c b/src/cli.c
index f748a0e..6f2847b 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -27,6 +27,7 @@
 #include <parser.h>
 #include <erec.h>
 #include <utils.h>
+#include <cli.h>
 
 #define CMDLINE_HISTFILE	".nft.history"
 
diff --git a/src/main.c b/src/main.c
index 1625914..b447aad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,6 +25,7 @@
 #include <netlink.h>
 #include <erec.h>
 #include <mnl.h>
+#include <cli.h>
 
 unsigned int max_errors = 10;
 unsigned int numeric_output;
-- 
1.7.10.4


  parent reply	other threads:[~2014-11-06 18:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 18:25 [PATCH nft 0/5] autotools conversion Pablo Neira Ayuso
2014-11-06 18:25 ` [PATCH nft 1/5] build: use PKG_CHECK_MODULES to check for libmnl and libnftnl Pablo Neira Ayuso
2014-11-06 18:25 ` [PATCH nft 2/5] build: use AC_PROG_YACC and AM_PROG_LEX Pablo Neira Ayuso
2014-11-06 18:25 ` [PATCH nft 3/5] rename parser.y to parser_bison.y Pablo Neira Ayuso
2014-11-06 18:25 ` Pablo Neira Ayuso [this message]
2014-11-06 18:25 ` [PATCH nft 5/5] build: autotools conversion Pablo Neira Ayuso
2014-11-06 20:29   ` Jan Engelhardt
2014-11-07 18:17   ` Giorgio
2014-11-09 20:26 ` [PATCH 1/1] autotools conversion fixups giorgio.nicole
2014-11-12 12:01   ` Pablo Neira Ayuso

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=1415298349-985-5-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).