Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Released czmq v1.0.0

  • Loading branch information...
commit d5d0ec9058b88a1ad86dc8df066c597fa5042b72 1 parent 2b3431c
@hintjens hintjens authored
Showing with 514 additions and 312 deletions.
  1. +9 −9 .gitignore
  2. +4 −2 NEWS
  3. +47 −46 README.md
  4. +37 −37 README.txt
  5. +5 −5 configure.in
  6. +2 −2 doc/Makefile.am
  7. +9 −9 doc/asciidoc.conf
  8. +44 −44 doc/{libzapi.txt → czmq.txt}
  9. +1 −1  doc/mkman
  10. +4 −4 doc/mksite
  11. +4 −4 doc/xml2wd.pl
  12. +2 −2 doc/zclock.txt
  13. +3 −3 doc/zctx.txt
  14. +1 −1  doc/zframe.txt
  15. +1 −1  doc/zhash.txt
  16. +1 −1  doc/zlist.txt
  17. +1 −1  doc/zloop.txt
  18. +1 −1  doc/zmsg.txt
  19. +4 −4 doc/zsocket.txt
  20. +1 −1  doc/zsockopt.txt
  21. +1 −1  doc/zstr.txt
  22. +1 −1  doc/zthread.txt
  23. BIN  images/README_1.png
  24. BIN  images/README_2.png
  25. +6 −6 include/{zapi.h → czmq.h}
  26. +14 −14 include/{zapi_prelude.h → czmq_prelude.h}
  27. +2 −2 include/zclock.h
  28. +4 −4 include/zctx.h
  29. +2 −2 include/zframe.h
  30. +2 −2 include/zhash.h
  31. +2 −2 include/zlist.h
  32. +2 −2 include/zloop.h
  33. +2 −2 include/zmsg.h
  34. +4 −4 include/zsocket.h
  35. +2 −2 include/zsockopt.h
  36. +2 −2 include/zstr.h
  37. +2 −2 include/zthread.h
  38. +5 −5 sockopts.gsl
  39. +11 −11 src/Makefile.am
  40. +148 −0 src/czmq_selftest
  41. +5 −5 src/{zapi_selftest.c → czmq_selftest.c}
  42. +41 −0 src/libczmq.la
  43. +10 −0 src/libczmq.pc
  44. +3 −3 src/{libzapi.pc.in → libczmq.pc.in}
  45. +3 −3 src/zclock.c
  46. +6 −6 src/zctx.c
  47. +3 −3 src/zframe.c
  48. +3 −3 src/zhash.c
  49. +3 −3 src/zlist.c
  50. +3 −3 src/zloop.c
  51. +3 −3 src/zmsg.c
  52. +4 −4 src/zsocket.c
  53. +3 −3 src/zsockopt.c
  54. +3 −3 src/zstr.c
  55. +3 −3 src/zthread.c
  56. +4 −4 win32/README.txt
  57. +2 −2 win32/{zapi.sln → czmq.sln}
  58. +12 −12 win32/{zapi.vcproj → czmq.vcproj}
  59. +7 −7 win32/{zapi_selftest.vcproj → czmq_selftest.vcproj}
