Skip to content

Commit

Permalink
Problem: zyre is out of sync with zproject
Browse files Browse the repository at this point in the history
Solution: Re-generate!
  • Loading branch information
sappo committed Nov 27, 2018
1 parent 98cbb64 commit d3e8367
Show file tree
Hide file tree
Showing 28 changed files with 352 additions and 92 deletions.
47 changes: 47 additions & 0 deletions bindings/python_cffi/zyre_cffi/cdefs.py
Expand Up @@ -68,6 +68,7 @@
typedef struct _ztimerset_t ztimerset_t;
typedef struct _ztrie_t ztrie_t;
typedef struct _zuuid_t zuuid_t;
typedef struct _zhttp_client_t zhttp_client_t;
// Actors get a pipe and arguments from caller
typedef void (zactor_fn) (
zsock_t *pipe, void *args);
Expand Down Expand Up @@ -1742,6 +1743,12 @@
void
zlistx_destroy (zlistx_t **self_p);
// Unpack binary frame into a new list. Packed data must follow format
// defined by zlistx_pack. List is set to autofree. An empty frame
// unpacks to an empty list.
zlistx_t *
zlistx_unpack (zframe_t *frame);
// Add an item to the head of the list. Calls the item duplicator, if any,
// on the item. Resets cursor to list head. Returns an item handle on
// success, NULL if memory was exhausted.
Expand Down Expand Up @@ -1889,6 +1896,21 @@
void
zlistx_set_comparator (zlistx_t *self, zlistx_comparator_fn comparator);
// Serialize list to a binary frame that can be sent in a message.
// The packed format is compatible with the 'strings' type implemented by zproto:
//
// ; A list of strings
// list = list-count *longstr
// list-count = number-4
//
// ; Strings are always length + text contents
// longstr = number-4 *VCHAR
//
// ; Numbers are unsigned integers in network byte order
// number-4 = 4OCTET
zframe_t *
zlistx_pack (zlistx_t *self);
// Self test of this class.
void
zlistx_test (bool verbose);
Expand Down Expand Up @@ -2521,6 +2543,7 @@
// c = zchunk_t *
// f = zframe_t *
// h = zhashx_t *
// l = zlistx_t * (DRAFT)
// U = zuuid_t *
// p = void * (sends the pointer value, only meaningful over inproc)
// m = zmsg_t * (sends all frames in the zmsg)
Expand Down Expand Up @@ -2554,6 +2577,7 @@
// f = zframe_t ** (creates zframe)
// U = zuuid_t * (creates a zuuid with the data)
// h = zhashx_t ** (creates zhashx)
// l = zlistx_t ** (creates zlistx) (DRAFT)
// p = void ** (stores pointer)
// m = zmsg_t ** (creates a zmsg with the remaining frames)
// z = null, asserts empty frame (0 arguments)
Expand Down Expand Up @@ -4082,6 +4106,29 @@
void
zuuid_test (bool verbose);
// CLASS: zhttp_client
// Create a new http client
zhttp_client_t *
zhttp_client_new (bool verbose);
// Destroy an http client
void
zhttp_client_destroy (zhttp_client_t **self_p);
// Send a get request to the url, headers is optional.
// Use userp to identify response when making multiple requests simultaneously.
int
zhttp_client_get (zhttp_client_t *self, const char *url, zlistx_t *headers, void *userp);
// Receive the response for one of the requests. Blocks until a response is ready.
// Use userp to identify the request.
int
zhttp_client_recv (zhttp_client_t *self, int *response_code, zchunk_t **data, void **userp);
// Self test of this class.
void
zhttp_client_test (bool verbose);
''')

zyre_cdefs.extend (czmq_cdefs)
Expand Down
14 changes: 7 additions & 7 deletions bindings/qt/README.md
Expand Up @@ -4,24 +4,24 @@
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
```
# qzyre
# qtzyre

## Overview

qzyre is a Qt wrapper for zyre. It's possible to
qtzyre is a Qt wrapper for zyre. It's possible to
statically or dynamically link against it as well as use it as internal or external
library.

## Internal library

You can use the Qt wrapper as internal library by including the
`qzyre.pri` file. Here is a minimal example app:
`qtzyre.pri` file. Here is a minimal example app:

```make
QT += core
QT -= gui

include(<path to pri file>/qzyre.pri)
include(<path to pri file>/qtzyre.pri)

CONFIG += console
CONFIG -= app_bundle
Expand All @@ -32,14 +32,14 @@ SOURCES += main.cpp
```

To link statically against the wrapper you need to change the
`QZYRE_LIBRARY` variable in `config.pri` to `no`.
`QTZYRE_LIBRARY` variable in `config.pri` to `no`.

To link dynamically against the wrapper you need to change the
`QZYRE_LIBRARY` variable in `config.pri` to `yes`.
`QTZYRE_LIBRARY` variable in `config.pri` to `yes`.

## External library

To install qzyre as a shared library do the following:
To install qtzyre as a shared library do the following:

```sh
qmake
Expand Down
4 changes: 2 additions & 2 deletions bindings/qt/buildlib/buildlib.pro
Expand Up @@ -4,11 +4,11 @@
################################################################################
TEMPLATE = lib
VERSION = 2.0.1
CONFIG += qt dll qzyre-buildlib
CONFIG += qt dll qtzyre-buildlib
mac:CONFIG += absolute_library_soname
win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all

include(../src/qzyre.pri)
include(../src/qtzyre.pri)

TARGET = $$QZYRE_LIBNAME
DESTDIR = $$QZYRE_LIBDIR
Expand Down
6 changes: 3 additions & 3 deletions bindings/qt/common.pri
Expand Up @@ -2,9 +2,9 @@
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
exists(config.pri):infile(config.pri, QZYRE_LIBRARY, yes): CONFIG += qzyre-uselib
exists(config.pri):infile(config.pri, QTZYRE_LIBRARY, yes): CONFIG += qtzyre-uselib
TEMPLATE += fakelib
QZYRE_LIBNAME = qzyre
QZYRE_LIBNAME = qtzyre
CONFIG(debug, debug|release) {
mac:QZYRE_LIBNAME = $$member(QZYRE_LIBNAME, 0)_debug
else:win32:QZYRE_LIBNAME = $$member(QZYRE_LIBNAME, 0)d
Expand All @@ -13,7 +13,7 @@ TEMPLATE -= fakelib
CONFIG += link_pkgconfig
PKGCONFIG += libzyre
QZYRE_LIBDIR = $$PWD/lib
unix:qzyre-uselib:!qzyre-buildlib:QMAKE_RPATHDIR += $$QZYRE_LIBDIR
unix:qtzyre-uselib:!qtzyre-buildlib:QMAKE_RPATHDIR += $$QZYRE_LIBDIR
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/config.pri
@@ -1 +1 @@
QZYRE_LIBRARY = yes
QTZYRE_LIBRARY = yes
2 changes: 1 addition & 1 deletion bindings/qt/qzyre.pro → bindings/qt/qtzyre.pro
Expand Up @@ -5,7 +5,7 @@
TEMPLATE=subdirs
CONFIG += ordered
include(common.pri)
qzyre-uselib:SUBDIRS=buildlib
qtzyre-uselib:SUBDIRS=buildlib
SUBDIRS+=selftest
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
Expand Down
4 changes: 2 additions & 2 deletions bindings/qt/selftest/main.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/
#include <QDebug>
#include "qzyre.h"
#include "qtzyre.h"

int main(int argc, char **argv)
{
Expand All @@ -15,7 +15,7 @@ int main(int argc, char **argv)
else
verbose = false;

qDebug() << "Running qzyre selftests...\n";
qDebug() << "Running qtzyre selftests...\n";

QZyre::test (verbose);
QZyreEvent::test (verbose);
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/selftest/selftest.pro
Expand Up @@ -5,7 +5,7 @@
QT += core
QT -= gui

include(../src/qzyre.pri)
include(../src/qtzyre.pri)

CONFIG += console
CONFIG -= app_bundle
Expand Down
56 changes: 56 additions & 0 deletions bindings/qt/src/qtzyre.h
@@ -0,0 +1,56 @@
/*
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
*/
#ifndef Q_QTZYRE_H
#define Q_QTZYRE_H

#include <QObject>
#include <QString>
#include <zyre.h>

#if defined(Q_OS_WIN)
# if !defined(QT_ZYRE_EXPORT) && !defined(QT_ZYRE_IMPORT)
# define QT_ZYRE_EXPORT
# elif defined(QT_ZYRE_IMPORT)
# if defined(QT_ZYRE_EXPORT)
# undef QT_ZYRE_EXPORT
# endif
# define QT_ZYRE_EXPORT __declspec(dllimport)
# elif defined(QT_ZYRE_EXPORT)
# undef QT_ZYRE_EXPORT
# define QT_ZYRE_EXPORT __declspec(dllexport)
# endif
#else
# define QT_ZYRE_EXPORT
#endif

// Opaque class structures to allow forward references
class QZyre;
class QZyreEvent;
class QZcert;
class QZmsg;
class QZlist;
class QZsock;
class QZhash;
class QZframe;

// Public API classes
#include "qzyre.h"
#include "qzyreevent.h"
#include "qzcert.h"
#include "qzmsg.h"
#include "qzlist.h"
#include "qzsock.h"
#include "qzhash.h"
#include "qzframe.h"

#endif // Q_ZYRE_H
/*
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
*/
8 changes: 4 additions & 4 deletions bindings/qt/src/qzyre.pri → bindings/qt/src/qtzyre.pri
Expand Up @@ -6,11 +6,11 @@ include(../common.pri)
INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD

qzyre-uselib:!qzyre-buildlib {
qtzyre-uselib:!qtzyre-buildlib {
LIBS += -L$$QZYRE_LIBDIR -l$$QZYRE_LIBNAME
} else {
HEADERS += \
$$PWD/qzyre.h \
$$PWD/qtzyre.h \
$$PWD/qzyre.h \
$$PWD/qzyreevent.h \
$$PWD/qzcert.h \
Expand All @@ -32,8 +32,8 @@ qzyre-uselib:!qzyre-buildlib {
}

win32 {
qzyre-buildlib:shared:DEFINES += QT_ZYRE_EXPORT
else:qzyre-uselib:DEFINES += QT_ZYRE_IMPORT
qtzyre-buildlib:shared:DEFINES += QT_ZYRE_EXPORT
else:qtzyre-uselib:DEFINES += QT_ZYRE_IMPORT
}
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzcert.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/

#include "qzyre.h"
#include "qtzyre.h"

///
// Copy-construct to return the proper wrapped c types
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzcert.h
Expand Up @@ -7,7 +7,7 @@
#ifndef Q_ZCERT_H
#define Q_ZCERT_H

#include "qzyre.h"
#include "qtzyre.h"

class QT_ZYRE_EXPORT QZcert : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzframe.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/

#include "qzyre.h"
#include "qtzyre.h"

///
// Copy-construct to return the proper wrapped c types
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzframe.h
Expand Up @@ -7,7 +7,7 @@
#ifndef Q_ZFRAME_H
#define Q_ZFRAME_H

#include "qzyre.h"
#include "qtzyre.h"

class QT_ZYRE_EXPORT QZframe : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzhash.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/

#include "qzyre.h"
#include "qtzyre.h"

///
// Copy-construct to return the proper wrapped c types
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzhash.h
Expand Up @@ -7,7 +7,7 @@
#ifndef Q_ZHASH_H
#define Q_ZHASH_H

#include "qzyre.h"
#include "qtzyre.h"

class QT_ZYRE_EXPORT QZhash : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzlist.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/

#include "qzyre.h"
#include "qtzyre.h"

///
// Copy-construct to return the proper wrapped c types
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzlist.h
Expand Up @@ -7,7 +7,7 @@
#ifndef Q_ZLIST_H
#define Q_ZLIST_H

#include "qzyre.h"
#include "qtzyre.h"

class QT_ZYRE_EXPORT QZlist : public QObject
{
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzmsg.cpp
Expand Up @@ -5,7 +5,7 @@
################################################################################
*/

#include "qzyre.h"
#include "qtzyre.h"

///
// Copy-construct to return the proper wrapped c types
Expand Down
2 changes: 1 addition & 1 deletion bindings/qt/src/qzmsg.h
Expand Up @@ -7,7 +7,7 @@
#ifndef Q_ZMSG_H
#define Q_ZMSG_H

#include "qzyre.h"
#include "qtzyre.h"

class QT_ZYRE_EXPORT QZmsg : public QObject
{
Expand Down

0 comments on commit d3e8367

Please sign in to comment.