aboutsummaryrefslogtreecommitdiff
path: root/src/nng_compat.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-26 09:57:56 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-26 09:57:56 -0800
commitd93cbc059cd1e42773d1aec19f8b49a972f2eac3 (patch)
tree71a6c79e8ae5c2ef9ed9beb06088ccd4d832fca9 /src/nng_compat.h
parenta9e81c87a7b2a203c2bd4f310f936af46ef42fc1 (diff)
downloadnng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.tar.gz
nng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.tar.bz2
nng-d93cbc059cd1e42773d1aec19f8b49a972f2eac3.zip
Added more plumbing to facilitate test writing & compatibility.
Also, while here fixed a bug for the PAIR protocol in compat mode. It should now be possible to import more of the nanomsg tests directly with little or no modification.
Diffstat (limited to 'src/nng_compat.h')
-rw-r--r--src/nng_compat.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/nng_compat.h b/src/nng_compat.h
index 5866fe2c..aa0f5a2c 100644
--- a/src/nng_compat.h
+++ b/src/nng_compat.h
@@ -65,7 +65,7 @@ extern "C" {
#define NN_PROTO_SURVEY 6
#define NN_PROTO_BUS 7
-#define NN_PAIR (NN_PROTO_PAIR * 16 + 1)
+#define NN_PAIR (NN_PROTO_PAIR * 16 + 0)
#define NN_PUB (NN_PROTO_PUBSUB * 16 + 0)
#define NN_SUB (NN_PROTO_PUBSUB * 16 + 1)
#define NN_REQ (NN_PROTO_REQREP * 16 + 0)
@@ -299,6 +299,22 @@ NN_DECL int nn_freemsg(void *);
NN_DECL int nn_errno(void);
NN_DECL const char *nn_strerror(int);
+
+// This stuff is intended to be exposed only for test programs and our
+// own utilities. Do not use in your own programs.
+
+#ifdef NNG_PRIVATE
+struct nn_thread {
+ void *thr;
+};
+
+NN_DECL void nn_sleep(uint64_t);
+NN_DECL uint64_t nn_clock(void);
+NN_DECL int nn_thread_init(struct nn_thread *, void (*)(void *), void *);
+NN_DECL void nn_thread_term(struct nn_thread *);
+
+#endif // NNG_PRIVATE
+
#ifdef __cplusplus
}
#endif