View
18 .gitignore 100755 → 100644
@@ -13,7 +13,7 @@ libtool
src/.deps/
src/Makefile
src/Makefile.in
-src/libzapi.pc
+src/libczmq.pc
src/platform.hpp
src/platform.hpp.in
src/platform.hpp.in~
@@ -21,11 +21,11 @@ src/stamp-h1
src/*.o
src/mtrace.txt
src/outbin
-src/zapi_selftest
+src/czmq_selftest
doc/*.7
doc/*.xml
src/.libs/
-src/libzapi.la
+src/czmq.la
src/platform.h
src/platform.h.in
src/platform.h.in~
@@ -40,9 +40,9 @@ src/core
ipr
*.gz
*.zip
-win32/zapi.ncb
-win32/zapi.vcproj.WS200902.user.user
-win32/zapi_selftest.exe.embed.manifest
-win32/zapi_selftest.exe.embed.manifest.res
-win32/zapi_selftest.exe.intermediate.manifest
-win32/zapi_selftest.vcproj.WS200902.user.user
+win32/czmq.ncb
+win32/czmq.vcproj.WS200902.user.user
+win32/czmq_selftest.exe.embed.manifest
+win32/czmq_selftest.exe.embed.manifest.res
+win32/czmq_selftest.exe.intermediate.manifest
+win32/czmq_selftest.vcproj.WS200902.user.user
View
6 NEWS
@@ -1,11 +1,13 @@
-libzapi version 1.3.3 (stable), released on 2011/04/xx
-======================================================
+czmq version 1.0.0 (stable), released on 2011/04/26
+===================================================
Changes
-------
* At build time, reports error if libzmq version isn't at least 2.1.
+* Renamed project to czmq for coherence with other language bindings.
+
libzapi version 1.3.2 (beta), released on 2011/04/15
====================================================
View
93 README.md
@@ -1,6 +1,7 @@
+Z.set GIT=https://github.com/zeromq/czmq
-<A name="toc1-3" title="libzapi - High-level C binding for ØMQ" />
-# libzapi - High-level C binding for ØMQ
+<A name="toc1-3" title="czmq - High-level C binding for ØMQ" />
+# czmq - High-level C binding for ØMQ
<A name="toc2-6" title="Contents" />
## Contents
@@ -12,7 +13,7 @@
&emsp;<a href="#toc3-68">Ownership and License</a>
&emsp;<a href="#toc3-75">Contributing</a>
-**<a href="#toc2-84">Using libzapi</a>**
+**<a href="#toc2-84">Using czmq</a>**
&emsp;<a href="#toc3-87">Building and Installing</a>
&emsp;<a href="#toc3-108">Linking with an Application</a>
&emsp;<a href="#toc3-115">API Summary</a>
@@ -42,7 +43,7 @@
&emsp;<a href="#toc3-384">Assertions</a>
&emsp;<a href="#toc3-402">Documentation</a>
&emsp;<a href="#toc3-441">Development</a>
-&emsp;<a href="#toc3-451">Porting libzapi</a>
+&emsp;<a href="#toc3-451">Porting czmq</a>
&emsp;<a href="#toc3-464">Code Generation</a>
&emsp;<a href="#toc3-473">This Document</a>
@@ -52,16 +53,16 @@
<A name="toc3-14" title="Scope and Goals" />
### Scope and Goals
-libzapi has these goals:
+czmq has these goals:
* To wrap the ØMQ core API in semantics that are natural and lead to shorter, more readable applications.
-* To hide the differences between versions of ØMQ, particularly 2.0, 2.1, and 3.0.
+* To hide the differences between versions of ØMQ, particularly 2.1 and 3.0.
* To provide a space for development of more sophisticated API semantics.
-libzapi grew out of concepts developed in [ØMQ - The Guide](http://zguide.zeromq.org) and [ZFL](http://zfl.zeromq.org).
+czmq grew out of concepts developed in [ØMQ - The Guide](http://zguide.zeromq.org) and [ZFL](http://zfl.zeromq.org). Until end-April 2011, czmq was known as //libzapi//.
<center>
-<img src="https://github.com/zeromq/libzapi/raw/master/images/README_1.png" alt="1">
+<img src="README_1.png" alt="1">
</center>
<A name="toc3-53" title="Highlights" />
@@ -82,29 +83,29 @@ libzapi grew out of concepts developed in [ØMQ - The Guide](http://zguide.zerom
<A name="toc3-68" title="Ownership and License" />
### Ownership and License
-libzapi is maintained by Pieter Hintjens and Mikko Koppanen (build system). Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
+czmq is maintained by Pieter Hintjens and Mikko Koppanen (build system). Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
-The authors of libzapi grant you use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
+The authors of czmq grant you use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
<A name="toc3-75" title="Contributing" />
### Contributing
-To submit an issue use the [issue tracker](http://github.com/zeromq/libzapi/issues). All discussion happens on the [zeromq-dev](zeromq-dev@lists.zeromq.org) list or #zeromq IRC channel at irc.freenode.net.
+To submit an issue use the [issue tracker](http://github.com/zeromq/czmq/issues). All discussion happens on the [zeromq-dev](zeromq-dev@lists.zeromq.org) list or #zeromq IRC channel at irc.freenode.net.
The proper way to submit patches is to clone this repository, make your changes, and use git to create a patch or a pull request. See http://www.zeromq.org/docs:contributing. All contributors are listed in AUTHORS.
-The general rule is, if you contribute code to libzapi you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
+The general rule is, if you contribute code to czmq you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
-<A name="toc2-84" title="Using libzapi" />
-## Using libzapi
+<A name="toc2-84" title="Using czmq" />
+## Using czmq
<A name="toc3-87" title="Building and Installing" />
### Building and Installing
-libzapi uses autotools for packaging. To build from git (all example commands are for Linux):
+czmq uses autotools for packaging. To build from git (all example commands are for Linux):
- git clone git://github.com/zeromq/libzapi.git
- cd libzapi
+ git clone git://github.com/zeromq/czmq.git
+ cd czmq
sh autogen.sh
./configure
make all
@@ -115,16 +116,16 @@ You will need the libtool and autotools packages. On FreeBSD, you may need to sp
./configure --with-zeromq=/usr/local
-After building, you can run the libzapi selftests:
+After building, you can run the czmq selftests:
make check
<A name="toc3-108" title="Linking with an Application" />
### Linking with an Application
-Include `zapi.h` in your application and link with libzapi. Here is a typical gcc link command:
+Include `czmq.h` in your application and link with czmq. Here is a typical gcc link command:
- gcc -lzapi -lzmq myapp.c -o myapp
+ gcc -lczmq -lzmq myapp.c -o myapp
<A name="toc3-115" title="API Summary" />
### API Summary
@@ -175,11 +176,11 @@ This is the class interface:
void
zctx_set_linger (zctx_t *self, int linger);
- // Create socket within this context, for libzapi use only
+ // Create socket within this context, for czmq use only
void *
zctx__socket_new (zctx_t *self, int type);
- // Destroy socket within this context, for libzapi use only
+ // Destroy socket within this context, for czmq use only
void
zctx__socket_destroy (zctx_t *self, void *socket);
@@ -201,13 +202,13 @@ calls. Automatically subscribes SUB sockets to "".
This is the class interface:
- // Create a new socket within our libzapi context, replaces zmq_socket.
+ // Create a new socket within our czmq context, replaces zmq_socket.
// If the socket is a SUB socket, automatically subscribes to everything.
// Use this to get automatic management of the socket at shutdown.
void *
zsocket_new (zctx_t *self, int type);
- // Destroy a socket within our libzapi context, replaces zmq_close.
+ // Destroy a socket within our czmq context, replaces zmq_close.
void
zsocket_destroy (zctx_t *self, void *socket);
@@ -332,7 +333,7 @@ and appends a null byte on received strings. This class is for simple
message sending.
<center>
-<img src="https://github.com/zeromq/libzapi/raw/master/images/README_2.png" alt="2">
+<img src="README_2.png" alt="2">
</center>
This is the class interface:
@@ -813,7 +814,7 @@ The answer to this, as we learned from building enterprise-level C applications
C has no standard API style. It is one thing to write a useful component, but something else to provide an API that is consistent and obvious across many components. We learned from building [OpenAMQ](http://www.openamq.org), a messaging client and server of 0.5M LoC, that a consistent model for extending C makes life for the application developer much easier.
-The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious libzapi class):
+The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious czmq class):
zregexp_t *regexp = zregexp_new (regexp_string);
if (!regexp)
@@ -838,7 +839,7 @@ No model is fully consistent, and classes can define their own rules if it helps
<A name="toc3-292" title="Naming Style" />
### Naming Style
-libzapi aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
+czmq aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
zclassname_methodname
@@ -861,12 +862,12 @@ We assume that at some point we'll need to switch to a doubly-linked list.
Creating a portable C application can be rewarding in terms of maintaining a single code base across many platforms, and keeping (expensive) system-specific knowledge separate from application developers. In most projects (like ØMQ core), there is no portability layer and application code does conditional compilation for all mixes of platforms. This leads to quite messy code.
-libzapi is a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
+czmq is a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
These are the places a C application is subject to arbitrary system differences:
-* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in zapi_prelude.h, e.g. defining int64_t on Windows.
-* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in zapi_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
+* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in czmq_prelude.h, e.g. defining int64_t on Windows.
+* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in czmq_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
* System libraries are inconsistent, i.e. you need to link with different libraries depending on the OS type and version. We solve this with an external compilation tool, 'C', which detects the OS type and version (at runtime) and builds the necessary link commands.
* System functions are inconsistent, i.e. you need to call different functions depending, again, on OS type and version. We solve this by building small abstract classes that handle specific areas of functionality, and doing conditional compilation in these.
@@ -880,7 +881,7 @@ An example of the last:
pid = 0;
#endif
-libzapi uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the zapi_prelude.h header file.
+czmq uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the czmq_prelude.h header file.
<A name="toc3-339" title="Technical Aspects" />
### Technical Aspects
@@ -889,8 +890,8 @@ libzapi uses the GNU autotools system, so non-portable code can use the macros t
* *Name spaces*: we prefix class names with `z`, which ensures that all exported functions are globally safe.
* *Library versioning*: we don't make any attempt to version the library at this stage. Classes are in our experience highly stable once they are built and tested, the only changes typically being added methods.
* *Performance*: for critical path processing, you may want to avoid creating and destroying classes. However on modern Linux systems the heap allocator is very fast. Individual classes can choose whether or not to nullify their data on allocation.
-* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `zapi_selftest` application does this.
-* *Memory management*: libzapi classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
+* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `czmq_selftest` application does this.
+* *Memory management*: czmq classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
<A name="toc2-349" title="Under the Hood" />
## Under the Hood
@@ -898,11 +899,11 @@ libzapi uses the GNU autotools system, so non-portable code can use the macros t
<A name="toc3-352" title="Adding a New Class" />
### Adding a New Class
-If you define a new libzapi class `myclass` you need to:
+If you define a new czmq class `myclass` you need to:
* Write the `zmyclass.c` and `zmyclass.h` source files, in `src` and `include` respectively.
-* Add`#include <zmyclass.h>` to `include/zapi.h`.
-* Add the myclass header and test call to `src/zapi_selftest.c`.
+* Add`#include <zmyclass.h>` to `include/czmq.h`.
+* Add the myclass header and test call to `src/czmq_selftest.c`.
* Add a reference documentation to 'doc/zmyclass.txt'.
* Add myclass to 'src/Makefile.am` and `doc/Makefile.am`.
@@ -923,14 +924,14 @@ So while ANSI C code might say:
file_buffer = zblob_new ();
...
-The style in libzapi would be:
+The style in czmq would be:
zblob_t *file_buffer = zblob_new ();
<A name="toc3-384" title="Assertions" />
### Assertions
-We use assertions heavily to catch bad argument values. The libzapi classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
+We use assertions heavily to catch bad argument values. The czmq classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
We also use assertions heavily on calls to system functions that are never supposed to fail, where failure is to be treated as a fatal non-recoverable error (e.g. running out of memory).
@@ -987,25 +988,25 @@ The template for man pages is in doc/mkman.
<A name="toc3-441" title="Development" />
### Development
-libzapi is developed through a test-driven process that guarantees no memory violations or leaks in the code:
+czmq is developed through a test-driven process that guarantees no memory violations or leaks in the code:
* Modify a class or method.
* Update the test method for that class.
* Run the 'selftest' script, which uses the Valgrind memcheck tool.
* Repeat until perfect.
-<A name="toc3-451" title="Porting libzapi" />
-### Porting libzapi
+<A name="toc3-451" title="Porting czmq" />
+### Porting czmq
-When you try libzapi on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be quite heavy. In any case, the benefit is that once ported, the functionality is available to all applications.
+When you try czmq on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be non-trivial. In any case, the benefit is that once ported, the functionality is available to all applications.
-Before attempting to patch code for portability, please read the `zapi_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
+Before attempting to patch code for portability, please read the `czmq_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
-* Defining typedefs which are missing on that specific compiler: do this in zapi_prelude.h.
-* Defining macros that rename exotic library functions to more conventional names: do this in zapi_prelude.h.
+* Defining typedefs which are missing on that specific compiler: do this in czmq_prelude.h.
+* Defining macros that rename exotic library functions to more conventional names: do this in czmq_prelude.h.
* Reimplementing specific methods to use a non-standard API: this is typically needed on Windows. Do this in the relevant class, using #ifdefs to properly differentiate code for different platforms.
-The canonical 'standard operating system' for all libzapi code is Linux, gcc, POSIX.
+The canonical 'standard operating system' for all czmq code is Linux, gcc, POSIX. The canonical 'weird operating system' for czmq is Windows.
<A name="toc3-464" title="Code Generation" />
### Code Generation
View
74 README.txt 100755 → 100644
@@ -1,7 +1,7 @@
-.set GIT=https://github.com/zeromq/libzapi
+Z.set GIT=https://github.com/zeromq/czmq
.sub 0MQ=ØMQ
-# libzapi - High-level C binding for 0MQ
+# czmq - High-level C binding for 0MQ
## Contents
@@ -11,13 +11,13 @@
### Scope and Goals
-libzapi has these goals:
+czmq has these goals:
* To wrap the 0MQ core API in semantics that are natural and lead to shorter, more readable applications.
-* To hide the differences between versions of 0MQ, particularly 2.0, 2.1, and 3.0.
+* To hide the differences between versions of 0MQ, particularly 2.1 and 3.0.
* To provide a space for development of more sophisticated API semantics.
-libzapi grew out of concepts developed in [ØMQ - The Guide](http://zguide.zeromq.org) and [ZFL](http://zfl.zeromq.org).
+czmq grew out of concepts developed in [ØMQ - The Guide](http://zguide.zeromq.org) and [ZFL](http://zfl.zeromq.org). Until end-April 2011, czmq was known as //libzapi//.
[diagram]
+---------------+
@@ -32,7 +32,7 @@ libzapi grew out of concepts developed in [ØMQ - The Guide](http://zguide.zerom
v |
Open context +---------+ |
Create sockets | | | Connect, bind sockets
- Close sockets | libzapi | | get/set socket options
+ Close sockets | czmq | | get/set socket options
Send/receive | cYEL | |
Multithreading +----+----+ |
Reactor pattern | |
@@ -63,26 +63,26 @@ libzapi grew out of concepts developed in [ØMQ - The Guide](http://zguide.zerom
### Ownership and License
-libzapi is maintained by Pieter Hintjens and Mikko Koppanen (build system). Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
+czmq is maintained by Pieter Hintjens and Mikko Koppanen (build system). Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
-The authors of libzapi grant you use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
+The authors of czmq grant you use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
### Contributing
-To submit an issue use the [issue tracker](http://github.com/zeromq/libzapi/issues). All discussion happens on the [zeromq-dev](zeromq-dev@lists.zeromq.org) list or #zeromq IRC channel at irc.freenode.net.
+To submit an issue use the [issue tracker](http://github.com/zeromq/czmq/issues). All discussion happens on the [zeromq-dev](zeromq-dev@lists.zeromq.org) list or #zeromq IRC channel at irc.freenode.net.
The proper way to submit patches is to clone this repository, make your changes, and use git to create a patch or a pull request. See http://www.zeromq.org/docs:contributing. All contributors are listed in AUTHORS.
-The general rule is, if you contribute code to libzapi you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
+The general rule is, if you contribute code to czmq you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
-## Using libzapi
+## Using czmq
### Building and Installing
-libzapi uses autotools for packaging. To build from git (all example commands are for Linux):
+czmq uses autotools for packaging. To build from git (all example commands are for Linux):
- git clone git://github.com/zeromq/libzapi.git
- cd libzapi
+ git clone git://github.com/zeromq/czmq.git
+ cd czmq
sh autogen.sh
./configure
make all
@@ -93,15 +93,15 @@ You will need the libtool and autotools packages. On FreeBSD, you may need to sp
./configure --with-zeromq=/usr/local
-After building, you can run the libzapi selftests:
+After building, you can run the czmq selftests:
make check
### Linking with an Application
-Include `zapi.h` in your application and link with libzapi. Here is a typical gcc link command:
+Include `czmq.h` in your application and link with czmq. Here is a typical gcc link command:
- gcc -lzapi -lzmq myapp.c -o myapp
+ gcc -lczmq -lzmq myapp.c -o myapp
### API Summary
@@ -243,7 +243,7 @@ The answer to this, as we learned from building enterprise-level C applications
C has no standard API style. It is one thing to write a useful component, but something else to provide an API that is consistent and obvious across many components. We learned from building [OpenAMQ](http://www.openamq.org), a messaging client and server of 0.5M LoC, that a consistent model for extending C makes life for the application developer much easier.
-The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious libzapi class):
+The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious czmq class):
zregexp_t *regexp = zregexp_new (regexp_string);
if (!regexp)
@@ -267,7 +267,7 @@ No model is fully consistent, and classes can define their own rules if it helps
### Naming Style
-libzapi aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
+czmq aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
zclassname_methodname
@@ -288,12 +288,12 @@ We assume that at some point we'll need to switch to a doubly-linked list.
Creating a portable C application can be rewarding in terms of maintaining a single code base across many platforms, and keeping (expensive) system-specific knowledge separate from application developers. In most projects (like 0MQ core), there is no portability layer and application code does conditional compilation for all mixes of platforms. This leads to quite messy code.
-libzapi is a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
+czmq is a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
These are the places a C application is subject to arbitrary system differences:
-* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in zapi_prelude.h, e.g. defining int64_t on Windows.
-* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in zapi_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
+* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in czmq_prelude.h, e.g. defining int64_t on Windows.
+* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in czmq_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
* System libraries are inconsistent, i.e. you need to link with different libraries depending on the OS type and version. We solve this with an external compilation tool, 'C', which detects the OS type and version (at runtime) and builds the necessary link commands.
* System functions are inconsistent, i.e. you need to call different functions depending, again, on OS type and version. We solve this by building small abstract classes that handle specific areas of functionality, and doing conditional compilation in these.
@@ -307,7 +307,7 @@ An example of the last:
pid = 0;
#endif
-libzapi uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the zapi_prelude.h header file.
+czmq uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the czmq_prelude.h header file.
### Technical Aspects
@@ -315,18 +315,18 @@ libzapi uses the GNU autotools system, so non-portable code can use the macros t
* *Name spaces*: we prefix class names with `z`, which ensures that all exported functions are globally safe.
* *Library versioning*: we don't make any attempt to version the library at this stage. Classes are in our experience highly stable once they are built and tested, the only changes typically being added methods.
* *Performance*: for critical path processing, you may want to avoid creating and destroying classes. However on modern Linux systems the heap allocator is very fast. Individual classes can choose whether or not to nullify their data on allocation.
-* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `zapi_selftest` application does this.
-* *Memory management*: libzapi classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
+* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `czmq_selftest` application does this.
+* *Memory management*: czmq classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
## Under the Hood
### Adding a New Class
-If you define a new libzapi class `myclass` you need to:
+If you define a new czmq class `myclass` you need to:
* Write the `zmyclass.c` and `zmyclass.h` source files, in `src` and `include` respectively.
-* Add`#include <zmyclass.h>` to `include/zapi.h`.
-* Add the myclass header and test call to `src/zapi_selftest.c`.
+* Add`#include <zmyclass.h>` to `include/czmq.h`.
+* Add the myclass header and test call to `src/czmq_selftest.c`.
* Add a reference documentation to 'doc/zmyclass.txt'.
* Add myclass to 'src/Makefile.am` and `doc/Makefile.am`.
@@ -346,13 +346,13 @@ So while ANSI C code might say:
file_buffer = zblob_new ();
...
-The style in libzapi would be:
+The style in czmq would be:
zblob_t *file_buffer = zblob_new ();
### Assertions
-We use assertions heavily to catch bad argument values. The libzapi classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
+We use assertions heavily to catch bad argument values. The czmq classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
We also use assertions heavily on calls to system functions that are never supposed to fail, where failure is to be treated as a fatal non-recoverable error (e.g. running out of memory).
@@ -407,24 +407,24 @@ The template for man pages is in doc/mkman.
### Development
-libzapi is developed through a test-driven process that guarantees no memory violations or leaks in the code:
+czmq is developed through a test-driven process that guarantees no memory violations or leaks in the code:
* Modify a class or method.
* Update the test method for that class.
* Run the 'selftest' script, which uses the Valgrind memcheck tool.
* Repeat until perfect.
-### Porting libzapi
+### Porting czmq
-When you try libzapi on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be quite heavy. In any case, the benefit is that once ported, the functionality is available to all applications.
+When you try czmq on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be non-trivial. In any case, the benefit is that once ported, the functionality is available to all applications.
-Before attempting to patch code for portability, please read the `zapi_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
+Before attempting to patch code for portability, please read the `czmq_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
-* Defining typedefs which are missing on that specific compiler: do this in zapi_prelude.h.
-* Defining macros that rename exotic library functions to more conventional names: do this in zapi_prelude.h.
+* Defining typedefs which are missing on that specific compiler: do this in czmq_prelude.h.
+* Defining macros that rename exotic library functions to more conventional names: do this in czmq_prelude.h.
* Reimplementing specific methods to use a non-standard API: this is typically needed on Windows. Do this in the relevant class, using #ifdefs to properly differentiate code for different platforms.
-The canonical 'standard operating system' for all libzapi code is Linux, gcc, POSIX.
+The canonical 'standard operating system' for all czmq code is Linux, gcc, POSIX. The canonical 'weird operating system' for czmq is Windows.
### Code Generation
View
10 configure.in
@@ -6,7 +6,7 @@ AC_PREREQ(2.61)
# The version in git should reflect the *next* version planned.
# Version must be MAJOR.MINOR.PATCH otherwise things will break.
#
-AC_INIT([libzapi],[1.3.3],[zeromq-dev@lists.zeromq.org])
+AC_INIT([czmq],[1.0.0],[zeromq-dev@lists.zeromq.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
@@ -33,7 +33,7 @@ AC_SUBST(PACKAGE_VERSION)
# know exactly what you're doing and have read and understand
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
-# libzapi -version-info
+# libczmq -version-info
LTVER="0:0:0"
AC_SUBST(LTVER)
@@ -107,7 +107,7 @@ if test "x$zapi_have_asciidoc" = "xno" -o "x$zapi_have_xmlto" = "xno"; then
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/zapi.7; then
zapi_install_man="no"
- AC_MSG_WARN([You are building an unreleased version of libzapi and asciidoc or xmlto are not installed.])
+ AC_MSG_WARN([You are building an unreleased version of libczmq and asciidoc or xmlto are not installed.])
AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
fi
fi
@@ -116,7 +116,7 @@ AC_MSG_RESULT([$zapi_build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$zapi_install_man])
-# Set some default features required by libzapi code.
+# Set some default features required by libczmq code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
# OS-specific tests
@@ -210,5 +210,5 @@ AM_CONDITIONAL(BUILD_DOC, test "x$zapi_build_doc" = "xyes")
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset)
-AC_OUTPUT(Makefile src/Makefile doc/Makefile src/libzapi.pc)
+AC_OUTPUT(Makefile src/Makefile doc/Makefile src/libczmq.pc)
View
4 doc/Makefile.am
@@ -1,6 +1,6 @@
MAN1 =
MAN3 =
-MAN7 = libzapi.7 \
+MAN7 = czmq.7 \
zclock.7 \
zctx.7 \
zframe.7 \
@@ -34,7 +34,7 @@ SUFFIXES=.txt .xml .1 .3 .7
.txt.xml:
./mkman $<
asciidoc -d manpage -b docbook -f asciidoc.conf \
- -azapi_version=@PACKAGE_VERSION@ $<
+ -aczmq_version=@PACKAGE_VERSION@ $<
.xml.1:
xmlto man $<
.xml.3:
View
18 doc/asciidoc.conf
@@ -2,10 +2,10 @@
literal-style=template="literalparagraph"
[macros]
-(?su)[\\]?(?P<name>linkzapi):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+(?su)[\\]?(?P<name>linkczmq):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
ifdef::backend-docbook[]
-[linkzapi-inlinemacro]
+[linkczmq-inlinemacro]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
@@ -13,7 +13,7 @@ ifdef::backend-docbook[]
endif::backend-docbook[]
ifdef::backend-xhtml11[]
-[linkzapi-inlinemacro]
+[linkczmq-inlinemacro]
<a href="{target}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]
@@ -25,9 +25,9 @@ template::[header-declarations]
<refmeta>
<refentrytitle>{mantitle}</refentrytitle>
<manvolnum>{manvolnum}</manvolnum>
-<refmiscinfo class="source">zapi</refmiscinfo>
-<refmiscinfo class="version">{zapi_version}</refmiscinfo>
-<refmiscinfo class="manual">zapi Manual</refmiscinfo>
+<refmiscinfo class="source">czmq</refmiscinfo>
+<refmiscinfo class="version">{czmq_version}</refmiscinfo>
+<refmiscinfo class="manual">czmq Manual</refmiscinfo>
</refmeta>
<refnamediv>
<refname>{manname}</refname>
@@ -36,16 +36,16 @@ template::[header-declarations]
[footer]
<refsect1 id="_authors">
<title>AUTHORS</title>
-<simpara>The zapi manual was written by Pieter Hintjens&lt;<ulink url="mailto:ph@imatix.com">ph@imatix.com</ulink>&gt;.</simpara>
+<simpara>The czmq manual was written by Pieter Hintjens&lt;<ulink url="mailto:ph@imatix.com">ph@imatix.com</ulink>&gt;.</simpara>
</refsect1>
<refsect1 id="_resources">
<title>RESOURCES</title>
-<simpara>Main web site: <ulink url="http://zapi.zeromq.org/">http://zapi.zeromq.org/</ulink></simpara>
+<simpara>Main web site: <ulink url="http://czmq.zeromq.org/">http://czmq.zeromq.org/</ulink></simpara>
<simpara>Report bugs to the 0MQ development mailing list: &lt;<ulink url="mailto:zeromq-dev@lists.zeromq.org">zeromq-dev@lists.zeromq.org</ulink>&gt;</simpara>
</refsect1>
<refsect1 id="_copyright">
<title>COPYRIGHT</title>
-<simpara>Copyright (c) 1991-2010 iMatix Corporation and contributors. License LGPLv3+: GNU LGPL 3 or later &lt;<ulink url="http://gnu.org/licenses/lgpl.html">http://gnu.org/licenses/lgpl.html</ulink>&gt;. This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law. For details see the files <literal>COPYING</literal> and <literal>COPYING.LESSER</literal> included with the zapi distribution.</simpara>
+<simpara>Copyright (c) 1991-2010 iMatix Corporation and contributors. License LGPLv3+: GNU LGPL 3 or later &lt;<ulink url="http://gnu.org/licenses/lgpl.html">http://gnu.org/licenses/lgpl.html</ulink>&gt;. This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law. For details see the files <literal>COPYING</literal> and <literal>COPYING.LESSER</literal> included with the czmq distribution.</simpara>
</refsect1>
</refentry>
endif::backend-docbook[]
View
88 doc/libzapi.txt → doc/czmq.txt 100755 → 100644
@@ -1,18 +1,18 @@
-libzapi(7)
-==========
+czmq(7)
+=======
NAME
----
-libzapi - high-level C binding for ØMQ
+czmq - high-level C binding for ØMQ
SYNOPSIS
--------
----
-#include <zapi.h>
+#include <czmq.h>
-cc ['flags'] 'files' -lzmq -lzapi ['libraries']
+cc ['flags'] 'files' -lzmq -lczmq ['libraries']
----
@@ -22,7 +22,7 @@ DESCRIPTION
Scope and Goals
~~~~~~~~~~~~~~~
-libzapi has these goals:
+czmq has these goals:
* To wrap the ØMQ core API in semantics that are natural and lead to shorter, more readable applications.
* To hide the differences between versions of ØMQ.
@@ -31,31 +31,31 @@ libzapi has these goals:
Ownership and License
~~~~~~~~~~~~~~~~~~~~~
-libzapi is maintained by Pieter Hintjens. Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
+czmq is maintained by Pieter Hintjens. Its other authors and contributors are listed in the AUTHORS file. It is held by the ZeroMQ organization at github.com.
-The authors of libzapi grant you free use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
+The authors of czmq grant you free use of this software under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` in this directory.
Contributing
~~~~~~~~~~~~
-To submit an issue use the issue tracker at http://github.com/zeromq/libzapi/issues. All discussion happens on the zeromq-dev list or #zeromq IRC channel at irc.freenode.net.
+To submit an issue use the issue tracker at http://github.com/zeromq/czmq/issues. All discussion happens on the zeromq-dev list or #zeromq IRC channel at irc.freenode.net.
The proper way to submit patches is to clone this repository, make your changes, and use git to create a patch or a pull request. See http://www.zeromq.org/docs:contributing. All contributors are listed in AUTHORS.
All classes are maintained by a single person, who is the responsible editor for that class and who is named in the header as such. This is usually the originator of the class. When several people collaborate on a class, one single person is always the lead maintainer and the one to blame when it breaks.
-The general rule is, if you contribute code to libzapi you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
+The general rule is, if you contribute code to czmq you must be willing to maintain it as long as there are users of it. Code with no active maintainer will in general be deprecated and/or removed.
-USING LIBZAPI
--------------
+USING CZMQ
+----------
Building and Installing
~~~~~~~~~~~~~~~~~~~~~~~
-libzapi uses autotools for packaging. To build from git (all example commands are for Linux):
+czmq uses autotools for packaging. To build from git (all example commands are for Linux):
----
- git clone git://github.com/zeromq/libzapi.git
- cd libzapi
+ git clone git://github.com/zeromq/czmq.git
+ cd czmq
sh autogen.sh
./configure
make all
@@ -65,31 +65,31 @@ libzapi uses autotools for packaging. To build from git (all example commands ar
You will need the pkg-config, libtool, and autoreconf packages. Set the LD_LIBRARY_PATH to /usr/local/libs unless you install elsewhere.
-After building, you can run the libzapi selftests:
+After building, you can run the czmq selftests:
----
cd src
- ./zapi_selftest
+ ./czmq_selftest
----
Linking with an Application
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Include `zapi.h` in your application and link with libzapi. Here is a typical gcc link command:
+Include `czmq.h` in your application and link with czmq. Here is a typical gcc link command:
----
- gcc -lzapi -lzmq myapp.c -o myapp
+ gcc -lczmq -lzmq myapp.c -o myapp
----
-You should read `zapi.h`. This file includes `zmq.h` and the system header files that typical ØMQ applications will need. The provided 'c' shell script lets you write simple portable build scripts:
+You should read `czmq.h`. This file includes `zmq.h` and the system header files that typical ØMQ applications will need. The provided 'c' shell script lets you write simple portable build scripts:
----
- c -lzapi -lzmq -l myapp
+ c -lczmq -lzmq -l myapp
----
The Class Model
~~~~~~~~~~~~~~~
-libzapi consists of classes, each class consisting of a .h and a .c. Classes may depend on other classes.
+czmq consists of classes, each class consisting of a .h and a .c. Classes may depend on other classes.
-`zapi.h` includes all classes header files, all the time. For the user, libzapi forms one single package. All classes start by including `zapi.h`. All applications that use libzapi start by including `zapi.h`. `zapi.h` also defines a limited number of small, useful macros and typedefs that have proven useful for writing clearer C code.
+`czmq.h` includes all classes header files, all the time. For the user, czmq forms one single package. All classes start by including `czmq.h`. All applications that use czmq start by including `czmq.h`. `czmq.h` also defines a limited number of small, useful macros and typedefs that have proven useful for writing clearer C code.
All classes (with some exceptions) are based on a flat C class system and follow these rules (where 'zclass' is the class name):
@@ -129,7 +129,7 @@ A Simple Class Model
C has no standard API style. It is one thing to write a useful component, but something else to provide an API that is consistent and obvious across many components. We learned from building OpenAMQ (http://www.openamq.org), a messaging client and server of 0.5M LoC, that a consistent model for extending C makes life for the application developer much easier.
-The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious libzapi class):
+The general model is that of a class (the source package) that provides objects (in fact C structures). The application creates objects and then works with them. When done, the application destroys the object. In C, we tend to use the same name for the object as the class, when we can, and it looks like this (to take a fictitious czmq class):
----
zregexp_t *regexp = zregexp_new (regexp_string);
if (!regexp)
@@ -155,7 +155,7 @@ No model is fully consistent, and classes can define their own rules if it helps
Naming Style
~~~~~~~~~~~~
-libzapi aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
+czmq aims for short, consistent names, following the theory that names we use most often should be shortest. Classes get one-word names, unless they are part of a family of classes in which case they may be two words, the first being the family name. Methods, similarly, get one-word names and we aim for consistency across classes (so a method that does something semantically similar in two classes will get the same name in both). So the canonical name for any method is:
----
zclassname_methodname
----
@@ -179,12 +179,12 @@ Portability
Creating a portable C application can be rewarding in terms of maintaining a single code base across many platforms, and keeping (expensive) system-specific knowledge separate from application developers. In most projects (like ØMQ core), there is no portability layer and application code does conditional compilation for all mixes of platforms. This leads to quite messy code.
-libzapi acts as a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
+czmq acts as a portability layer, similar to but thinner than libraries like the [Apache Portable Runtime](http://apr.apache.org) (APR).
These are the places a C application is subject to arbitrary system differences:
-* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in zapi_prelude.h, e.g. defining int64_t on Windows.
-* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in zapi_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
+* Different compilers may offer slightly different variants of the C language, often lacking specific types or using neat non-portable names. Windows is a big culprit here. We solve this by 'patching' the language in czmq_prelude.h, e.g. defining int64_t on Windows.
+* System header files are inconsistent, i.e. you need to include different files depending on the OS type and version. We solve this by pulling in all necessary header files in czmq_prelude.h. This is a proven brute-force approach that increases recompilation times but eliminates a major source of pain.
* System libraries are inconsistent, i.e. you need to link with different libraries depending on the OS type and version. We solve this with an external compilation tool, 'C', which detects the OS type and version (at runtime) and builds the necessary link commands.
* System functions are inconsistent, i.e. you need to call different functions depending, again, on OS type and version. We solve this by building small abstract classes that handle specific areas of functionality, and doing conditional compilation in these.
@@ -199,7 +199,7 @@ An example of the last:
#endif
----
-libzapi uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the zapi_prelude.h header file.
+czmq uses the GNU autotools system, so non-portable code can use the macros this defines. It can also use macros defined by the czmq_prelude.h header file.
Technical Aspects
~~~~~~~~~~~~~~~~~
@@ -208,8 +208,8 @@ Technical Aspects
* *Name spaces*: we prefix class names with `z`, which ensures that all exported functions are globally safe.
* *Library versioning*: we don't make any attempt to version the library at this stage. Classes are in our experience highly stable once they are built and tested, the only changes typically being added methods.
* *Performance*: for critical path processing, you may want to avoid creating and destroying classes. However on modern Linux systems the heap allocator is very fast. Individual classes can choose whether or not to nullify their data on allocation.
-* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `zapi_selftest` application does this.
-* *Memory management*: libzapi classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
+* *Self-testing*: every class has a `selftest` method that runs through the methods of the class. In theory, calling all selftest functions of all classes does a full unit test of the library. The `czmq_selftest` application does this.
+* *Memory management*: czmq classes do not use any special memory management techiques to detect leaks. We've done this in the past but it makes the code relatively complex. Instead, we do memory leak testing using tools like valgrind.
Under the Hood
--------------
@@ -217,11 +217,11 @@ Under the Hood
Adding a New Class
~~~~~~~~~~~~~~~~~~
-If you define a new libzapi class `myclass` you need to:
+If you define a new czmq class `myclass` you need to:
* Write the `zmyclass.c` and `zmyclass.h` source files, in `src` and `include` respectively.
-* Add`#include <zmyclass.h>` to `include/zapi.h`.
-* Add the myclass header and test call to `src/zapi_selftest.c`.
+* Add`#include <zmyclass.h>` to `include/czmq.h`.
+* Add the myclass header and test call to `src/czmq_selftest.c`.
* Add a reference documentation to 'doc/zmyclass.txt'.
* Add myclass to 'src/Makefile.am` and `doc/Makefile.am`.
@@ -243,7 +243,7 @@ So while ANSI C code might say:
...
----
-The style in libzapi would be:
+The style in czmq would be:
----
zblob_t *file_buffer = zblob_new ();
----
@@ -251,7 +251,7 @@ The style in libzapi would be:
Assertions
~~~~~~~~~~
-We use assertions heavily to catch bad argument values. The libzapi classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
+We use assertions heavily to catch bad argument values. The czmq classes do not attempt to validate arguments and report errors; bad arguments are treated as fatal application programming errors.
We also use assertions heavily on calls to system functions that are never supposed to fail, where failure is to be treated as a fatal non-recoverable error (e.g. running out of memory).
@@ -313,22 +313,22 @@ The template for man pages is in doc/mkman.
Development
~~~~~~~~~~~
-libzapi is developed through a test-driven process that guarantees no memory violations or leaks in the code:
+czmq is developed through a test-driven process that guarantees no memory violations or leaks in the code:
* Modify a class or method.
* Update the test method for that class.
* Run the 'selftest' script, which uses the Valgrind memcheck tool.
* Repeat until perfect.
-Porting libzapi
-~~~~~~~~~~~~~~~
+Porting czmq
+~~~~~~~~~~~~
-When you try libzapi on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be quite heavy. In any case, the benefit is that once ported, the functionality is available to all applications.
+When you try czmq on an OS that it's not been used on (ever, or for a while), you will hit code that does not compile. In some cases the patches are trivial, in other cases (usually when porting to Windows), the work needed to build equivalent functionality may be quite heavy. In any case, the benefit is that once ported, the functionality is available to all applications.
-Before attempting to patch code for portability, please read the `zapi_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
+Before attempting to patch code for portability, please read the `czmq_prelude.h` header file. There are several typical types of changes you may need to make to get functionality working on a specific operating system:
-* Defining typedefs which are missing on that specific compiler: do this in zapi_prelude.h.
-* Defining macros that rename exotic library functions to more conventional names: do this in zapi_prelude.h.
+* Defining typedefs which are missing on that specific compiler: do this in czmq_prelude.h.
+* Defining macros that rename exotic library functions to more conventional names: do this in czmq_prelude.h.
* Reimplementing specific methods to use a non-standard API: this is typically needed on Windows. Do this in the relevant class, using #ifdefs to properly differentiate code for different platforms.
-The canonical 'standard operating system' for all libzapi code is Linux, gcc, POSIX.
+The canonical 'standard operating system' for all czmq code is Linux, gcc, POSIX.
View
2  doc/mkman
@@ -70,7 +70,7 @@ pull ../src/$class.c\@selftest
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
END
# Now process template
View
8 doc/mksite
@@ -1,6 +1,6 @@
#! /bin/bash
#
-# mksite - Upload zapi manual to zapi.zeromq.org/manual:
+# mksite - Upload czmq manual to czmq.zeromq.org/manual:
#
# Author: Pieter Hintjens <ph@imatix.com>
# License: public domain
@@ -11,7 +11,7 @@
# Export so child scripts can access these
export UPLOAD=1 # If 0, don't actually upload
export CATEGORY=manual # Category to receive man pages
-export WEBSITE=zapi # Wikidot website prefix
+export WEBSITE=czmq # Wikidot website prefix
# This function uploads a file to wikidot
# Error in upload will cause the script to exit with non-zero status
@@ -34,7 +34,7 @@ done
echo "Generating XML pages for manual..."
FILES=
-for FILE in libzapi.txt z*.txt; do
+for FILE in czmq.txt z*.txt; do
BASE=`basename $FILE .txt`
make --quiet $BASE.xml;
FILES="$FILES $BASE"
@@ -49,7 +49,7 @@ if [ $UPLOAD -eq 1 ]; then
echo "Uploading to $CATEGORY..."
# Send table of contents as category:_start
- do_upload "_start" "zapi Documentation"
+ do_upload "_start" "czmq Documentation"
# Send template as category:_template
do_upload "_template" "Category template - generated"
View
8 doc/xml2wd.pl
@@ -1,7 +1,7 @@
#! /bin/perl
#
# xml2wd.pl - Convert docbook XML to Wikidot syntax
-# Part of the ztools/apisite toolkit. Modified for libzapi.
+# Part of the ztools/apisite toolkit. Modified for libczmq.
#
# Author: Pieter Hintjens <ph@imatix.com>
# License: public domain
@@ -43,10 +43,10 @@
$manual - $source/$version
[[/div]]
END
- if ($title eq "libzapi") {
+ if ($title eq "czmq") {
open (TOC, ">_start.wd");
- print TOC "[[image http://libzapi.zeromq.org/local--files/admin:css/logo.gif link=\"page:start\"]]\n\n";
- print TOC "++ libzapi/$version reference\n\n";
+ print TOC "[[image http://czmq.zeromq.org/local--files/admin:css/logo.gif link=\"page:start\"]]\n\n";
+ print TOC "++ czmq/$version reference\n\n";
close (TOC);
}
}
View
4 doc/zclock.txt
@@ -41,7 +41,7 @@ for this library will say "insane" at least once. Anyhow, milliseconds
are a concept we can deal with. Seconds are too fat, nanoseconds too
tiny, but milliseconds are just right for slices of time we want to work
with at the 0MQ scale. zclock doesn't give you objects to work with, we
-like the zapi class model but we're not insane. There, got it in again.
+like the czmq class model but we're not insane. There, got it in again.
EXAMPLE
-------
@@ -54,4 +54,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
6 doc/zctx.txt
@@ -24,11 +24,11 @@ void
void
zctx_set_linger (zctx_t *self, int linger);
-// Create socket within this context, for libzapi use only
+// Create socket within this context, for czmq use only
void *
zctx__socket_new (zctx_t *self, int type);
-// Destroy socket within this context, for libzapi use only
+// Destroy socket within this context, for czmq use only
void
zctx__socket_destroy (zctx_t *self, void *socket);
@@ -103,4 +103,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zframe.txt
@@ -137,4 +137,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zhash.txt
@@ -149,4 +149,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zlist.txt
@@ -127,4 +127,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zloop.txt
@@ -84,4 +84,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zmsg.txt
@@ -216,4 +216,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
8 doc/zsocket.txt
@@ -8,13 +8,13 @@ zsocket - working with 0MQ sockets
SYNOPSIS
--------
----
-// Create a new socket within our libzapi context, replaces zmq_socket.
+// Create a new socket within our czmq context, replaces zmq_socket.
// If the socket is a SUB socket, automatically subscribes to everything.
// Use this to get automatic management of the socket at shutdown.
void *
zsocket_new (zctx_t *self, int type);
-// Destroy a socket within our libzapi context, replaces zmq_close.
+// Destroy a socket within our czmq context, replaces zmq_close.
void
zsocket_destroy (zctx_t *self, void *socket);
@@ -54,7 +54,7 @@ EXAMPLE
// Create a detached thread, let it run
char *interf = "*";
char *domain = "localhost";
- int service = 5555;
+ int service = 5560;
void *writer = zsocket_new (ctx, ZMQ_PUSH);
void *reader = zsocket_new (ctx, ZMQ_PULL);
@@ -74,4 +74,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zsockopt.txt
@@ -211,4 +211,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zstr.txt
@@ -76,4 +76,4 @@ EXAMPLE
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
2  doc/zthread.txt
@@ -108,4 +108,4 @@ s_test_attached (void *args, zctx_t *ctx, void *pipe)
SEE ALSO
--------
-linkzapi:zapi[7]
+linkczmq:czmq[7]
View
BIN  images/README_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/README_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
12 include/zapi.h → include/czmq.h
@@ -1,12 +1,12 @@
/* =========================================================================
- zapi.h - zapi wrapper
+ czmq.h - czmq wrapper
-------------------------------------------------------------------------
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -24,12 +24,12 @@
=========================================================================
*/
-#ifndef __ZAPI_H_INCLUDED__
-#define __ZAPI_H_INCLUDED__
+#ifndef __CZMQ_H_INCLUDED__
+#define __CZMQ_H_INCLUDED__
// Set up environment for the application
//
-#include <zapi_prelude.h>
+#include <czmq_prelude.h>
// Classes listed in alphabetical order
View
28 include/zapi_prelude.h → include/czmq_prelude.h
@@ -1,12 +1,12 @@
/* =========================================================================
- zapi_prelude.h - zapi environment
+ czmq_prelude.h - czmq environment
-------------------------------------------------------------------------
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -24,8 +24,8 @@
=========================================================================
*/
-#ifndef __ZAPI_PRELUDE_H_INCLUDED__
-#define __ZAPI_PRELUDE_H_INCLUDED__
+#ifndef __CZMQ_PRELUDE_H_INCLUDED__
+#define __CZMQ_PRELUDE_H_INCLUDED__
//- Always include ZeroMQ header file ---------------------------------------
@@ -44,7 +44,7 @@
#endif
#if ZMQ_VERSION_MAJOR == 2
# if ZMQ_VERSION_MINOR == 0
-# error "libzapi requires at least libzmq/2.1.x stable"
+# error "czmq requires at least libzmq/2.1.x stable"
# endif
# define zmq_sendmsg zmq_send
# define zmq_recvmsg zmq_recv
@@ -421,13 +421,13 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
//- Error reporting ---------------------------------------------------------
// If the compiler is GCC or supports C99, include enclosing function
-// in zapi assertions
+// in czmq assertions
#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define ZAPI_ASSERT_SANE_FUNCTION __func__
+# define CZMQ_ASSERT_SANE_FUNCTION __func__
#elif defined (__GNUC__) && (__GNUC__ >= 2)
-# define ZAPI_ASSERT_SANE_FUNCTION __FUNCTION__
+# define CZMQ_ASSERT_SANE_FUNCTION __FUNCTION__
#else
-# define ZAPI_ASSERT_SANE_FUNCTION "<unknown>"
+# define CZMQ_ASSERT_SANE_FUNCTION "<unknown>"
#endif
// Replacement for malloc() which asserts if we run out of heap, and
@@ -459,19 +459,19 @@ static inline void *
#ifdef _ZMALLOC_DEBUG
# define zmalloc(size) calloc(1,(size))
#else
-# define zmalloc(size) safe_malloc((size), __FILE__, __LINE__, ZAPI_ASSERT_SANE_FUNCTION)
+# define zmalloc(size) safe_malloc((size), __FILE__, __LINE__, CZMQ_ASSERT_SANE_FUNCTION)
#endif
//- DLL exports -------------------------------------------------------------
#if (defined (__WINDOWS__))
# if defined DLL_EXPORT
-# define ZAPI_EXPORT __declspec(dllexport)
+# define CZMQ_EXPORT __declspec(dllexport)
# else
-# define ZAPI_EXPORT __declspec(dllimport)
+# define CZMQ_EXPORT __declspec(dllimport)
# endif
#else
-# define ZAPI_EXPORT
+# define CZMQ_EXPORT
#endif
#endif
View
4 include/zclock.h
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
8 include/zctx.h 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -59,11 +59,11 @@ void
void
zctx_set_linger (zctx_t *self, int linger);
-// Create socket within this context, for libzapi use only
+// Create socket within this context, for czmq use only
void *
zctx__socket_new (zctx_t *self, int type);
-// Destroy socket within this context, for libzapi use only
+// Destroy socket within this context, for czmq use only
void
zctx__socket_destroy (zctx_t *self, void *socket);
View
4 include/zframe.h 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zhash.h
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zlist.h
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zloop.h 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zmsg.h 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
8 include/zsocket.h
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -32,13 +32,13 @@ extern "C" {
#endif
// @interface
-// Create a new socket within our libzapi context, replaces zmq_socket.
+// Create a new socket within our czmq context, replaces zmq_socket.
// If the socket is a SUB socket, automatically subscribes to everything.
// Use this to get automatic management of the socket at shutdown.
void *
zsocket_new (zctx_t *self, int type);
-// Destroy a socket within our libzapi context, replaces zmq_close.
+// Destroy a socket within our czmq context, replaces zmq_close.
void
zsocket_destroy (zctx_t *self, void *socket);
View
4 include/zsockopt.h
@@ -6,8 +6,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zstr.h 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
4 include/zthread.h
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
View
10 sockopts.gsl
@@ -19,8 +19,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -87,8 +87,8 @@ int zsockopt_test (Bool verbose);
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -116,7 +116,7 @@ int zsockopt_test (Bool verbose);
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zctx.h"
#include "../include/zsocket.h"
#include "../include/zsockopt.h"
View
22 src/Makefile.am
@@ -1,11 +1,11 @@
-lib_LTLIBRARIES = libzapi.la
+lib_LTLIBRARIES = libczmq.la
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libzapi.pc
+pkgconfig_DATA = libczmq.pc
include_HEADERS = \
- ../include/zapi.h \
- ../include/zapi_prelude.h \
+ ../include/czmq.h \
+ ../include/czmq_prelude.h \
../include/zclock.h \
../include/zctx.h \
../include/zframe.h \
@@ -18,7 +18,7 @@ include_HEADERS = \
../include/zstr.h \
../include/zthread.h
-libzapi_la_SOURCES = \
+libczmq_la_SOURCES = \
zclock.c \
zctx.c \
zframe.c \
@@ -32,16 +32,16 @@ libzapi_la_SOURCES = \
zthread.c
INCLUDES = -I$(top_srcdir)/include
-bin_PROGRAMS = zapi_selftest
-zapi_selftest_LDADD = libzapi.la
-zapi_selftest_SOURCES = zapi_selftest.c
+bin_PROGRAMS = czmq_selftest
+czmq_selftest_LDADD = libczmq.la
+czmq_selftest_SOURCES = czmq_selftest.c
if ON_MINGW
-libzapi_la_LDFLAGS = -no-undefined -avoid-version -version-info @LTVER@
+libczmq_la_LDFLAGS = -no-undefined -avoid-version -version-info @LTVER@
else
-libzapi_la_LDFLAGS = -version-info @LTVER@
+libczmq_la_LDFLAGS = -version-info @LTVER@
endif
-TESTS = zapi_selftest
+TESTS = czmq_selftest
View
148 src/czmq_selftest
@@ -0,0 +1,148 @@
+#! /bin/bash
+
+# czmq_selftest - temporary wrapper script for .libs/czmq_selftest
+# Generated by ltmain.sh (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
+#
+# The czmq_selftest program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /vol1/home/ph/work/czmq/src; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=.libs; export LD_LIBRARY_PATH; PATH=.:/home/ph/ibase/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ph/.gem/ruby/1.8/bin:/usr/local/android/platform-tools; export PATH; gcc -std=gnu99 -g -O2 -o \$progdir/\$file czmq_selftest.o ./.libs/libczmq.so -lm -lzmq -lpthread -Wl,-rpath -Wl,/vol1/home/ph/work/czmq/src/.libs)"
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='2.2.6b'
+ notinst_deplibs=' libczmq.la'
+else
+ # When we are sourced in execute mode, $file and $ECHO are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ ECHO="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec /bin/bash "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+ # special case for '.'
+ if test "$thisdir" = "."; then
+ thisdir=`pwd`
+ fi
+ # remove .libs from thisdir
+ case "$thisdir" in
+ *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
+ .libs ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'czmq_selftest'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" ||
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $ECHO "$0: cannot exec $program $*" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $ECHO "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
View
10 src/zapi_selftest.c → src/czmq_selftest.c
@@ -1,5 +1,5 @@
/* =========================================================================
- zapi_tests.c - run selftests
+ czmq_tests.c - run selftests
Runs all selftests.
@@ -7,8 +7,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@
=========================================================================
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zclock.h"
#include "../include/zctx.h"
#include "../include/zframe.h"
@@ -47,7 +47,7 @@ int main (int argc, char *argv [])
else
verbose = FALSE;
- printf ("Running zapi self tests...\n");
+ printf ("Running czmq self tests...\n");
zclock_test (verbose);
zctx_test (verbose);
View
41 src/libczmq.la
@@ -0,0 +1,41 @@
+# libczmq.la - a libtool library file
+# Generated by ltmain.sh (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libczmq.so.0'
+
+# Names of this library.
+library_names='libczmq.so.0.0.0 libczmq.so.0 libczmq.so'
+
+# The name of the static archive.
+old_library='libczmq.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lm -lzmq -lpthread'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libczmq.
+current=0
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/local/lib'
View
10 src/libczmq.pc
@@ -0,0 +1,10 @@
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: libczmq
+Description: High-level C binding for 0MQ
+Version: 1.0.0
+Libs: -L${libdir} -lczmq
+Cflags: -I${includedir}
View
6 src/libzapi.pc.in → src/libczmq.pc.in
@@ -3,8 +3,8 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: libzapi
-Description: zapi C binding for 0MQ
+Name: libczmq
+Description: High-level C binding for 0MQ
Version: @VERSION@
-Libs: -L${libdir} -lzapi
+Libs: -L${libdir} -lczmq
Cflags: -I${includedir}
View
6 src/zclock.c 100755 → 100644
@@ -5,7 +5,7 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of zapi, the C binding for 0MQ: http://zapi.zeromq.org.
+ This file is part of czmq, the C binding for 0MQ: http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free
@@ -35,11 +35,11 @@ for this library will say "insane" at least once. Anyhow, milliseconds
are a concept we can deal with. Seconds are too fat, nanoseconds too
tiny, but milliseconds are just right for slices of time we want to work
with at the 0MQ scale. zclock doesn't give you objects to work with, we
-like the zapi class model but we're not insane. There, got it in again.
+like the czmq class model but we're not insane. There, got it in again.
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zclock.h"
View
12 src/zctx.c 100755 → 100644
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -54,7 +54,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zlist.h"
#include "../include/zstr.h"
#include "../include/zframe.h"
@@ -77,7 +77,7 @@ struct _zctx_t {
// Signal handling
//
-// This is a global variable accessible to zapi application code
+// This is a global variable accessible to czmq application code
int zctx_interrupted = 0;
#if defined (__UNIX__)
static void s_signal_handler (int signal_value)
@@ -183,7 +183,7 @@ zctx_set_linger (zctx_t *self, int linger)
// --------------------------------------------------------------------------
-// Create socket within this context, for libzapi use only
+// Create socket within this context, for czmq use only
void *
zctx__socket_new (zctx_t *self, int type)
@@ -202,7 +202,7 @@ zctx__socket_new (zctx_t *self, int type)
// --------------------------------------------------------------------------
-// Destroy socket within this context, for libzapi use only
+// Destroy socket within this context, for czmq use only
void
zctx__socket_destroy (zctx_t *self, void *socket)
View
6 src/zframe.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -37,7 +37,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zctx.h"
#include "../include/zsocket.h"
#include "../include/zsockopt.h"
View
6 src/zhash.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -34,7 +34,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zhash.h"
// Hash table performance parameters
View
6 src/zlist.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -33,7 +33,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zlist.h"
// List node, used internally only
View
6 src/zloop.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -34,7 +34,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zclock.h"
#include "../include/zctx.h"
#include "../include/zlist.h"
View
6 src/zmsg.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
@@ -34,7 +34,7 @@
@end
*/
-#include "../include/zapi_prelude.h"
+#include "../include/czmq_prelude.h"
#include "../include/zctx.h"
#include "../include/zframe.h"
#include "../include/zlist.h"
View
8 src/zsocket.c
@@ -5,8 +5,8 @@
Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
- This file is part of libzapi, the high-level C binding for 0MQ:
- http://libzapi.zeromq.org.
+ This file is part of czmq, the high-level C binding for 0MQ:
+ http://czmq.zeromq.org.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by