Permalink
Browse files

Problem: zyre out of sync with zproject

Solution: re-generate all!
  • Loading branch information...
sappo committed Mar 12, 2017
1 parent 2fe2dc2 commit d5324ed74bfb733f7498d246e67debbaea299063
View
@@ -25,7 +25,7 @@ check_PROGRAMS =
noinst_LTLIBRARIES =
TESTS =
# Prepare variables that can be populated (appended) in generated Makefiles or
# manually maintained src/Makemodules-local.am
# manually maintained src/Makemodule-local.am
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
@@ -49,6 +49,8 @@ EXTRA_DIST += \
CONTRIBUTING.md \
src/zyre_classes.h
# NOTE: this "include" syntax is not a "make" but an "autotools" keyword,
# see https://www.gnu.org/software/automake/manual/html_node/Include.html
include $(srcdir)/src/Makemodule.am
include $(srcdir)/src/Makemodule-local.am # Optional project-local hook
View
@@ -6,6 +6,11 @@
# Script to generate all required files from fresh git checkout.
if [ ! -f src/Makemodule-local.am ] ; then
echo "autogen.sh: generating a dummy src/Makemodule-local.am to fulfill dependencies." 1>&2
touch src/Makemodule-local.am
fi
# Debian and Ubuntu do not shipt libtool anymore, but OSX does not ship libtoolize.
command -v libtoolize >/dev/null 2>&1
if [ $? -ne 0 ]; then
@@ -43,6 +43,14 @@ Java_org_zeromq_zyre_Zyre__1_1name (JNIEnv *env, jclass c, jlong self)
return return_string_;
}
JNIEXPORT void JNICALL
Java_org_zeromq_zyre_Zyre__1_1setName (JNIEnv *env, jclass c, jlong self, jstring name)
{
char *name_ = (char *) (*env)->GetStringUTFChars (env, name, NULL);
zyre_set_name ((zyre_t *) (intptr_t) self, name_);
(*env)->ReleaseStringUTFChars (env, name, name_);
}
JNIEXPORT void JNICALL
Java_org_zeromq_zyre_Zyre__1_1setHeader (JNIEnv *env, jclass c, jlong self, jstring name, jstring format)
{
@@ -49,13 +49,22 @@ public String uuid () {
return __uuid (self);
}
/*
Return our node name, after successful initialization
Return our node name, after successful initialization. First 6
characters of UUID by default.
*/
native static String __name (long self);
public String name () {
return __name (self);
}
/*
Set the public name of this node overriding the default. The name is
provide during discovery and come in each ENTER message.
*/
native static void __setName (long self, String name);
public void setName (String name) {
__setName (self, name);
}
/*
Set node header; these are provided to other nodes during discovery
and come in each ENTER message.
*/
@@ -43,10 +43,16 @@ void
const char *
zyre_uuid (zyre_t *self);
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const char *
zyre_name (zyre_t *self);
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void
zyre_set_name (zyre_t *self, const char *name);
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
void
View
@@ -70,7 +70,15 @@ Return our node UUID string, after successful initialization
string my_zyre.name ()
```
Return our node name, after successful initialization
Return our node name, after successful initialization. First 6
characters of UUID by default.
```
nothing my_zyre.setName (String)
```
Set the public name of this node overriding the default. The name is
provide during discovery and come in each ENTER message.
```
nothing my_zyre.setHeader (String, String)
View
@@ -35,6 +35,7 @@ NAN_MODULE_INIT (Zyre::Init) {
Nan::SetPrototypeMethod (tpl, "defined", defined);
Nan::SetPrototypeMethod (tpl, "uuid", _uuid);
Nan::SetPrototypeMethod (tpl, "name", _name);
Nan::SetPrototypeMethod (tpl, "setName", _set_name);
Nan::SetPrototypeMethod (tpl, "setHeader", _set_header);
Nan::SetPrototypeMethod (tpl, "setVerbose", _set_verbose);
Nan::SetPrototypeMethod (tpl, "setPort", _set_port);
@@ -123,6 +124,21 @@ NAN_METHOD (Zyre::_name) {
info.GetReturnValue ().Set (Nan::New (result).ToLocalChecked ());
}
NAN_METHOD (Zyre::_set_name) {
Zyre *zyre = Nan::ObjectWrap::Unwrap <Zyre> (info.Holder ());
char *name;
if (info [0]->IsUndefined ())
return Nan::ThrowTypeError ("method requires a `name`");
else
if (!info [0]->IsString ())
return Nan::ThrowTypeError ("`name` must be a string");
else {
Nan::Utf8String name_utf8 (info [0].As<String>());
name = *name_utf8;
}
zyre_set_name (zyre->self, (const char *)name);
}
NAN_METHOD (Zyre::_set_header) {
Zyre *zyre = Nan::ObjectWrap::Unwrap <Zyre> (info.Holder ());
char *name;
@@ -44,6 +44,7 @@ class Zyre: public Nan::ObjectWrap {
static NAN_METHOD (defined);
static NAN_METHOD (_uuid);
static NAN_METHOD (_name);
static NAN_METHOD (_set_name);
static NAN_METHOD (_set_header);
static NAN_METHOD (_set_verbose);
static NAN_METHOD (_set_port);
@@ -73,6 +73,8 @@ class zyre_event_t(Structure):
lib.zyre_uuid.argtypes = [zyre_p]
lib.zyre_name.restype = c_char_p
lib.zyre_name.argtypes = [zyre_p]
lib.zyre_set_name.restype = None
lib.zyre_set_name.argtypes = [zyre_p, c_char_p]
lib.zyre_set_header.restype = None
lib.zyre_set_header.argtypes = [zyre_p, c_char_p, c_char_p]
lib.zyre_set_verbose.restype = None
@@ -192,10 +194,18 @@ def uuid(self):
def name(self):
"""
Return our node name, after successful initialization
Return our node name, after successful initialization. First 6
characters of UUID by default.
"""
return lib.zyre_name(self._as_parameter_)
def set_name(self, name):
"""
Set the public name of this node overriding the default. The name is
provide during discovery and come in each ENTER message.
"""
return lib.zyre_set_name(self._as_parameter_, name)
def set_header(self, name, format, *args):
"""
Set node header; these are provided to other nodes during discovery
@@ -37,10 +37,18 @@ def uuid(self):
def name(self):
"""
Return our node name, after successful initialization
Return our node name, after successful initialization. First 6
characters of UUID by default.
"""
return lib.zyre_name(self._p)
def set_name(self, name):
"""
Set the public name of this node overriding the default. The name is
provide during discovery and come in each ENTER message.
"""
return lib.zyre_set_name(self._p, to_bytes(name))
def set_header(self, name, ):
"""
Set node header; these are provided to other nodes during discovery
@@ -52,10 +52,16 @@
const char *
zyre_uuid (zyre_t *self);
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const char *
zyre_name (zyre_t *self);
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void
zyre_set_name (zyre_t *self, const char *name);
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
void
@@ -54,10 +54,16 @@
const char *
zyre_uuid (zyre_t *self);
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const char *
zyre_name (zyre_t *self);
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void
zyre_set_name (zyre_t *self, const char *name);
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
void
@@ -15,11 +15,19 @@ const QString QmlZyre::uuid () {
};
///
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const QString QmlZyre::name () {
return QString (zyre_name (self));
};
///
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void QmlZyre::setName (const QString &name) {
zyre_set_name (self, name.toUtf8().data());
};
///
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
@@ -31,9 +31,14 @@ public slots:
// Return our node UUID string, after successful initialization
const QString uuid ();
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const QString name ();
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void setName (const QString &name);
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
void setHeader (const QString &name, const QString &format);
View
@@ -42,13 +42,23 @@ const QString QZyre::uuid ()
}
///
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
const QString QZyre::name ()
{
const QString rv = QString (zyre_name (self));
return rv;
}
///
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
void QZyre::setName (const QString &name)
{
zyre_set_name (self, name.toUtf8().data());
}
///
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
@@ -44,6 +44,7 @@ def self.available?
attach_function :zyre_destroy, [:pointer], :void, **opts
attach_function :zyre_uuid, [:pointer], :string, **opts
attach_function :zyre_name, [:pointer], :string, **opts
attach_function :zyre_set_name, [:pointer, :string], :void, **opts
attach_function :zyre_set_header, [:pointer, :string, :string, :varargs], :void, **opts
attach_function :zyre_set_verbose, [:pointer], :void, **opts
attach_function :zyre_set_port, [:pointer, :int], :void, **opts
@@ -105,7 +105,8 @@ def uuid()
result
end
# Return our node name, after successful initialization
# Return our node name, after successful initialization. First 6
# characters of UUID by default.
#
# @return [String]
def name()
@@ -115,6 +116,18 @@ def name()
result
end
# Set the public name of this node overriding the default. The name is
# provide during discovery and come in each ENTER message.
#
# @param name [String, #to_s, nil]
# @return [void]
def set_name(name)
raise DestroyedError unless @ptr
self_p = @ptr
result = ::Zyre::FFI.zyre_set_name(self_p, name)
result
end
# Set node header; these are provided to other nodes during discovery
# and come in each ENTER message.
#
View
@@ -591,6 +591,7 @@ AC_CONFIG_FILES([Makefile
src/libzyre.pc
])
AC_OUTPUT
# Print configure summary and list make options
View
@@ -43,10 +43,16 @@ ZYRE_EXPORT void
ZYRE_EXPORT const char *
zyre_uuid (zyre_t *self);
// Return our node name, after successful initialization
// Return our node name, after successful initialization. First 6
// characters of UUID by default.
ZYRE_EXPORT const char *
zyre_name (zyre_t *self);
// Set the public name of this node overriding the default. The name is
// provide during discovery and come in each ENTER message.
ZYRE_EXPORT void
zyre_set_name (zyre_t *self, const char *name);
// Set node header; these are provided to other nodes during discovery
// and come in each ENTER message.
ZYRE_EXPORT void
View
@@ -25,16 +25,28 @@ endif
# Workaround for automake < 1.14 bug
$(shell dpkg --compare-versions `dpkg-query -W -f='$${Version}\n' automake` lt 1:1.14 && mkdir -p config)
.autogened: autogen.sh
@echo "Executing autogen.sh for this project..."
./autogen.sh
touch $@
clean-autogened:
rm -f .autogened
override_dh_strip:
dh_strip --dbg-package=zyre-dbg
override_dh_auto_test:
echo "Skipped for now"
override_dh_auto_configure:
override_dh_auto_configure: .autogened
dh_auto_configure -- \
--enable-drafts=$(DRAFTS)
# Additional dependency for certain targets
build: .autogened
clean: clean-autogened
%:
dh $@ \
--with autoreconf
@@ -78,8 +78,10 @@ This package contains development files for zyre: an open-source framework for p
%{_libdir}/pkgconfig/libzyre.pc
%{_mandir}/man3/*
%{_mandir}/man7/*
%{_datadir}/zproject/
%{_datadir}/zproject/zyre/
# Install api files into /usr/local/share/zproject
%dir %{_datadir}/zproject/
%dir %{_datadir}/zproject/zyre
%{_datadir}/zproject/zyre/*.api
%prep
%setup -q
Oops, something went wrong.

0 comments on commit d5324ed

Please sign in to comment.