diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-22 17:38:46 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-22 17:38:46 -0800 |
| commit | 89c847f1f52969ee2ae6ed35018eef40366ca061 (patch) | |
| tree | ba3f3c2da64e4a74c69d315b2198df59bcd4441b /src/core/protocol.c | |
| parent | 934c1316ae47754a2e368c65228c3cbfe552680f (diff) | |
| download | nng-89c847f1f52969ee2ae6ed35018eef40366ca061.tar.gz nng-89c847f1f52969ee2ae6ed35018eef40366ca061.tar.bz2 nng-89c847f1f52969ee2ae6ed35018eef40366ca061.zip | |
Work on endpoints. More C99 & type cleanups.
Diffstat (limited to 'src/core/protocol.c')
| -rw-r--r-- | src/core/protocol.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/core/protocol.c b/src/core/protocol.c index 113746b1..6399cd41 100644 --- a/src/core/protocol.c +++ b/src/core/protocol.c @@ -1,37 +1,33 @@ -/* - * Copyright 2016 Garrett D'Amore <garrett@damore.org> - * - * This software is supplied under the terms of the MIT License, a - * copy of which should be located in the distribution where this - * file was obtained (LICENSE.txt). A copy of the license may also be - * found online at https://opensource.org/licenses/MIT. - */ +// +// Copyright 2016 Garrett D'Amore <garrett@damore.org> +// +// This software is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// #include <string.h> #include "core/nng_impl.h" -/* - * Protocol related stuff - generically. - */ +// Protocol related stuff - generically. -/* - * The list of protocols is hardwired. This is reasonably unlikely to - * change, as adding new protocols is not something intended to be done - * outside of the core. - */ -extern struct nni_protocol nni_pair_protocol; +// The list of protocols is hardwired. This is reasonably unlikely to +// change, as adding new protocols is not something intended to be done +// outside of the core. +extern nni_protocol nni_pair_protocol; -static struct nni_protocol *protocols[] = { +static nni_protocol *protocols[] = { &nni_pair_protocol, NULL }; -struct nni_protocol * +nni_protocol * nni_protocol_find(uint16_t num) { int i; - struct nni_protocol *p; + nni_protocol *p; for (i = 0; (p = protocols[i]) != NULL; i++) { if (p->proto_self == num) { @@ -45,7 +41,7 @@ nni_protocol_find(uint16_t num) const char * nni_protocol_name(uint16_t num) { - struct nni_protocol *p; + nni_protocol *p; if ((p = nni_protocol_find(num)) == NULL) { return (NULL); @@ -57,7 +53,7 @@ nni_protocol_name(uint16_t num) uint16_t nni_protocol_number(const char *name) { - struct nni_protocol *p; + nni_protocol *p; int i; for (i = 0; (p = protocols[i]) != NULL; i++) { |
