summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-21 11:25:16 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-21 11:25:16 -0800
commit793cf0dbf56fb8669a1d3fafa2a20dc0dd89d326 (patch)
tree2f2330f353f7cb60cbbdcfba7f12c2ff6615825f /src/core
parentf69883d0ed5d48e78e9e658abc145bc1aeb79279 (diff)
downloadnng-793cf0dbf56fb8669a1d3fafa2a20dc0dd89d326.tar.gz
nng-793cf0dbf56fb8669a1d3fafa2a20dc0dd89d326.tar.bz2
nng-793cf0dbf56fb8669a1d3fafa2a20dc0dd89d326.zip
Uncrustify clean now.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/endpt.h20
-rw-r--r--src/core/nng_impl.h2
-rw-r--r--src/core/panic.h2
-rw-r--r--src/core/platform.h8
-rw-r--r--src/core/protocol.h104
5 files changed, 69 insertions, 67 deletions
diff --git a/src/core/endpt.h b/src/core/endpt.h
index f96df047..cd46bb61 100644
--- a/src/core/endpt.h
+++ b/src/core/endpt.h
@@ -19,16 +19,16 @@
*/
struct nng_endpt {
- struct nni_endpt_ops ep_ops;
- void *ep_tran;
- nni_list_node_t ep_sock_node;
- nni_socket_t ep_sock;
- const char *ep_addr;
- nni_thread_t ep_dialer;
- nni_thread_t ep_listener;
- int ep_close;
- nni_mutex_t ep_mx;
- nni_cond_t ep_cv;
+ struct nni_endpt_ops ep_ops;
+ void * ep_tran;
+ nni_list_node_t ep_sock_node;
+ nni_socket_t ep_sock;
+ const char * ep_addr;
+ nni_thread_t ep_dialer;
+ nni_thread_t ep_listener;
+ int ep_close;
+ nni_mutex_t ep_mx;
+ nni_cond_t ep_cv;
};
/*
diff --git a/src/core/nng_impl.h b/src/core/nng_impl.h
index 57aa520f..5b473434 100644
--- a/src/core/nng_impl.h
+++ b/src/core/nng_impl.h
@@ -41,4 +41,4 @@
#include "core/socket.h"
#include "core/endpt.h"
-#endif /* CORE_NNG_IMPL_H */
+#endif /* CORE_NNG_IMPL_H */
diff --git a/src/core/panic.h b/src/core/panic.h
index e77117ee..88ddb7b0 100644
--- a/src/core/panic.h
+++ b/src/core/panic.h
@@ -30,4 +30,4 @@ extern void nni_panic(const char *, ...);
*/
extern void nni_println(const char *);
-#endif /* CORE_PANIC_H */
+#endif /* CORE_PANIC_H */
diff --git a/src/core/platform.h b/src/core/platform.h
index f87042da..32e8727f 100644
--- a/src/core/platform.h
+++ b/src/core/platform.h
@@ -79,13 +79,14 @@ extern void *nni_alloc(size_t);
*/
extern void nni_free(void *, size_t);
-typedef struct nni_mutex *nni_mutex_t;
-typedef struct nni_cond *nni_cond_t;
+typedef struct nni_mutex * nni_mutex_t;
+typedef struct nni_cond * nni_cond_t;
/*
* Mutex handling.
*/
extern int nni_mutex_create(nni_mutex_t *);
+
extern void nni_mutex_destroy(nni_mutex_t);
extern void nni_mutex_enter(nni_mutex_t);
extern void nni_mutex_exit(nni_mutex_t);
@@ -123,7 +124,8 @@ extern void nni_cond_wait(nni_cond_t);
*/
extern int nni_cond_timedwait(nni_cond_t, uint64_t);
-typedef struct nni_thread *nni_thread_t;
+typedef struct nni_thread * nni_thread_t;
+
/*
* nni_thread_creates a thread that runs the given function. The thread
* receives a single argument.
diff --git a/src/core/protocol.h b/src/core/protocol.h
index f524eb46..2b4625cb 100644
--- a/src/core/protocol.h
+++ b/src/core/protocol.h
@@ -28,58 +28,58 @@
*/
struct nni_protocol {
- /*
- * Protocol information.
- */
- uint16_t proto_self; /* our 16-bit protocol ID */
- uint16_t proto_peer; /* who we peer with (protocol ID) */
- const char * proto_name; /* string version of our name */
-
- /*
- * Create protocol instance data, which will be stored on the socket.
- */
- int (*proto_create)(void **, nni_socket_t);
-
- /*
- * Destroy the protocol instance.
- */
- void (*proto_destroy)(void *);
-
- /*
- * Shutdown the protocol instance, including giving time to
- * drain any outbound frames (linger). The protocol is not
- * required to honor the linger.
- */
- void (*proto_shutdown)(void *, uint64_t);
-
- /*
- * Add and remove pipes. These are called as connections are
- * created or destroyed.
- */
- int (*proto_add_pipe)(void *, nni_pipe_t);
- int (*proto_remove_pipe)(void *, nni_pipe_t);
-
- /*
- * Option manipulation. These may be NULL.
- */
- int (*proto_setopt)(void *, int, const void *, size_t);
- int (*proto_getopt)(void *, int, void *, size_t *);
-
- /*
- * Receive filter. This may be NULL, but if it isn't, then
- * messages coming into the system are routed here just before
- * being delivered to the application. To drop the message,
- * the protocol should return NULL, otherwise the message
- * (possibly modified).
- */
- nng_msg_t (*proto_recv_filter)(void *, nni_msg_t);
-
- /*
- * Send filter. This may be NULL, but if it isn't, then
- * messages here are filtered just after they come from the
- * application.
- */
- nng_msg_t (*proto_send_filter)(void *, nni_msg_t);
+ /*
+ * Protocol information.
+ */
+ uint16_t proto_self; /* our 16-bit protocol ID */
+ uint16_t proto_peer; /* who we peer with (protocol ID) */
+ const char * proto_name; /* string version of our name */
+
+ /*
+ * Create protocol instance data, which will be stored on the socket.
+ */
+ int (*proto_create)(void **, nni_socket_t);
+
+ /*
+ * Destroy the protocol instance.
+ */
+ void (*proto_destroy)(void *);
+
+ /*
+ * Shutdown the protocol instance, including giving time to
+ * drain any outbound frames (linger). The protocol is not
+ * required to honor the linger.
+ */
+ void (*proto_shutdown)(void *, uint64_t);
+
+ /*
+ * Add and remove pipes. These are called as connections are
+ * created or destroyed.
+ */
+ int (*proto_add_pipe)(void *, nni_pipe_t);
+ int (*proto_remove_pipe)(void *, nni_pipe_t);
+
+ /*
+ * Option manipulation. These may be NULL.
+ */
+ int (*proto_setopt)(void *, int, const void *, size_t);
+ int (*proto_getopt)(void *, int, void *, size_t *);
+
+ /*
+ * Receive filter. This may be NULL, but if it isn't, then
+ * messages coming into the system are routed here just before
+ * being delivered to the application. To drop the message,
+ * the protocol should return NULL, otherwise the message
+ * (possibly modified).
+ */
+ nng_msg_t (*proto_recv_filter)(void *, nni_msg_t);
+
+ /*
+ * Send filter. This may be NULL, but if it isn't, then
+ * messages here are filtered just after they come from the
+ * application.
+ */
+ nng_msg_t (*proto_send_filter)(void *, nni_msg_t);
};
/*