Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Official rabbitmq-c sources have moved!

The new location of the sources is:
https://github.com/alanxz/rabbitmq-c
commit 4373ee0f732662498cacb138404eb51382082a83 1 parent 1f8061e
@alanxz alanxz authored
Showing with 6 additions and 10,013 deletions.
  1. +0 −39 .hgignore
  2. +0 −2  AUTHORS
  3. +0 −74 CMakeLists.txt
  4. +0 −1  COPYING
  5. 0  ChangeLog
  6. +0 −291 INSTALL
  7. +0 −25 LICENSE-MIT
  8. +0 −21 Makefile.am
  9. 0  NEWS
  10. +0 −137 README
  11. +0 −1  README.md
  12. +6 −0 README.md
  13. +0 −124 README.windows
  14. +0 −8 THANKS
  15. +0 −9 TODO
  16. +0 −28 TestCInline.cmake
  17. +0 −18 cmake/FindPOPT.cmake
  18. +0 −99 cmake/LibFindMacros.cmake
  19. +0 −166 configure.ac
  20. +0 −1  debian/amqp-tools.docs
  21. +0 −3  debian/amqp-tools.install
  22. +0 −5 debian/changelog
  23. +0 −1  debian/compat
  24. +0 −29 debian/control
  25. +0 −17 debian/copyright
  26. +0 −1  debian/librabbitmq-dev.docs
  27. +0 −4 debian/librabbitmq-dev.install
  28. +0 −1  debian/librabbitmq.docs
  29. +0 −1  debian/librabbitmq.install
  30. +0 −24 debian/rules
  31. +0 −78 etc/build-ms.sh
  32. +0 −78 etc/install-mingw.sh
  33. +0 −37 examples/CMakeLists.txt
  34. +0 −33 examples/Makefile.am
  35. +0 −84 examples/amqp_bind.c
  36. +0 −171 examples/amqp_consumer.c
  37. +0 −79 examples/amqp_exchange_declare.c
  38. +0 −171 examples/amqp_listen.c
  39. +0 −154 examples/amqp_listenq.c
  40. +0 −141 examples/amqp_producer.c
  41. +0 −93 examples/amqp_sendstring.c
  42. +0 −84 examples/amqp_unbind.c
  43. +0 −51 examples/unix/platform_utils.c
  44. +0 −170 examples/utils.c
  45. +0 −44 examples/utils.h
  46. +0 −48 examples/windows/platform_utils.c
  47. +0 −82 librabbitmq/CMakeLists.txt
  48. +0 −35 librabbitmq/Makefile.am
  49. +0 −410 librabbitmq/amqp.h
  50. +0 −242 librabbitmq/amqp_api.c
  51. +0 −418 librabbitmq/amqp_connection.c
  52. +0 −182 librabbitmq/amqp_mem.c
  53. +0 −258 librabbitmq/amqp_private.h
  54. +0 −516 librabbitmq/amqp_socket.c
  55. +0 −423 librabbitmq/amqp_table.c
  56. +0 −199 librabbitmq/amqp_url.c
  57. +0 −642 librabbitmq/codegen.py
  58. +0 −71 librabbitmq/unix/socket.c
  59. +0 −61 librabbitmq/unix/socket.h
  60. +0 −76 librabbitmq/windows/socket.c
  61. +0 −71 librabbitmq/windows/socket.h
  62. +0 −305 msinttypes/inttypes.h
  63. +0 −247 msinttypes/stdint.h
  64. +0 −18 tests/Makefile.am
  65. +0 −168 tests/test_parse_url.c
  66. +0 −471 tests/test_tables.c
  67. +0 −90 tests/test_tables.expected
  68. +0 −34 tools/CMakeLists.txt
  69. +0 −31 tools/Makefile.am
  70. +0 −431 tools/common.c
  71. +0 −71 tools/common.h
  72. +0 −205 tools/consume.c
  73. +0 −81 tools/declare_queue.c
  74. +0 −81 tools/delete_queue.c
  75. +0 −42 tools/doc/Makefile.am
  76. +0 −187 tools/doc/consume.xml
  77. +0 −122 tools/doc/declare_queue.xml
  78. +0 −94 tools/doc/delete_queue.xml
  79. +0 −95 tools/doc/get.xml
  80. +0 −90 tools/doc/librabbitmq-tools.xml
  81. +0 −160 tools/doc/publish.xml
  82. +0 −77 tools/get.c
  83. +0 −119 tools/publish.c
  84. +0 −82 tools/unix/process.c
  85. +0 −39 tools/unix/process.h
  86. +0 −58 tools/windows/compat.c
  87. +0 −33 tools/windows/compat.h
  88. +0 −209 tools/windows/process.c
  89. +0 −41 tools/windows/process.h
