summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt2
-rw-r--r--tools/Makefile.am31
-rw-r--r--tools/common.c9
-rw-r--r--tools/consume.c4
-rw-r--r--tools/declare_queue.c4
-rw-r--r--tools/delete_queue.c4
-rw-r--r--tools/doc/Makefile.am42
-rw-r--r--tools/doc/amqp-consume.xml (renamed from tools/doc/consume.xml)0
-rw-r--r--tools/doc/amqp-declare-queue.xml (renamed from tools/doc/declare_queue.xml)0
-rw-r--r--tools/doc/amqp-delete-queue.xml (renamed from tools/doc/delete_queue.xml)0
-rw-r--r--tools/doc/amqp-get.xml (renamed from tools/doc/get.xml)0
-rw-r--r--tools/doc/amqp-publish.xml (renamed from tools/doc/publish.xml)0
-rw-r--r--tools/get.c4
-rw-r--r--tools/publish.c4
-rw-r--r--tools/unix/process.c4
-rw-r--r--tools/win32/compat.c (renamed from tools/windows/compat.c)4
-rw-r--r--tools/win32/compat.h (renamed from tools/windows/compat.h)0
-rw-r--r--tools/win32/process.c (renamed from tools/windows/process.c)4
-rw-r--r--tools/win32/process.h (renamed from tools/windows/process.h)0
19 files changed, 34 insertions, 82 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 579a3b9..bdeddaf 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -3,7 +3,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${librabbitmq_SOURCE_DIR} ${libr
if (WIN32)
set(PLATFORM_DIR win32)
set(PLATFORM_SRCS
- windows/compat.c
+ win32/compat.c
)
else (WIN32)
set(PLATFORM_DIR unix)
diff --git a/tools/Makefile.am b/tools/Makefile.am
deleted file mode 100644
index 6fa1e4b..0000000
--- a/tools/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-SUBDIRS=doc
-
-bin_PROGRAMS = amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue
-
-# The -I to srcdir's librabbitmq is for the main amqp header
-# files. The -I to builddir's librabbitmq is less obvious; it's for
-# VPATH-based builds: the amqp_framing.h gets generated into the
-# *build* directory, not the source directory.
-AM_CFLAGS = -I$(top_srcdir)/librabbitmq -I$(srcdir)/$(PLATFORM_DIR) -I$(top_builddir)/librabbitmq
-AM_LDFLAGS = $(top_builddir)/librabbitmq/librabbitmq.la
-
-LDADD=$(LIBPOPT)
-
-noinst_HEADERS = common.h $(PLATFORM_DIR)/process.h
-
-COMMON_SOURCES = common.c
-
-if WINDOWS
-COMMON_SOURCES += windows/compat.c
-endif
-
-amqp_publish_SOURCES = publish.c $(COMMON_SOURCES)
-amqp_get_SOURCES = get.c $(COMMON_SOURCES)
-amqp_consume_SOURCES = consume.c $(PLATFORM_DIR)/process.c $(COMMON_SOURCES)
-amqp_declare_queue_SOURCES = declare_queue.c $(COMMON_SOURCES)
-amqp_delete_queue_SOURCES = delete_queue.c $(COMMON_SOURCES)
-
-EXTRA_DIST = \
- unix/process.c unix/process.h \
- windows/process.c windows/process.h \
- windows/compat.c windows/compat.h
diff --git a/tools/common.c b/tools/common.c
index 38df751..2c248b9 100644
--- a/tools/common.c
+++ b/tools/common.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -179,7 +181,7 @@ struct poptOption connect_options[] = {
"the username to login with", "username"},
{"password", 0, POPT_ARG_STRING, &amqp_password, 0,
"the password to login with", "password"},
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
static void init_connection_info(struct amqp_connection_info *ci)
@@ -329,7 +331,8 @@ amqp_bytes_t read_all(int fd)
bytes.len = 0;
for (;;) {
- ssize_t res = read(fd, bytes.bytes+bytes.len, space-bytes.len);
+ ssize_t res = read(fd, (char *)bytes.bytes + bytes.len,
+ space-bytes.len);
if (res == 0)
break;
@@ -358,7 +361,7 @@ void write_all(int fd, amqp_bytes_t data)
die_errno(errno, "write");
data.len -= res;
- data.bytes += res;
+ data.bytes = (char *)data.bytes + res;
}
}
diff --git a/tools/consume.c b/tools/consume.c
index 83a5164..4f79889 100644
--- a/tools/consume.c
+++ b/tools/consume.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -180,7 +182,7 @@ int main(int argc, const char **argv)
"stop consuming after this many messages are consumed",
"limit"},
POPT_AUTOHELP
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
opts = process_options(argc, argv, options,
diff --git a/tools/declare_queue.c b/tools/declare_queue.c
index d6bb9db..fc9524c 100644
--- a/tools/declare_queue.c
+++ b/tools/declare_queue.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -52,7 +54,7 @@ int main(int argc, const char **argv)
{"durable", 'd', POPT_ARG_VAL, &durable, 1,
"declare a durable queue", NULL},
POPT_AUTOHELP
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
process_all_options(argc, argv, options);
diff --git a/tools/delete_queue.c b/tools/delete_queue.c
index e596096..4577d74 100644
--- a/tools/delete_queue.c
+++ b/tools/delete_queue.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -55,7 +57,7 @@ int main(int argc, const char **argv)
{"if-empty", 'e', POPT_ARG_VAL, &if_empty, 1,
"do not delete unless queue is empty", NULL},
POPT_AUTOHELP
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
process_all_options(argc, argv, options);
diff --git a/tools/doc/Makefile.am b/tools/doc/Makefile.am
deleted file mode 100644
index f482d94..0000000
--- a/tools/doc/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-EXTRA_DIST = \
- publish.xml \
- consume.xml \
- get.xml \
- declare_queue.xml \
- delete_queue.xml \
- librabbitmq-tools.xml
-
-if TOOLS_DOC
-man_MANS = \
- amqp-publish.1 \
- amqp-consume.1 \
- amqp-get.1 \
- amqp-declare-queue.1 \
- amqp-delete-queue.1 \
- librabbitmq-tools.7
-MOSTLYCLEANFILES = man-date.ent $(man_MANS)
-
-# automake complains about % pattern rules, and suffix rules don't
-# support multiple dependencies, so we have to expand all these out.
-#
-# Also, xmlto's --searchpath doesn't get passed through to xmllint, so
-# we disable xmllint validation with --skip-validation for the benefit
-# of build/source separation as required by distcheck, debian
-# packaging etc.
-amqp-publish.1: publish.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-amqp-consume.1: consume.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-amqp-get.1: get.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-amqp-declare-queue.1: declare_queue.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-amqp-delete-queue.1: delete_queue.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-librabbitmq-tools.7: librabbitmq-tools.xml man-date.ent
- $(XMLTO) --skip-validation --searchpath $(CURDIR) man $<
-
-man-date.ent:
- date +'%Y-%m-%d' >$@
-
-endif
diff --git a/tools/doc/consume.xml b/tools/doc/amqp-consume.xml
index b5f40d7..b5f40d7 100644
--- a/tools/doc/consume.xml
+++ b/tools/doc/amqp-consume.xml
diff --git a/tools/doc/declare_queue.xml b/tools/doc/amqp-declare-queue.xml
index 0fc0440..0fc0440 100644
--- a/tools/doc/declare_queue.xml
+++ b/tools/doc/amqp-declare-queue.xml
diff --git a/tools/doc/delete_queue.xml b/tools/doc/amqp-delete-queue.xml
index 040a384..040a384 100644
--- a/tools/doc/delete_queue.xml
+++ b/tools/doc/amqp-delete-queue.xml
diff --git a/tools/doc/get.xml b/tools/doc/amqp-get.xml
index 08abe2b..08abe2b 100644
--- a/tools/doc/get.xml
+++ b/tools/doc/amqp-get.xml
diff --git a/tools/doc/publish.xml b/tools/doc/amqp-publish.xml
index e609972..e609972 100644
--- a/tools/doc/publish.xml
+++ b/tools/doc/amqp-publish.xml
diff --git a/tools/get.c b/tools/get.c
index 57ebedb..3e536c7 100644
--- a/tools/get.c
+++ b/tools/get.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
@@ -60,7 +62,7 @@ int main(int argc, const char **argv)
{"queue", 'q', POPT_ARG_STRING, &queue, 0,
"the queue to consume from", "queue"},
POPT_AUTOHELP
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
process_all_options(argc, argv, options);
diff --git a/tools/publish.c b/tools/publish.c
index 57060df..f7e7e77 100644
--- a/tools/publish.c
+++ b/tools/publish.c
@@ -30,7 +30,9 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -77,7 +79,7 @@ int main(int argc, const char **argv)
{"body", 'b', POPT_ARG_STRING, &body, 0,
"specify the message body", "body"},
POPT_AUTOHELP
- { NULL, 0, 0, NULL, 0 }
+ { NULL, '\0', 0, NULL, 0, NULL, NULL }
};
process_all_options(argc, argv, options);
diff --git a/tools/unix/process.c b/tools/unix/process.c
index 1e0d1d6..624f016 100644
--- a/tools/unix/process.c
+++ b/tools/unix/process.c
@@ -30,6 +30,10 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <unistd.h>
#include <errno.h>
#include <spawn.h>
diff --git a/tools/windows/compat.c b/tools/win32/compat.c
index acba42e..07afa9a 100644
--- a/tools/windows/compat.c
+++ b/tools/win32/compat.c
@@ -30,6 +30,10 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
diff --git a/tools/windows/compat.h b/tools/win32/compat.h
index 9b9c96a..9b9c96a 100644
--- a/tools/windows/compat.h
+++ b/tools/win32/compat.h
diff --git a/tools/windows/process.c b/tools/win32/process.c
index 26b9a70..8bc9337 100644
--- a/tools/windows/process.c
+++ b/tools/win32/process.c
@@ -30,6 +30,10 @@
* ***** END LICENSE BLOCK *****
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <io.h>
#include <windows.h>
diff --git a/tools/windows/process.h b/tools/win32/process.h
index c2a8a0d..c2a8a0d 100644
--- a/tools/windows/process.h
+++ b/tools/win32/process.h