From 89c847f1f52969ee2ae6ed35018eef40366ca061 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 17:38:46 -0800 Subject: Work on endpoints. More C99 & type cleanups. --- src/core/transport.c | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'src/core/transport.c') diff --git a/src/core/transport.c b/src/core/transport.c index 61ec5033..2e8dee7a 100644 --- a/src/core/transport.c +++ b/src/core/transport.c @@ -1,35 +1,33 @@ -/* - * Copyright 2016 Garrett D'Amore - * - * 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 +// +// Copyright 2016 Garrett D'Amore +// +// 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 "core/nng_impl.h" -/* - * For now the list of transports is hard-wired. Adding new transports - * to the system dynamically is something that might be considered later. - */ -extern struct nni_transport nni_inproc_transport; +#include + +// For now the list of transports is hard-wired. Adding new transports +// to the system dynamically is something that might be considered later. +extern nni_transport nni_inproc_transport; -static struct nni_transport *transports[] = { +static nni_transport *transports[] = { &nni_inproc_transport, NULL }; -struct nni_transport * +nni_transport * nni_transport_find(const char *addr) { - /* address is of the form "://blah..." */ + // address is of the form "://blah..." const char *end; int len; int i; - struct nni_transport *ops; + nni_transport *ops; if ((end = strstr(addr, "://")) == NULL) { return (NULL); @@ -44,15 +42,13 @@ nni_transport_find(const char *addr) } -/* - * nni_transport_init initializes the entire transport subsystem, including - * each individual transport. - */ +// nni_transport_init initializes the entire transport subsystem, including +// each individual transport. void nni_transport_init(void) { int i; - struct nni_transport *ops; + nni_transport *ops; for (i = 0; (ops = transports[i]) != NULL; i++) { ops->tran_init(); @@ -64,7 +60,7 @@ void nni_transport_fini(void) { int i; - struct nni_transport *ops; + nni_transport *ops; for (i = 0; (ops = transports[i]) != NULL; i++) { if (ops->tran_fini != NULL) { -- cgit v1.2.3-70-g09d2