View
39 .hgignore
@@ -1,39 +0,0 @@
-^scratch$
-
-^autom4te\.cache$
-^aclocal\.m4$
-^config\.(guess|log|status|sub|h\.in~?)$
-^configure$
-^depcomp$
-^install-sh$
-^ltmain.sh$
-^missing$
-
-(^|/)\.libs$
-(^|/)\.deps$
-\.(o|lo|la)$
-^config\.h$
-^stamp-h1$
-^libtool$
-
-^librabbitmq/amqp_framing\.[ch]$
-
-^(|librabbitmq/|tests/|examples/|tools/|tools/doc/)Makefile(\.in)?$
-^tests/test_tables$
-^tests/test_parse_url$
-^examples/amqp_sendstring$
-^examples/amqp_exchange_declare$
-^examples/amqp_listen$
-^examples/amqp_producer$
-^examples/amqp_consumer$
-^examples/amqp_unbind$
-^examples/amqp_bind$
-^examples/amqp_listenq$
-
-^tools/amqp-publish$
-^tools/amqp-get$
-^tools/amqp-consume$
-^tools/amqp-declare-queue$
-^tools/amqp-delete-queue$
-^tools/.*\.[17]$
-^tools/doc/man-date.ent$
View
2  AUTHORS
@@ -1,2 +0,0 @@
-Tony Garnock-Jones <tonygarnockjones@gmail.com>
-The RabbitMQ team <info@rabbitmq.com>
View
74 CMakeLists.txt
@@ -1,74 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(rabbitmq-c "C")
-
-#find python
-find_package(PythonInterp REQUIRED)
-
-#check for json or simplejson
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import json"
- RESULT_VARIABLE CHECK_PYTHON_JSON_FAILED
-)
-
-if (CHECK_PYTHON_JSON_FAILED)
- execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import simplejson"
- RESULT_VARIABLE CHECK_PYTHON_SIMPLEJSON_FAILED
- )
-
- if (CHECK_PYTHON_SIMPLEJSON_FAILED)
- message(FATAL_ERROR "could not find a python that can 'import simplejson")
- endif (CHECK_PYTHON_SIMPLEJSON_FAILED)
-endif (CHECK_PYTHON_JSON_FAILED)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
-include(TestCInline)
-
-option(FETCH_CODEGEN_FROM_GIT "Fetch codegen directly from the git repository" OFF)
-
-set(CODEGEN_GIT_TAG rabbitmq_v2_5_1 CACHE STRING "Git tag in rabbitmq-codegen to fetch with FETCH_CODEGEN_FROM_GIT")
-if (FETCH_CODEGEN_FROM_GIT)
- include(ExternalProject)
- ExternalProject_Add(
- amqp_codegen
- GIT_REPOSITORY https://github.com/rabbitmq/rabbitmq-codegen.git
- GIT_TAG ${CODEGEN_GIT_TAG}
- CONFIGURE_COMMAND ""
- UPDATE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND "")
-
- ExternalProject_Get_Property(amqp_codegen SOURCE_DIR)
- set(AMQP_CODEGEN_DIR ${SOURCE_DIR} CACHE PATH "Path to rabbitmq-codegen" FORCE)
- SET(AMQP_CODEGEN_TARGET amqp_codegen)
- message(STATUS "Using amqp_codegen.py in ${AMQP_CODEGEN_DIR}")
-else (FETCH_CODEGEN_FROM_GIT)
- find_path(RABBITMQ_CODEGEN_DIR
- amqp_codegen.py
- PATHS ${CMAKE_SOURCE_DIR}/rabbitmq-codegen
- ${CMAKE_SOURCE_DIR}/../rabbitmq-codegen
- DOC "Path to directory containing amqp_codegen.py (rabbitmq-codegen)"
- NO_DEFAULT_PATH
- )
-
- if (RABBITMQ_CODEGEN_DIR STREQUAL "RABBITMQ_CODEGEN_DIR-NOTFOUND")
- message(SEND_ERROR "Cannot find rabbitmq-codegen, set RABBITMQ_CODEGEN_DIR to a rabbitmq-codegen checkout, or set FETCH_CODEGEN_FROM_GIT to download it from git automatically")
- else ()
- message(STATUS "Using amqp_codegen.py in ${RABBITMQ_CODEGEN_DIR}")
- endif()
-
- set(AMQP_CODEGEN_DIR ${RABBITMQ_CODEGEN_DIR} CACHE PATH "Path to rabbitmq-codegen" FORCE)
-endif (FETCH_CODEGEN_FROM_GIT)
-
-mark_as_advanced(AMQP_CODEGEN_DIR)
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
-
-find_package(POPT)
-
-add_subdirectory(librabbitmq)
-add_subdirectory(examples)
-
-if (POPT_FOUND)
- add_subdirectory(tools)
-endif (POPT_FOUND)
-
View
1  COPYING
@@ -1 +0,0 @@
-See LICENSE-MIT.
View
0  ChangeLog
No changes.
View
291 INSTALL
@@ -1,291 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008 Free Software Foundation, Inc.
-
- This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
- Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
-
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
- 6. Often, you can also type `make uninstall' to remove the installed
- files again.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. Run `./configure --help'
-for details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
-
- On MacOS X 10.5 and later systems, you can create libraries and
-executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor. Like
-this:
-
- ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CPP="gcc -E" CXXCPP="g++ -E"
-
- This is not guaranteed to produce working output in all cases, you
-may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
-
-Installation Names
-==================
-
- By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Particular systems
-==================
-
- On HP-UX, the default C compiler is not ANSI C compatible. If GNU
-CC is not installed, it is recommended to use the following options in
-order to use an ANSI C compiler:
-
- ./configure CC="cc -Ae"
-
-and if that doesn't work, install pre-built binaries of GCC for HP-UX.
-
- On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file. The option `-nodtk' can be used as
-a workaround. If GNU CC is not installed, it is therefore recommended
-to try
-
- ./configure CC="cc"
-
-and if that doesn't work, try
-
- ./configure CC="cc -nodtk"
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on. Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
- Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
-
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-`configure' Invocation
-======================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
- Print a summary of all of the options to `configure', and exit.
-
-`--help=short'
-`--help=recursive'
- Print a summary of the options unique to this package's
- `configure', and exit. The `short' variant lists options used
- only in the top level, while the `recursive' variant lists options
- also present in any nested packages.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--prefix=DIR'
- Use DIR as the installation prefix. *Note Installation Names::
- for more details, including other options available for fine-tuning
- the installation locations.
-
-`--no-create'
-`-n'
- Run the configure checks, but stop before creating any output
- files.
-
-`configure' also accepts some other, not widely useful, options. Run
-`configure --help' for more details.
-
View
25 LICENSE-MIT
@@ -1,25 +0,0 @@
-Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
-All Rights Reserved.
-
-Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
-VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use, copy,
-modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
View
21 Makefile.am
@@ -1,21 +0,0 @@
-if TOOLS
-TOOLS_SUBDIR=tools
-else
-TOOLS_SUBDIR=
-endif
-
-SUBDIRS=librabbitmq tests examples $(TOOLS_SUBDIR)
-
-squeakyclean: maintainer-clean
- rm -f Makefile.in librabbitmq/Makefile.in tests/Makefile.in examples/Makefile.in tools/Makefile.in
- rm -f aclocal.m4
- rm -f config.guess config.h.in* config.sub configure
- rm -f depcomp install-sh ltmain.sh missing
- rm -rf codegen
-
-codegen:
- mkdir -p $@
- cp -r "$(top_srcdir)/$(AMQP_CODEGEN_DIR)"/* $@
- $(MAKE) -C $@ clean
-
-EXTRA_DIST=codegen debian LICENSE-MIT
View
0  NEWS
No changes.
View
137 README
@@ -1,137 +0,0 @@
-# RabbitMQ C AMQP client library
-
-## Introduction
-
-This is a C-language AMQP client library for use with AMQP servers
-speaking protocol versions 0-9-1.
-
- - <http://www.rabbitmq.com/>
- - <http://www.amqp.org/>
- - <http://hg.rabbitmq.com/rabbitmq-c>
-
-Announcements regarding the library are periodically made on the
-RabbitMQ mailing list and on the RabbitMQ blog.
-
- - <http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
- - <http://www.rabbitmq.com/blog/>
-
-## Retrieving the code
-
-In addition to the source code for this library, you will require a
-copy of `rabbitmq-codegen`. Here is a short `sh` script for retrieving
-the necessary pieces:
-
- hg clone http://hg.rabbitmq.com/rabbitmq-codegen/
- hg clone http://hg.rabbitmq.com/rabbitmq-c/
-
-You will also need a recent python with the simplejson module
-installed, and the GNU autotools (autoconf, automake, libtool etc)
-or as an alternative CMake
-
-## Building the code
-
-# Using autoconf
-
-Once you have all the prerequisites, change to the `rabbitmq-c`
-directory and run
-
- autoreconf -i
-
-to run the GNU autotools and generate the configure script, followed
-by
-
- ./configure
- make
-
-to build the `librabbitmq` library and the example programs.
-
-# Using cmake
-
-You will need CMake: http://cmake.org/
-
-You will need a working python install in your path.
-
-If you would like the build system to fetch the rabbitmq-codegen
-automatically you will need to have a working git install in your
-path. Otherwise you will need to checkout the rabbitmq-codegen as
-stated above.
-
-Create a binary directory in a sibling directory from the directory
-you cloned the rabbitmq-c repository
-
- mkdir bin-rabbitmq-c
-
-Run CMake in the binary directory
-
- cmake /path/to/source/directory
-
-Build it:
-
-* On linux: `make`
-* On win32: `nmake` or `msbuild`, or open it in visual studio and
- build from there
-
-Things you can pass to cmake to change the build:
-
-* `-DRABBITMQ_CODEGEN_DIR=/path/to/rabbitmq-codegen/checkout` - if you
- have your codegen directory in a different place [Default is
- sibiling directory to source]
-* `-DFETCH_CODEGEN_FROM_GIT=ON` - if you want cmake to fetch the
- rabbitmq-codegen from https://github.com/rabbitmq/rabbitmq-codegen
- at build time. If this option is selected `-DRABBITMQ_CODEGEN_DIR`
- will be ignored [Default is off]
-* `-DCODEGEN_GIT_TAG=rabbitmq_v2_5_1` - specifies the tag to check out
- if using the `-DFETCH_CODEGEN_FROM_GIT` option above. [Default is
- `rabbitmq_v2_5_1`]
-* `-DBUILD_TOOLS=OFF` build the programs in the tools directory
- [Default is ON if the POPT library can be found]
-
-Other interesting flags to pass to CMake (see cmake docs for more info)
-
-* `-DCMAKE_BUILD_TYPE` - specify the type of build (Debug or Release)
-* `-DCMAKE_INSTALL_PREFIX` - specify where the install target puts files
-
-## Running the examples
-
-Arrange for a RabbitMQ or other AMQP server to be running on
-`localhost` at TCP port number 5672.
-
-In one terminal, run
-
- ./examples/amqp_listen localhost 5672 amq.direct test
-
-In another terminal,
-
- ./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
-
-You should see output similar to the following in the listener's
-terminal window:
-
- Result 1
- Frame type 1, channel 1
- Method AMQP_BASIC_DELIVER_METHOD
- Delivery 1, exchange amq.direct routingkey test
- Content-type: text/plain
- ----
- 00000000: 68 65 6C 6C 6F 20 77 6F : 72 6C 64 hello world
- 0000000B:
-
-## Writing applications using `librabbitmq`
-
-Please see the `examples` directory for short examples of the use of
-the `librabbitmq` library.
-
-### Threading
-
-You cannot share a socket, an `amqp_connection_state_t`, or a channel
-between threads using `librabbitmq`. The `librabbitmq` library is
-built with event-driven, single-threaded applications in mind, and
-does not yet cater to any of the requirements of `pthread`ed
-applications.
-
-Your applications instead should open an AMQP connection (and an
-associated socket, of course) per thread. If your program needs to
-access an AMQP connection or any of its channels from more than one
-thread, it is entirely responsible for designing and implementing an
-appropriate locking scheme. It will generally be much simpler to have
-a connection exclusive to each thread that needs AMQP service.
View
1  README.md
View
6 README.md
@@ -0,0 +1,6 @@
+Update your bookmarks!
+======================
+
+The official rabbitmq-c source has been moved to:
+
+https://github.com/alanxz/rabbitmq-c
View
124 README.windows
@@ -1,124 +0,0 @@
-# Using rabbitmq-c on Windows
-
-There are three approaches to building rabbitmq-c under Windows:
-
-- Build using the MinGW/MSYS (MinGW/MSYS is a port of the GNU
- toolchain and utilities to Windows, including the gcc compiler).
- The results of building in this way are native Windows DLLs and
- EXEs, and can be used without having MinGW installed. The drawback
- to this approach is that you cannot safely call the resulting
- librabbitmq DLL from code compiled with Microsoft's C compiler. The
- advantage is that the whole of rabbitmq-c can be built under
- Windows, including the tools.
-
-- Build using Microsoft's C compiler. You will still need to install
- MinGW/MSYS in order to run the rabbitmq-c build scripts, but
- Microsoft's compiler is used to compile the code. The resulting
- librabbitmq DLL can be used from code compiled with Microsoft's C
- compiler (i.e. code developed in Visual Studio). The downside to
- this approach is that the rabbitmq-c tools cannot be built, due to
- dependencies on other libraries.
-
-- Build using CMake, which will cover building with MSVC or MinGW
- See the README file for details on how to build with cmake.
-
-
-## Common steps
-
-With either of the approaches, the initial steps are the same: You
-should download and install MinGW/MSYS and Python.
-
-Installing installing the relevant parts of MinGW/MSYS can be fairly
-time consuming - there are dozens of files to be downloaded and
-unpacked. To make it easier, we provide a bash script that automates
-this process, in `rabbitmq-c/etc/install-mingw.sh`. You can run this
-script under cygwin or Linux (obviously if you use Linux you'll need
-to transfer the resulting files over to the Windows machine).
-
-Note that some MinGW packages are .tar.lzma files, so it requires a
-system with the xz compression utility and a tar that supports the -J
-option. Recent cygwin and Linux distros should be fine here.
-
-Run the install-mingw.sh script specifying the destination directory,
-e.g.
-
- $ etc/install-mingw.sh mingw
-
-This will download all the required MinGW/MSYS packages, and unpack
-them into the `mingw` directory.
-
-The other prerequisite for the rabbitmq-c build is Python. The
-Windows installer from python.org for the latest 2.x version of Python
-will do fine.
-
-You will also need to copy the source code for rabbitmq-c and
-rabbitmq-codegen somewhere under your `mingw` directory.
-
-Then to start the MSYS bash shell, open a `cmd` window, and ensure
-that both the MinGW bin directory and the python install directory are
-in the path, e.g.
-
- C:\>set PATH=%PATH%;C:\mingw\bin;C:\Python27
-
-Then start bash, and run the following mount command (substituting the
-Windows path of your MinGW install if it isn't `C:\mingw`):
-
- C:\>bash
- bash-3.1$ mount 'C:\mingw' /mingw
-
-Finally, go to wherever you copied the rabbitmq-c source.
-
- bash-3.1$ cd /rabbitmq-c
-
-
-## Building rabbitmq-c with Microsoft's C compiler
-
-The Microsoft C/C++ compiler is part of MS Visual Studio, including
-the gratis Visual Studio Express. Visual Studio 2005 and higher are
-known to work.
-
-Start by following the steps in the previous section. The GNU build
-tools have limited support for Microsoft toolchain, but the
-install-mingw.sh script will install versions of the packages that are
-known to be suitable. In particular, only libtool version 2.2.7a is
-known to work; later versions have been reported to introduce
-problems.
-
-Once you are at the bash prompt, build rabbitmq-c by running the
-script in `rabbitmq-c/etc/build-ms.sh`:
-
- bash-3.1$ etc/build-ms.sh
-
-You should end up with a directory `build` containing the librabbitmq
-DLL, the corresponding .lib file, and header files. These are
-sufficient to create applications using librabbitmq within Visual
-Studio.
-
-build-ms.sh produces 32-bit binaries by default. If you have an
-appropriate version of Visual Studio (e.g. VS2010), you can build
-64-bit binaries with:
-
- bash-3.1$ etc/build-ms.sh --enable-64-bit
-
-
-## Building rabbitmq-c with gcc
-
-There is no script to build rabbitmq-c with gcc, but it is as
-documented in the README file:
-
- bash-3.1$ autoreconf -i && ./configure && make
-
-You can run the resulting tool EXEs without needing the rest of MinGW. To do
-this, copy the following files into a single directory:
-
-- rabbitmq-c/tools/.libs/*.exe
-
-- rabbitmq-c/librabbitmq/.libs/librabbitmq-0.dll
-
-- /bin/libpopt-0.dll
-
-- /bin/libiconv-2.dll
-
-- /bin/libintl-8.dll
-
-
View
8 THANKS
@@ -1,8 +0,0 @@
-Thank-you to the following people for their contributions to the
-codebase:
-
- - Scott Brooks / Epic Advertising <scott.brooks@epicadvertising.com>
-
- - Frank Gönninger <frank.goenninger@consequor.de>
-
- - Daniel Schauenberg <d@unwiredcouch.com>
View
9 TODO
@@ -1,9 +0,0 @@
-Deal with version-mismatch-header received from the server
-
-Cope with unknown frame types better. Currently it gets horribly
-confused about frame lengths.
-
-Make client brutal by default, killing the program on any amqp
-error. Only if the user disables this behaviour will the user get to
-deal with error conditions themselves. Make use of amqp_rpc_reply
-consistent (i.e. universal), and rename it something like amqp_errno.
View
28 TestCInline.cmake
@@ -1,28 +0,0 @@
-#Inspired from http://www.cmake.org/Wiki/CMakeTestInline
-
-IF(NOT DEFINED C_INLINE_DETECTED)
-
- SET(INLINE_TEST_SRC "/* Inspired by autoconf's c.m4 */
-static inline int static_foo() {return 0\;}
-int main(int argc, char *argv[]){return 0\;}
-")
-
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c ${INLINE_TEST_SRC})
-
- FOREACH(KEYWORD "inline" "__inline__" "__inline")
- IF(NOT DEFINED C_INLINE)
- TRY_COMPILE(C_HAS_${KEYWORD}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/CMakeTestCInline.c
- COMPILE_DEFINITIONS "-Dinline=${KEYWORD}"
- )
- IF(C_HAS_${KEYWORD})
- SET(C_INLINE ${KEYWORD})
- ENDIF(C_HAS_${KEYWORD})
- ENDIF(NOT DEFINED C_INLINE)
- ENDFOREACH(KEYWORD)
-
- SET(C_INLINE_DETECTED True CACHE BOOL INTERNAL)
-
-ENDIF(NOT DEFINED C_INLINE_DETECTED)
-
View
18 cmake/FindPOPT.cmake
@@ -1,18 +0,0 @@
-INCLUDE(LibFindMacros)
-
-# Find the include directories
-FIND_PATH(POPT_INCLUDE_DIR
- NAMES popt.h
- HINTS ${POPT_PREFIX}/include
- )
-
-FIND_LIBRARY(POPT_LIBRARY
- NAMES popt
- HINTS ${POPT_PREFIX}/lib
- )
-
-SET(POPT_PROCESS_INCLUDES POPT_INCLUDE_DIR)
-SET(POPT_PROCESS_LIBS POPT_LIBRARY)
-
-LIBFIND_PROCESS(POPT)
-
View
99 cmake/LibFindMacros.cmake
@@ -1,99 +0,0 @@
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
-macro (libfind_package PREFIX)
- set (LIBFIND_PACKAGE_ARGS ${ARGN})
- if (${PREFIX}_FIND_QUIETLY)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
- endif (${PREFIX}_FIND_QUIETLY)
- if (${PREFIX}_FIND_REQUIRED)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
- endif (${PREFIX}_FIND_REQUIRED)
- find_package(${LIBFIND_PACKAGE_ARGS})
-endmacro (libfind_package)
-
-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- include(UsePkgConfig)
- pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- find_package(PkgConfig)
- if (PKG_CONFIG_FOUND)
- pkg_check_modules(${PREFIX} ${PKGNAME})
- endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
-
-# Do the final processing once the paths have been detected.
-# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
-# all the variables, each of which contain one include directory.
-# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
-# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
-# Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
- # Skip processing if already processed during this run
- if (NOT ${PREFIX}_FOUND)
- # Start with the assumption that the library was found
- set (${PREFIX}_FOUND TRUE)
-
- # Process all includes and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_INCLUDES})
- if (${i})
- set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Process all libraries and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_LIBS})
- if (${i})
- set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Print message and/or exit on fatal error
- if (${PREFIX}_FOUND)
- if (NOT ${PREFIX}_FIND_QUIETLY)
- message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
- endif (NOT ${PREFIX}_FIND_QUIETLY)
- else (${PREFIX}_FOUND)
- if (${PREFIX}_FIND_REQUIRED)
- foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
- message("${i}=${${i}}")
- endforeach (i)
- message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
- endif (${PREFIX}_FIND_REQUIRED)
- endif (${PREFIX}_FOUND)
- endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
- set(TMP "")
- if(MSVC80)
- set(TMP -vc80)
- endif(MSVC80)
- if(MSVC90)
- set(TMP -vc90)
- endif(MSVC90)
- set(${PREFIX}_LIBNAMES ${basename}${TMP})
- if(${ARGC} GREATER 2)
- set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
- string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
- set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
- endif(${ARGC} GREATER 2)
- find_library(${PREFIX}_LIBRARY
- NAMES ${${PREFIX}_LIBNAMES}
- PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
- )
-endmacro(libfind_library)
-
View
166 configure.ac
@@ -1,166 +0,0 @@
-AC_INIT([librabbitmq],[0.0.1],[support@rabbitmq.com])
-AC_CONFIG_SRCDIR(librabbitmq/codegen.py)
-AM_INIT_AUTOMAKE
-
-AC_CONFIG_HEADER([config.h])
-
-dnl Program checks
-AC_GNU_SOURCE
-AC_PROG_CC
-
-dnl Library checks
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-
-dnl Header-file checks
-AC_HEADER_STDC
-
-if test "x$GCC" = "xyes"; then
- dnl Only use -Wall if we have gcc
- if ! echo "$CFLAGS" | grep "\-Wall" 2> /dev/null ; then
- CFLAGS="$CFLAGS -Wall"
- fi
-fi
-
-dnl Detect the kind of host we're building for
-AC_CANONICAL_HOST
-windows=no
-case "${host}" in
-*-*-mingw*)
- windows=yes
- ;;
-esac
-AM_CONDITIONAL(WINDOWS, test "x$windows" = xyes)
-AS_IF([test "x$windows" = xyes],
- [AC_DEFINE([WINDOWS], [1], [Define to 1 if on Windows.])]
-)
-
-AM_CONDITIONAL(GCC, test "x$GCC" = xyes)
-
-# Detect how to declare inline functions. Because we will sometimes
-# use "-ansi -pedantic" with gcc, we need to make sure the result will
-# work in that context.
-orig_cflags="$CFLAGS"
-AS_IF([test "x$GCC" = "xyes"], [CFLAGS="$CFLAGS -ansi -pedantic"])
-AC_C_INLINE
-CFLAGS="$orig_cflags"
-
-AC_C_BIGENDIAN
-
-dnl Decide which API abstraction layer to use
-PLATFORM_DIR=unix
-if test "x$windows" = xyes ; then
- PLATFORM_DIR=windows
-fi
-AC_SUBST(PLATFORM_DIR)
-
-dnl Enable -m64 if we were asked to do so
-AC_ARG_ENABLE(64-bit,
-[ --enable-64-bit produce 64-bit library],
-[CFLAGS="$CFLAGS -m64"; LDFLAGS="$LDFLAGS -m64"],
-)
-
-AC_MSG_CHECKING(location of AMQP codegen directory)
-for d in ../rabbitmq-codegen codegen ; do
- AMQP_CODEGEN_DIR="$d"
- test -d "$srcdir/$AMQP_CODEGEN_DIR" && break
-done
-AMQP_SPEC_JSON_PATH="$AMQP_CODEGEN_DIR/amqp-rabbitmq-0.9.1.json"
-
-if test -f "$srcdir/$AMQP_SPEC_JSON_PATH"
-then
- AC_MSG_RESULT($AMQP_CODEGEN_DIR)
-else
- AC_MSG_ERROR(could not find AMQP spec file at "'$AMQP_SPEC_JSON_PATH'")
-fi
-
-AC_MSG_CHECKING(finding a python with simplejson installed)
-found_python=no
-checkPython() {
- if test "$found_python" = "yes"
- then
- return
- fi
- PYTHON=$1
- if $PYTHON -c 'import json' 2>/dev/null \
- || $PYTHON -c 'import simplejson' 2>/dev/null
- then
- found_python=yes
- AC_MSG_RESULT($PYTHON)
- fi
-}
-checkPython python
-checkPython python2.6
-checkPython python2.5
-if test "$found_python" = "no"
-then
- AC_MSG_ERROR(could not find a python that can 'import simplejson')
-fi
-
-AC_SUBST(AMQP_CODEGEN_DIR)
-AC_SUBST(AMQP_SPEC_JSON_PATH)
-AC_SUBST(PYTHON)
-
-dnl Decide which extra win32 libs we need, and handle other special
-dnl cases when building with the Microsoft compiler
-EXTRA_LIBS=
-USE_MISINTTYPES=
-AS_IF([test "x$windows" = xyes],
- [
- AS_IF([test "x$GCC" = xyes],
- [EXTRA_LIBS="-lws2_32 $EXTRA_LIBS"],
- [
- EXTRA_LIBS="ws2_32.lib $EXTRA_LIBS"
- USE_MSINTTYPES=yes
- ])
- ])
-
-AC_SUBST(EXTRA_LIBS)
-AM_CONDITIONAL(USE_MSINTTYPES, test "x$USE_MSINTTYPES" != "x")
-
-dnl Check for libpopt, which we need to build the tools
-AC_ARG_WITH([popt],
- [AS_HELP_STRING([--with-popt], [use the popt library. Needed for tools.])],
- [],
- [with_popt=check])
-
-LIBPOPT=
-AS_IF([test "x$with_popt" != xno],
- [AC_CHECK_LIB([popt], [poptGetContext],
- [AC_SUBST([LIBPOPT], ["-lpopt"])
- AC_DEFINE([HAVE_LIBPOPT], [1], [Define if you have libpopt])
- ],
- [if test "x$with_popt" != xcheck; then
- AC_MSG_FAILURE([--with-popt was given, but test for libpopt failed])
- fi
- ])])
-
-AS_IF([test "x$LIBPOPT" != "x"],
- [AC_CHECK_HEADER([popt.h], [],
- [AC_MSG_FAILURE([You have libpopt, but could not find the popt.h header])])
- ])
-
-AM_CONDITIONAL(TOOLS, test "x$LIBPOPT" != "x")
-
-AC_ARG_WITH([xmlto],
- [AS_HELP_STRING([--with-xmlto], [use the xmlto toolchain. Needed for tools man pages.])],
- [],
- [with_xmlto=check])
-
-XMLTO=
-AS_IF([test "x$with_xmlto" != xno],
- [AC_CHECK_PROG([XMLTO], [xmlto], [xmlto])
- if test "x$with_xmlto" != xcheck; then
- AC_MSG_FAILURE([--with-xmlto was given, but xmlto not found])
- fi])
-
-AM_CONDITIONAL(TOOLS_DOC, test "x$XMLTO" != "x")
-
-AC_OUTPUT(
-Makefile
-librabbitmq/Makefile
-tests/Makefile
-examples/Makefile
-tools/Makefile
-tools/doc/Makefile
-)
View
1  debian/amqp-tools.docs
@@ -1 +0,0 @@
-LICENSE-MIT
View
3  debian/amqp-tools.install
@@ -1,3 +0,0 @@
-debian/tmp/usr/bin/* usr/bin
-debian/tmp/usr/share/man/man1/* usr/share/man/man1
-debian/tmp/usr/share/man/man7/* usr/share/man/man7
View
5 debian/changelog
@@ -1,5 +0,0 @@
-librabbitmq (1.0-1) unstable; urgency=low
-
- * Initial release
-
- -- Tony Garnock-Jones <tonygarnockjones@gmail.com> Tue, 14 Jul 2009 04:42:37 +0100
View
1  debian/compat
@@ -1 +0,0 @@
-5
View
29 debian/control
@@ -1,29 +0,0 @@
-Source: librabbitmq
-Section: libs
-Priority: extra
-Maintainer: Tony Garnock-Jones <tonygarnockjones@gmail.com>
-Build-Depends: debhelper (>= 7), autoconf, automake, libtool, python (>= 2.5), python-simplejson, libpopt-dev, xmlto
-Standards-Version: 3.8.1
-Homepage: http://www.rabbitmq.com/
-Vcs-Browser: http://hg.rabbitmq.com/rabbitmq-c
-
-Package: librabbitmq
-Architecture: any
-Section: libs
-Priority: extra
-Depends:
-Description: An AMQP client library written in C
-
-Package: librabbitmq-dev
-Architecture: any
-Section: libdevel
-Priority: extra
-Depends: librabbitmq (= ${binary:Version}), libc-dev
-Description: developer's libraries and docs for librabbitmq
-
-Package: amqp-tools
-Architecture: any
-Section: net
-Priority: extra
-Depends: librabbitmq (= ${binary:Version}), ${shlibs:Depends}
-Description: Command-line utilities for interacting with AMQP servers
View
17 debian/copyright
@@ -1,17 +0,0 @@
-This package was debianized by Tony Garnock-Jones
-<tonygarnockjones@gmail.com> on Tue, 14 Jul 2009 04:42:37 +0100.
-
-Upstream Author: The RabbitMQ team at VMware, Inc. <info@rabbitmq.net>
-
-Copyright: Portions created by VMware are Copyright (c) 2007-2012
-VMware, Inc. All Rights Reserved. Portions created by Tony
-Garnock-Jones are Copyright (c) 2009-2010 VMware, Inc. and Tony
-Garnock-Jones. All Rights Reserved.
-
-License: This package, librabbitmq, the RabbitMQ C client, is licensed
-under the MIT. For the license, please see LICENSE-MIT. Please see
-also the license block near the top of each source file in the
-package.
-
-If you have any questions regarding licensing, please contact us at
-info@rabbitmq.com.
View
1  debian/librabbitmq-dev.docs
@@ -1 +0,0 @@
-LICENSE-MIT
View
4 debian/librabbitmq-dev.install
@@ -1,4 +0,0 @@
-debian/tmp/usr/include/*.h usr/include
-debian/tmp/usr/lib/*.a usr/lib
-debian/tmp/usr/lib/*.la usr/lib
-debian/tmp/usr/lib/*.so usr/lib
View
1  debian/librabbitmq.docs
@@ -1 +0,0 @@
-LICENSE-MIT
View
1  debian/librabbitmq.install
@@ -1 +0,0 @@
-debian/tmp/usr/lib/*.so.* usr/lib
View
24 debian/rules
@@ -1,24 +0,0 @@
-#!/usr/bin/make -f
-
-build: build-stamp
-build-stamp:
- dh build
- touch build-stamp
-
-clean:
- dh clean
- rm -f build-stamp
- rm -f install-stamp
-
-install: build install-stamp
-install-stamp:
- dh install
- touch install-stamp
-
-binary-arch: install
- dh binary-arch
-
-binary-indep: install
- dh binary-indep
-
-binary: binary-arch binary-indep
View
78 etc/build-ms.sh
@@ -1,78 +0,0 @@
-#!/bin/bash
-
-# Build rabbitmq-c using Microsoft's C compiler
-
-set -e
-
-vs64=
-sdk64=
-
-while [ $# -gt 0 ] ; do
- case $1 in
- --enable-64-bit)
- vs64=/amd64
- sdk64=/x64
- ;;
- *)
- echo "Usage: build-ms.sh [ --enable-64-bit ]" 1>&2
- exit 1
- esac
- shift
-done
-
-# Locate the necessary lib and include directories
-
-drive=$(echo "$SYSTEMDRIVE" | sed 's|^\([A-Za-z]\):$|/\1|')
-
-for vsvers in 10.0 9.0 8 ; do
- vsdir="$drive/Program Files/Microsoft Visual Studio $vsvers"
- [ -x "$vsdir/VC/bin$vs64/cl.exe" ] && break
-
- vsdir="$drive/Program Files (x86)/Microsoft Visual Studio $vsvers"
- [ -x "$vsdir/VC/bin$vs64/cl.exe" ] && break
-
- vsdir=
-done
-
-if [ -z "$vsdir" ] ; then
- echo "Couldn't find a suitable Visual Studio installation"
- exit 1
-fi
-
-echo "Using Visual Studio install at $vsdir"
-
-for sdkpath in "Microsoft SDKs/Windows/"{v7.0A,v6.0A} "Microsoft Visual Studio 8/VC/PlatformSDK" ; do
- sdkdir="$drive/Program Files/$sdkpath"
- [ -d "$sdkdir/lib$sdk64" -a -d "$sdkdir/include" ] && break
-
- sdkdir="$drive/Program Files (x86)/$sdkpath"
- [ -d "$sdkdir/lib$sdk64" -a -d "$sdkdir/include" ] && break
-
- sdkdir=
-done
-
-if [ -z "$sdkdir" ] ; then
- echo "Couldn't find suitable Windows SDK installation"
- exit 1
-fi
-
-echo "Using Windows SDK install at $sdkdir"
-
-PATH="$PATH:$vsdir/VC/bin$vs64:$vsdir/Common7/IDE"
-LIB="$vsdir/VC/lib$vs64:$sdkdir/lib$sdk64"
-INCLUDE="$vsdir/VC/include:$sdkdir/include"
-export PATH LIB INCLUDE
-
-# Do the build
-set -x
-autoreconf -i
-./configure CC=cl.exe LD=link.exe CFLAGS='-nologo'
-sed -i -e 's/^fix_srcfile_path=.*$/fix_srcfile_path=""/;s/^deplibs_check_method=.*$/deplibs_check_method=pass_all/;/^archive_cmds=/s/-link -dll/& -implib:\\$libname.\\$libext/' libtool
-make
-
-# Copy the results of the build into one place, as "make install"
-# isn't too useful here.
-mkdir -p build/lib build/include build/bin
-cp -a librabbitmq/.libs/*.dll examples/.libs/*.exe build/bin
-cp -a msinttypes/*.h librabbitmq/amqp.h librabbitmq/amqp_framing.h build/include
-cp -a librabbitmq/*.exp librabbitmq/*.lib build/lib
View
78 etc/install-mingw.sh
@@ -1,78 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ] ; then
- echo "usage: install-mingw.sh <destination directory>" 1>&2
- exit 1
-fi
-
-unpack_dir=$1
-
-if [ -e "$unpack_dir" ] ; then
- echo "Destination directory already exists; please delete it if you are sure" 1>&2
- exit 1
-fi
-
-set -e
-
-download_dir=/tmp/install-mingw.$$
-mkdir -p $download_dir $unpack_dir
-
-while read f ; do
- wget -P $download_dir -N http://switch.dl.sourceforge.net/project/mingw/$f
-done <<EOF
-MinGW/Base/mpc/mpc-0.8.1-1/libmpc-0.8.1-1-mingw32-dll-2.tar.lzma
-MinGW/Base/gcc/Version4/gcc-4.5.0-1/gcc-core-4.5.0-1-mingw32-bin.tar.lzma
-MinGW/Base/gcc/Version4/gcc-4.5.0-1/libgcc-4.5.0-1-mingw32-dll-1.tar.lzma
-MSYS/Base/msys-core/msys-1.0.14-1/msysCORE-1.0.14-1-msys-1.0.14-bin.tar.lzma
-MinGW/Base/binutils/binutils-2.20.1/binutils-2.20.1-2-mingw32-bin.tar.gz
-MinGW/Base/mingw-rt/mingwrt-3.18/mingwrt-3.18-mingw32-dll.tar.gz
-MinGW/Base/mingw-rt/mingwrt-3.18/mingwrt-3.18-mingw32-dev.tar.gz
-MinGW/Base/pthreads-w32/pthreads-w32-2.8.0-3/libpthread-2.8.0-3-mingw32-dll-2.tar.lzma
-MinGW/Base/mpfr/mpfr-2.4.1-1/libmpfr-2.4.1-1-mingw32-dll-1.tar.lzma
-MinGW/Base/gmp/gmp-5.0.1-1/libgmpxx-5.0.1-1-mingw32-dll-4.tar.lzma
-MinGW/Base/gmp/gmp-5.0.1-1/libgmp-5.0.1-1-mingw32-dll-10.tar.lzma
-MinGW/Base/w32api/w32api-3.14/w32api-3.14-mingw32-dev.tar.gz
-MSYS/Base/make/make-3.81-2/make-3.81-2-msys-1.0.11-bin.tar.lzma
-MSYS/Base/bash/bash-3.1.17-2/bash-3.1.17-2-msys-1.0.11-bin.tar.lzma
-MSYS/Base/coreutils/coreutils-5.97-2/coreutils-5.97-2-msys-1.0.11-bin.tar.lzma
-MinGW/Extension/popt/popt-1.15-1/libpopt-1.15-1-mingw32-dll-0.tar.lzma
-MinGW/Extension/popt/popt-1.15-1/libpopt-1.15-1-mingw32-dev.tar.lzma
-MSYS/Base/diffutils/diffutils-2.8.7.20071206cvs-2/diffutils-2.8.7.20071206cvs-2-msys-1.0.11-bin.tar.lzma
-MSYS/Base/gawk/gawk-3.1.7-1/gawk-3.1.7-1-msys-1.0.11-bin.tar.lzma
-MSYS/Base/grep/grep-2.5.4-1/grep-2.5.4-1-msys-1.0.11-bin.tar.lzma
-MSYS/Base/sed/sed-4.2.1-1/sed-4.2.1-1-msys-1.0.11-bin.tar.lzma
-MSYS/msysdev/libtool/libtool-2.2.7a-2/libtool-2.2.7a-2-msys-1.0.13-bin.tar.lzma
-MinGW/Base/gettext/gettext-0.17-1/libintl-0.17-1-mingw32-dll-8.tar.lzma
-MinGW/Base/gettext/gettext-0.17-1/gettext-0.17-1-mingw32-dev.tar.lzma
-MinGW/Base/libiconv/libiconv-1.13.1-1/libiconv-1.13.1-1-mingw32-dll-2.tar.lzma
-MinGW/Base/libiconv/libiconv-1.13.1-1/libiconv-1.13.1-1-mingw32-dev.tar.lzma
-MinGW/Base/libiconv/libiconv-1.13.1-1/libcharset-1.13.1-1-mingw32-dll-1.tar.lzma
-MSYS/msysdev/autoconf/autoconf-2.65-1/autoconf-2.65-1-msys-1.0.13-bin.tar.lzma
-MSYS/msysdev/automake/automake-1.11.1-1/automake-1.11.1-1-msys-1.0.13-bin.tar.lzma
-MSYS/Extension/m4/m4-1.4.14-1/m4-1.4.14-1-msys-1.0.13-bin.tar.lzma
-MSYS/Base/tar/tar-1.23-1/tar-1.23-1-msys-1.0.13-bin.tar.lzma
-MSYS/Base/regex/regex-1.20090805-2/libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma
-MSYS/Base/libiconv/libiconv-1.13.1-2/libiconv-1.13.1-2-msys-1.0.13-dll-2.tar.lzma
-MSYS/Base/gettext/gettext-0.17-2/libintl-0.17-2-msys-dll-8.tar.lzma
-MSYS/Extension/perl/perl-5.6.1_2-2/perl-5.6.1_2-2-msys-1.0.13-bin.tar.lzma
-MSYS/Extension/crypt/crypt-1.1_1-3/libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma
-EOF
-
-for f in $download_dir/* ; do
- case $f in
- *.tar.gz)
- tar -C $unpack_dir -xzf $f
- ;;
-
- *.tar.lzma)
- tar -C $unpack_dir -xJf $f
- ;;
-
- *)
- echo "Don't know how to unpack $f" 1>&2
- exit 1
- ;;
- esac
-done
-
-rm -rf $download_dir
View
37 examples/CMakeLists.txt
@@ -1,37 +0,0 @@
-include_directories(${librabbitmq_SOURCE_DIR} ${librabbitmq_BINARY_DIR})
-
-if (WIN32)
- set(PLATFORM_DIR windows)
-else (WIN32)
- set(PLATFORM_DIR unix)
-endif (WIN32)
-
-set(COMMON_SRCS
- utils.h
- utils.c
- ${PLATFORM_DIR}/platform_utils.c
- )
-
-add_executable(amqp_sendstring amqp_sendstring.c ${COMMON_SRCS})
-target_link_libraries(amqp_sendstring rabbitmq)
-
-add_executable(amqp_exchange_declare amqp_exchange_declare.c ${COMMON_SRCS})
-target_link_libraries(amqp_exchange_declare rabbitmq)
-
-add_executable(amqp_listen amqp_listen.c ${COMMON_SRCS})
-target_link_libraries(amqp_listen rabbitmq)
-
-add_executable(amqp_producer amqp_producer.c ${COMMON_SRCS})
-target_link_libraries(amqp_producer rabbitmq)
-
-add_executable(amqp_consumer amqp_consumer.c ${COMMON_SRCS})
-target_link_libraries(amqp_consumer rabbitmq)
-
-add_executable(amqp_unbind amqp_unbind.c ${COMMON_SRCS})
-target_link_libraries(amqp_unbind rabbitmq)
-
-add_executable(amqp_bind amqp_bind.c ${COMMON_SRCS})
-target_link_libraries(amqp_bind rabbitmq)
-
-add_executable(amqp_listenq amqp_listenq.c ${COMMON_SRCS})
-target_link_libraries(amqp_listenq rabbitmq)
View
33 examples/Makefile.am
@@ -1,33 +0,0 @@
-noinst_PROGRAMS = amqp_sendstring amqp_exchange_declare amqp_listen amqp_producer amqp_consumer amqp_unbind amqp_bind amqp_listenq
-
-# 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$(top_builddir)/librabbitmq
-
-if GCC
-# Because we want to build under Microsoft's C compiler (for which
-# there is apparently no demand for C99 support), it's a good idea
-# to have gcc tell us when we stray from the old standard.
-AM_CFLAGS += -ansi -pedantic
-endif
-
-if USE_MSINTTYPES
-AM_CFLAGS += -I$(top_srcdir)/msinttypes
-endif
-
-AM_LDFLAGS = $(top_builddir)/librabbitmq/librabbitmq.la
-
-noinst_HEADERS = utils.h
-
-COMMON_SOURCES = utils.c $(PLATFORM_DIR)/platform_utils.c
-
-amqp_sendstring_SOURCES = amqp_sendstring.c $(COMMON_SOURCES)
-amqp_exchange_declare_SOURCES = amqp_exchange_declare.c $(COMMON_SOURCES)
-amqp_listen_SOURCES = amqp_listen.c $(COMMON_SOURCES)
-amqp_producer_SOURCES = amqp_producer.c $(COMMON_SOURCES)
-amqp_consumer_SOURCES = amqp_consumer.c $(COMMON_SOURCES)
-amqp_unbind_SOURCES = amqp_unbind.c $(COMMON_SOURCES)
-amqp_bind_SOURCES = amqp_bind.c $(COMMON_SOURCES)
-amqp_listenq_SOURCES = amqp_listenq.c $(COMMON_SOURCES)
View
84 examples/amqp_bind.c
@@ -1,84 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include "utils.h"
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *exchange;
- char const *bindingkey;
- char const *queue;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- if (argc < 6) {
- fprintf(stderr, "Usage: amqp_bind host port exchange bindingkey queue\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- exchange = argv[3];
- bindingkey = argv[4];
- queue = argv[5];
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- amqp_queue_bind(conn, 1,
- amqp_cstring_bytes(queue),
- amqp_cstring_bytes(exchange),
- amqp_cstring_bytes(bindingkey),
- amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Unbinding");
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
- return 0;
-}
View
171 examples/amqp_consumer.c
@@ -1,171 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include <assert.h>
-
-#include "utils.h"
-
-#define SUMMARY_EVERY_US 1000000
-
-static void run(amqp_connection_state_t conn)
-{
- uint64_t start_time = now_microseconds();
- int received = 0;
- int previous_received = 0;
- uint64_t previous_report_time = start_time;
- uint64_t next_summary_time = start_time + SUMMARY_EVERY_US;
-
- amqp_frame_t frame;
- int result;
- size_t body_received;
- size_t body_target;
-
- uint64_t now;
-
- while (1) {
- now = now_microseconds();
- if (now > next_summary_time) {
- int countOverInterval = received - previous_received;
- double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0);
- printf("%d ms: Received %d - %d since last report (%d Hz)\n",
- (int)(now - start_time) / 1000, received, countOverInterval, (int) intervalRate);
-
- previous_received = received;
- previous_report_time = now;
- next_summary_time += SUMMARY_EVERY_US;
- }
-
- amqp_maybe_release_buffers(conn);
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- return;
-
- if (frame.frame_type != AMQP_FRAME_METHOD)
- continue;
-
- if (frame.payload.method.id != AMQP_BASIC_DELIVER_METHOD)
- continue;
-
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- return;
-
- if (frame.frame_type != AMQP_FRAME_HEADER) {
- fprintf(stderr, "Expected header!");
- abort();
- }
-
- body_target = frame.payload.properties.body_size;
- body_received = 0;
-
- while (body_received < body_target) {
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- return;
-
- if (frame.frame_type != AMQP_FRAME_BODY) {
- fprintf(stderr, "Expected body!");
- abort();
- }
-
- body_received += frame.payload.body_fragment.len;
- assert(body_received <= body_target);
- }
-
- received++;
- }
-}
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *exchange;
- char const *bindingkey;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- amqp_bytes_t queuename;
-
- if (argc < 3) {
- fprintf(stderr, "Usage: amqp_consumer host port\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- exchange = "amq.direct"; /* argv[3]; */
- bindingkey = "test queue"; /* argv[4]; */
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- {
- amqp_queue_declare_ok_t *r = amqp_queue_declare(conn, 1, amqp_empty_bytes, 0, 0, 0, 1,
- amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring queue");
- queuename = amqp_bytes_malloc_dup(r->queue);
- if (queuename.bytes == NULL) {
- fprintf(stderr, "Out of memory while copying queue name");
- return 1;
- }
- }
-
- amqp_queue_bind(conn, 1, queuename, amqp_cstring_bytes(exchange), amqp_cstring_bytes(bindingkey),
- amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
-
- amqp_basic_consume(conn, 1, queuename, amqp_empty_bytes, 0, 1, 0, amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
-
- run(conn);
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
-
- return 0;
-}
View
79 examples/amqp_exchange_declare.c
@@ -1,79 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include "utils.h"
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *exchange;
- char const *exchangetype;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- if (argc < 5) {
- fprintf(stderr, "Usage: amqp_exchange_declare host port exchange exchangetype\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- exchange = argv[3];
- exchangetype = argv[4];
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- amqp_exchange_declare(conn, 1, amqp_cstring_bytes(exchange), amqp_cstring_bytes(exchangetype),
- 0, 0, amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange");
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
- return 0;
-}
View
171 examples/amqp_listen.c
@@ -1,171 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include <assert.h>
-
-#include "utils.h"
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *exchange;
- char const *bindingkey;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- amqp_bytes_t queuename;
-
- if (argc < 5) {
- fprintf(stderr, "Usage: amqp_listen host port exchange bindingkey\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- exchange = argv[3];
- bindingkey = argv[4];
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- {
- amqp_queue_declare_ok_t *r = amqp_queue_declare(conn, 1, amqp_empty_bytes, 0, 0, 0, 1,
- amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring queue");
- queuename = amqp_bytes_malloc_dup(r->queue);
- if (queuename.bytes == NULL) {
- fprintf(stderr, "Out of memory while copying queue name");
- return 1;
- }
- }
-
- amqp_queue_bind(conn, 1, queuename, amqp_cstring_bytes(exchange), amqp_cstring_bytes(bindingkey),
- amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding queue");
-
- amqp_basic_consume(conn, 1, queuename, amqp_empty_bytes, 0, 1, 0, amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
-
- {
- amqp_frame_t frame;
- int result;
-
- amqp_basic_deliver_t *d;
- amqp_basic_properties_t *p;
- size_t body_target;
- size_t body_received;
-
- while (1) {
- amqp_maybe_release_buffers(conn);
- result = amqp_simple_wait_frame(conn, &frame);
- printf("Result %d\n", result);
- if (result < 0)
- break;
-
- printf("Frame type %d, channel %d\n", frame.frame_type, frame.channel);
- if (frame.frame_type != AMQP_FRAME_METHOD)
- continue;
-
- printf("Method %s\n", amqp_method_name(frame.payload.method.id));
- if (frame.payload.method.id != AMQP_BASIC_DELIVER_METHOD)
- continue;
-
- d = (amqp_basic_deliver_t *) frame.payload.method.decoded;
- printf("Delivery %u, exchange %.*s routingkey %.*s\n",
- (unsigned) d->delivery_tag,
- (int) d->exchange.len, (char *) d->exchange.bytes,
- (int) d->routing_key.len, (char *) d->routing_key.bytes);
-
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- break;
-
- if (frame.frame_type != AMQP_FRAME_HEADER) {
- fprintf(stderr, "Expected header!");
- abort();
- }
- p = (amqp_basic_properties_t *) frame.payload.properties.decoded;
- if (p->_flags & AMQP_BASIC_CONTENT_TYPE_FLAG) {
- printf("Content-type: %.*s\n",
- (int) p->content_type.len, (char *) p->content_type.bytes);
- }
- printf("----\n");
-
- body_target = frame.payload.properties.body_size;
- body_received = 0;
-
- while (body_received < body_target) {
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- break;
-
- if (frame.frame_type != AMQP_FRAME_BODY) {
- fprintf(stderr, "Expected body!");
- abort();
- }
-
- body_received += frame.payload.body_fragment.len;
- assert(body_received <= body_target);
-
- amqp_dump(frame.payload.body_fragment.bytes,
- frame.payload.body_fragment.len);
- }
-
- if (body_received != body_target) {
- /* Can only happen when amqp_simple_wait_frame returns <= 0 */
- /* We break here to close the connection */
- break;
- }
- }
- }
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
-
- return 0;
-}
View
154 examples/amqp_listenq.c
@@ -1,154 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include <assert.h>
-
-#include "utils.h"
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *queuename;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- if (argc < 4) {
- fprintf(stderr, "Usage: amqp_listenq host port queuename\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- queuename = argv[3];
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- amqp_basic_consume(conn, 1, amqp_cstring_bytes(queuename), amqp_empty_bytes, 0, 0, 0, amqp_empty_table);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Consuming");
-
- {
- amqp_frame_t frame;
- int result;
-
- amqp_basic_deliver_t *d;
- amqp_basic_properties_t *p;
- size_t body_target;
- size_t body_received;
-
- while (1) {
- amqp_maybe_release_buffers(conn);
- result = amqp_simple_wait_frame(conn, &frame);
- printf("Result %d\n", result);
- if (result < 0)
- break;
-
- printf("Frame type %d, channel %d\n", frame.frame_type, frame.channel);
- if (frame.frame_type != AMQP_FRAME_METHOD)
- continue;
-
- printf("Method %s\n", amqp_method_name(frame.payload.method.id));
- if (frame.payload.method.id != AMQP_BASIC_DELIVER_METHOD)
- continue;
-
- d = (amqp_basic_deliver_t *) frame.payload.method.decoded;
- printf("Delivery %u, exchange %.*s routingkey %.*s\n",
- (unsigned) d->delivery_tag,
- (int) d->exchange.len, (char *) d->exchange.bytes,
- (int) d->routing_key.len, (char *) d->routing_key.bytes);
-
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- break;
-
- if (frame.frame_type != AMQP_FRAME_HEADER) {
- fprintf(stderr, "Expected header!");
- abort();
- }
- p = (amqp_basic_properties_t *) frame.payload.properties.decoded;
- if (p->_flags & AMQP_BASIC_CONTENT_TYPE_FLAG) {
- printf("Content-type: %.*s\n",
- (int) p->content_type.len, (char *) p->content_type.bytes);
- }
- printf("----\n");
-
- body_target = frame.payload.properties.body_size;
- body_received = 0;
-
- while (body_received < body_target) {
- result = amqp_simple_wait_frame(conn, &frame);
- if (result < 0)
- break;
-
- if (frame.frame_type != AMQP_FRAME_BODY) {
- fprintf(stderr, "Expected body!");
- abort();
- }
-
- body_received += frame.payload.body_fragment.len;
- assert(body_received <= body_target);
-
- amqp_dump(frame.payload.body_fragment.bytes,
- frame.payload.body_fragment.len);
- }
-
- if (body_received != body_target) {
- /* Can only happen when amqp_simple_wait_frame returns <= 0 */
- /* We break here to close the connection */
- break;
- }
-
- amqp_basic_ack(conn, 1, d->delivery_tag, 0);
- }
- }
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
-
- return 0;
-}
View
141 examples/amqp_producer.c
@@ -1,141 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include "utils.h"
-
-#define SUMMARY_EVERY_US 1000000
-
-static void send_batch(amqp_connection_state_t conn,
- char const *queue_name,
- int rate_limit,
- int message_count)
-{
- uint64_t start_time = now_microseconds();
- int i;
- int sent = 0;
- int previous_sent = 0;
- uint64_t previous_report_time = start_time;
- uint64_t next_summary_time = start_time + SUMMARY_EVERY_US;
-
- char message[256];
- amqp_bytes_t message_bytes;
-
- for (i = 0; i < sizeof(message); i++) {
- message[i] = i & 0xff;
- }
-
- message_bytes.len = sizeof(message);
- message_bytes.bytes = message;
-
- for (i = 0; i < message_count; i++) {
- uint64_t now = now_microseconds();
-
- die_on_error(amqp_basic_publish(conn,
- 1,
- amqp_cstring_bytes("amq.direct"),
- amqp_cstring_bytes(queue_name),
- 0,
- 0,
- NULL,
- message_bytes),
- "Publishing");
- sent++;
- if (now > next_summary_time) {
- int countOverInterval = sent - previous_sent;
- double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0);
- printf("%d ms: Sent %d - %d since last report (%d Hz)\n",
- (int)(now - start_time) / 1000, sent, countOverInterval, (int) intervalRate);
-
- previous_sent = sent;
- previous_report_time = now;
- next_summary_time += SUMMARY_EVERY_US;
- }
-
- while (((i * 1000000.0) / (now - start_time)) > rate_limit) {
- microsleep(2000);
- now = now_microseconds();
- }
- }
-
- {
- uint64_t stop_time = now_microseconds();
- int total_delta = stop_time - start_time;
-
- printf("PRODUCER - Message count: %d\n", message_count);
- printf("Total time, milliseconds: %d\n", total_delta / 1000);
- printf("Overall messages-per-second: %g\n", (message_count / (total_delta / 1000000.0)));
- }
-}
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- int rate_limit;
- int message_count;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- if (argc < 5) {
- fprintf(stderr, "Usage: amqp_producer host port rate_limit message_count\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- rate_limit = atoi(argv[3]);
- message_count = atoi(argv[4]);
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- send_batch(conn, "test queue", rate_limit, message_count);
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
- return 0;
-}
View
93 examples/amqp_sendstring.c
@@ -1,93 +0,0 @@
-/*
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MIT
- *
- * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
- * All Rights Reserved.
- *
- * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
- * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- * ***** END LICENSE BLOCK *****
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <stdint.h>
-#include <amqp.h>
-#include <amqp_framing.h>
-
-#include "utils.h"
-
-int main(int argc, char const * const *argv) {
- char const *hostname;
- int port;
- char const *exchange;
- char const *routingkey;
- char const *messagebody;
-
- int sockfd;
- amqp_connection_state_t conn;
-
- if (argc < 6) {
- fprintf(stderr, "Usage: amqp_sendstring host port exchange routingkey messagebody\n");
- return 1;
- }
-
- hostname = argv[1];
- port = atoi(argv[2]);
- exchange = argv[3];
- routingkey = argv[4];
- messagebody = argv[5];
-
- conn = amqp_new_connection();
-
- die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
- amqp_set_sockfd(conn, sockfd);
- die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),
- "Logging in");
- amqp_channel_open(conn, 1);
- die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel");
-
- {
- amqp_basic_properties_t props;
- props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG | AMQP_BASIC_DELIVERY_MODE_FLAG;
- props.content_type = amqp_cstring_bytes("text/plain");
- props.delivery_mode = 2; /* persistent delivery mode */
- die_on_error(amqp_basic_publish(conn,
- 1,
- amqp_cstring_bytes(exchange),
- amqp_cstring_bytes(routingkey),
- 0,
- 0,
- &props,
- amqp_cstring_bytes(messagebody)),
- "Publishing");
- }
-
- die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel");
- die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection");
- die_on_error(amqp_destroy_connection(conn), "Ending connection");
- return 0;
-}
View
84 examples/amqp_unbind.c
@@ -1,84 +0,0 @@
-/* </