From 61d9b04f66055e61f0afdf8955ff890f4da39288 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 27 Jul 2017 14:58:13 +0200 Subject: [PATCH] Update all header guards. Don't start with underscores, as those are reserved for system libraries. Make sure all start with MESHLINK_, and that they appear at the top of the file. --- src/buffer.h | 23 +++++++++++++++++++++-- src/conf.h | 10 +++++----- src/connection.h | 10 +++++----- src/crypto.h | 8 ++++---- src/devtools.h | 23 +++++++++++++++++++++-- src/discovery.h | 22 ++++++++++++++++++++-- src/dropin.h | 10 +++++----- src/ecdh.h | 8 ++++---- src/ecdsa.h | 8 ++++---- src/ecdsagen.h | 8 ++++---- src/edge.h | 10 +++++----- src/event.h | 8 ++++---- src/fake-gai-errnos.h | 11 ++++------- src/fake-getaddrinfo.h | 6 +++--- src/fake-getnameinfo.h | 6 +++--- src/graph.h | 10 +++++----- src/hash.h | 10 +++++----- src/have.h | 10 +++++----- src/list.h | 10 +++++----- src/logger.h | 10 +++++----- src/meshlink++.h | 10 +++++----- src/meshlink.h | 10 +++++----- src/meshlink_internal.h | 10 +++++----- src/meshlink_queue.h | 8 ++++---- src/meta.h | 10 +++++----- src/net.h | 10 +++++----- src/netutl.h | 10 +++++----- src/node.h | 10 +++++----- src/prf.h | 8 ++++---- src/protocol.h | 10 +++++----- src/route.h | 10 +++++----- src/sockaddr.h | 6 +++--- src/splay_tree.h | 9 ++++----- src/sptps.h | 8 ++++---- src/system.h | 10 +++++----- src/utils.h | 10 +++++----- src/xalloc.h | 8 ++++---- 37 files changed, 215 insertions(+), 163 deletions(-) diff --git a/src/buffer.h b/src/buffer.h index e7bfb058..493d3293 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,5 +1,24 @@ -#ifndef __MESHLINK_BUFFER_H__ -#define __MESHLINK_BUFFER_H__ +#ifndef MESHLINK_BUFFER_H +#define MESHLINK_BUFFER_H + +/* + conf.h -- header for conf.c + Copyright (C) 2014, 2017 Guus Sliepen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ typedef struct buffer_t { char *data; diff --git a/src/conf.h b/src/conf.h index 74849a21..715f9965 100644 --- a/src/conf.h +++ b/src/conf.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_CONF_H +#define MESHLINK_CONF_H + /* conf.h -- header for conf.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_CONF_H__ -#define __MESHLINK_CONF_H__ - #include "list.h" #include "meshlink_internal.h" #include "splay_tree.h" @@ -55,4 +55,4 @@ extern bool write_host_config(struct meshlink_handle *mesh, const struct splay_t extern bool modify_config_file(struct meshlink_handle *mesh, const char *, const char *, const char *, bool); extern bool append_config_file(struct meshlink_handle *mesh, const char *, const char *, const char *); -#endif /* __MESHLINK_CONF_H__ */ +#endif diff --git a/src/connection.h b/src/connection.h index a79d6b13..35dd1982 100644 --- a/src/connection.h +++ b/src/connection.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_CONNECTION_H +#define MESHLINK_CONNECTION_H + /* connection.h -- header for connection.c - Copyright (C) 2000-2013 Guus Sliepen + Copyright (C) 2000-2013, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_CONNECTION_H__ -#define __MESHLINK_CONNECTION_H__ - #include "buffer.h" #include "list.h" #include "sptps.h" @@ -94,4 +94,4 @@ extern void free_connection(connection_t *); extern void connection_add(struct meshlink_handle *mesh, connection_t *); extern void connection_del(struct meshlink_handle *mesh, connection_t *); -#endif /* __MESHLINK_CONNECTION_H__ */ +#endif diff --git a/src/crypto.h b/src/crypto.h index 4514f8da..779f4522 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_CRYPTO_H +#define MESHLINK_CRYPTO_H + /* crypto.h -- header for crypto.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_CRYPTO_H__ -#define __MESHLINK_CRYPTO_H__ - extern void crypto_init(); extern void crypto_exit(); extern void randomize(void *, size_t); diff --git a/src/devtools.h b/src/devtools.h index 9ac58d52..53755187 100644 --- a/src/devtools.h +++ b/src/devtools.h @@ -1,5 +1,24 @@ -#ifndef __MESHLINK_DEVTOOLS_H__ -#define __MESHLINK_DEVTOOLS_H__ +#ifndef MESHLINK_DEVTOOLS_H +#define MESHLINK_DEVTOOLS_H + +/* + devtools.h -- header for devtools.h + Copyright (C) 2014, 2017 Guus Sliepen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ extern bool devtool_export_json_all_edges_state(meshlink_handle_t *mesh, FILE* stream); diff --git a/src/discovery.h b/src/discovery.h index 0455d6ed..055aa9de 100644 --- a/src/discovery.h +++ b/src/discovery.h @@ -1,6 +1,24 @@ +#ifndef MESHLINK_DISCOVERY_H +#define MESHLINK_DISCOVERY_H -#ifndef __MESHLINK_DISCOVERY_H__ -#define __MESHLINK_DISCOVERY_H__ +/* + discovery.h -- header for dicovery.c + Copyright (C) 2014, 2017 Guus Sliepen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include diff --git a/src/dropin.h b/src/dropin.h index 78c0760f..06db98b0 100644 --- a/src/dropin.h +++ b/src/dropin.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_DROPIN_H +#define MESHLINK_DROPIN_H + /* dropin.h -- header file for dropin.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __DROPIN_H__ -#define __DROPIN_H__ - #include "fake-getaddrinfo.h" #include "fake-getnameinfo.h" @@ -65,4 +65,4 @@ extern int usleep(long long usec); #endif #endif -#endif /* __DROPIN_H__ */ +#endif diff --git a/src/ecdh.h b/src/ecdh.h index 92be3ed5..eb66ec0d 100644 --- a/src/ecdh.h +++ b/src/ecdh.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_ECDH_H +#define MESHLINK_ECDH_H + /* ecdh.h -- header file for ecdh.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_ECDH_H__ -#define __MESHLINK_ECDH_H__ - #define ECDH_SIZE 32 #define ECDH_SHARED_SIZE 32 diff --git a/src/ecdsa.h b/src/ecdsa.h index ef10fe71..364b2726 100644 --- a/src/ecdsa.h +++ b/src/ecdsa.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_ECDSA_H +#define MESHLINK_ECDSA_H + /* ecdsa.h -- ECDSA key handling - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_ECDSA_H__ -#define __MESHLINK_ECDSA_H__ - #ifndef __MESHLINK_ECDSA_INTERNAL__ typedef struct ecdsa ecdsa_t; #endif diff --git a/src/ecdsagen.h b/src/ecdsagen.h index f4578be6..812a98b4 100644 --- a/src/ecdsagen.h +++ b/src/ecdsagen.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_ECDSAGEN_H +#define MESHLINK_ECDSAGEN_H + /* ecdsagen.h -- ECDSA key generation and export - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_ECDSAGEN_H__ -#define __MESHLINK_ECDSAGEN_H__ - #include "ecdsa.h" extern ecdsa_t *ecdsa_generate(void) __attribute__((__malloc__)); diff --git a/src/edge.h b/src/edge.h index 53ef354c..cc7a449b 100644 --- a/src/edge.h +++ b/src/edge.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_EDGE_H +#define MESHLINK_EDGE_H + /* edge.h -- header for edge.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_EDGE_H__ -#define __MESHLINK_EDGE_H__ - #include "splay_tree.h" #include "connection.h" #include "net.h" @@ -47,4 +47,4 @@ extern void edge_add(struct meshlink_handle *mesh, edge_t *); extern void edge_del(struct meshlink_handle *mesh, edge_t *); extern edge_t *lookup_edge(struct node_t *, struct node_t *); -#endif /* __MESHLINK_EDGE_H__ */ +#endif diff --git a/src/event.h b/src/event.h index fe64413e..cf3c70a1 100644 --- a/src/event.h +++ b/src/event.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_EVENT_H +#define MESHLINK_EVENT_H + /* event.h -- I/O, timeout and signal event handling - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_EVENT_H__ -#define __MESHLINK_EVENT_H__ - #include "splay_tree.h" #include "system.h" #include diff --git a/src/fake-gai-errnos.h b/src/fake-gai-errnos.h index 2f41d8f0..5ec371ca 100644 --- a/src/fake-gai-errnos.h +++ b/src/fake-gai-errnos.h @@ -1,11 +1,6 @@ -/* - * fake library for ssh - * - * This file is included in getaddrinfo.c and getnameinfo.c. - * See getaddrinfo.c and getnameinfo.c. - */ +#ifndef MESHLINK_FAKE_GAI_ERRNOS_H +#define MESHLINK_FAKE_GAI_ERRNOS_H -/* for old netdb.h */ #ifndef EAI_NODATA #define EAI_NODATA 1 #endif @@ -21,3 +16,5 @@ #ifndef EAI_SYSTEM #define EAI_SYSTEM 4 #endif + +#endif diff --git a/src/fake-getaddrinfo.h b/src/fake-getaddrinfo.h index 5809985b..db3621b4 100644 --- a/src/fake-getaddrinfo.h +++ b/src/fake-getaddrinfo.h @@ -1,5 +1,5 @@ -#ifndef _FAKE_GETADDRINFO_H -#define _FAKE_GETADDRINFO_H +#ifndef MESHLINK_FAKE_GETADDRINFO_H +#define MESHLINK_FAKE_GETADDRINFO_H #include "fake-gai-errnos.h" @@ -43,4 +43,4 @@ char *gai_strerror(int ecode); void freeaddrinfo(struct addrinfo *ai); #endif /* !HAVE_FREEADDRINFO */ -#endif /* _FAKE_GETADDRINFO_H */ +#endif diff --git a/src/fake-getnameinfo.h b/src/fake-getnameinfo.h index 043ed978..e6951642 100644 --- a/src/fake-getnameinfo.h +++ b/src/fake-getnameinfo.h @@ -1,5 +1,5 @@ -#ifndef _FAKE_GETNAMEINFO_H -#define _FAKE_GETNAMEINFO_H +#ifndef MESHLINK_FAKE_GETNAMEINFO_H +#define MESHLINK_FAKE_GETNAMEINFO_H #if !HAVE_DECL_GETNAMEINFO int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); @@ -12,4 +12,4 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t host # define NI_MAXHOST 1025 #endif /* !NI_MAXHOST */ -#endif /* _FAKE_GETNAMEINFO_H */ +#endif diff --git a/src/graph.h b/src/graph.h index 925fe2ff..2375cc6c 100644 --- a/src/graph.h +++ b/src/graph.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_GRAPH_H +#define MESHLINK_GRAPH_H + /* graph.h -- header for graph.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_GRAPH_H__ -#define __MESHLINK_GRAPH_H__ - extern void graph(struct meshlink_handle *mesh); -#endif /* __MESHLINK_GRAPH_H__ */ +#endif diff --git a/src/hash.h b/src/hash.h index 182a1c95..de96f888 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_HASH_H +#define MESHLINK_HASH_H + /* hash.h -- header file for hash.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_HASH_H__ -#define __MESHLINK_HASH_H__ - typedef struct hash_t { size_t n; size_t size; @@ -38,4 +38,4 @@ extern void *hash_search_or_insert(hash_t *, const void *key, const void *value) extern void hash_clear(hash_t *); extern void hash_resize(hash_t *, size_t n); -#endif /* __MESHLINK_HASH_H__ */ +#endif diff --git a/src/have.h b/src/have.h index 2b5f2463..7695adc1 100644 --- a/src/have.h +++ b/src/have.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_HAVE_H +#define MESHLINK_HAVE_H + /* have.h -- include headers which are known to exist - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_HAVE_H__ -#define __MESHLINK_HAVE_H__ - #ifdef HAVE_MINGW #ifdef WITH_WINDOWS2000 #define WINVER Windows2000 @@ -126,4 +126,4 @@ #define SLASH "/" #endif -#endif /* __MESHLINK_SYSTEM_H__ */ +#endif diff --git a/src/list.h b/src/list.h index 3cda17a6..254fbffd 100644 --- a/src/list.h +++ b/src/list.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_LIST_H +#define MESHLINK_LIST_H + /* list.h -- header file for list.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_LIST_H__ -#define __MESHLINK_LIST_H__ - typedef struct list_node_t { struct list_node_t *prev; struct list_node_t *next; @@ -80,4 +80,4 @@ extern void list_foreach_node(list_t *, list_action_node_t); #define list_each(type, item, list) (type *item = (type *)1; item; item = NULL) for(list_node_t *node = (list)->head, *next; item = node ? node->data : NULL, next = node ? node->next : NULL, node; node = next) -#endif /* __MESHLINK_LIST_H__ */ +#endif diff --git a/src/logger.h b/src/logger.h index 05773d6c..d6a28c59 100644 --- a/src/logger.h +++ b/src/logger.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_LOGGER_H +#define MESHLINK_LOGGER_H + /* logger.h -- header file for logger.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,11 +20,8 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_LOGGER_H__ -#define __MESHLINK_LOGGER_H__ - #include "meshlink_internal.h" extern void logger(meshlink_handle_t *mesh, meshlink_log_level_t level, const char *format, ...) __attribute__((__format__(printf, 3, 4))); -#endif /* __MESHLINK_LOGGER_H__ */ +#endif diff --git a/src/meshlink++.h b/src/meshlink++.h index df0a72b5..f1c415a9 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -1,6 +1,9 @@ +#ifndef MESHLINKPP_H +#define MESHLINKPP_H + /* meshlink++.h -- MeshLink C++ API - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MESHLINKPP_H -#define MESHLINKPP_H - #include #include // for 'placement new' @@ -633,4 +633,4 @@ static bool destroy(const char *confbase) { } } -#endif // MESHLINKPP_H +#endif diff --git a/src/meshlink.h b/src/meshlink.h index e307128f..30491b00 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_H +#define MESHLINK_H + /* meshlink.h -- MeshLink API - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MESHLINK_H -#define MESHLINK_H - #include #include #include @@ -836,4 +836,4 @@ extern meshlink_edge_t **meshlink_get_all_edges_state(meshlink_handle_t *mesh, m } #endif -#endif // MESHLINK_H +#endif diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index 710acdd7..fa5e60ea 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_INTERNAL_H +#define MESHLINK_INTERNAL_H + /* meshlink_internal.h -- Internal parts of the public API. - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MESHLINK_INTERNAL_H -#define MESHLINK_INTERNAL_H - #include "system.h" #include "event.h" @@ -181,4 +181,4 @@ typedef struct { extern dev_class_traits_t dev_class_traits[]; -#endif // MESHLINK_INTERNAL_H +#endif diff --git a/src/meshlink_queue.h b/src/meshlink_queue.h index c86bf660..511d0b3c 100644 --- a/src/meshlink_queue.h +++ b/src/meshlink_queue.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_QUEUE_H +#define MESHLINK_QUEUE_H + /* queue.h -- Thread-safe queue - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MESHLINK_QUEUE_H -#define MESHLINK_QUEUE_H - #include #include #include diff --git a/src/meta.h b/src/meta.h index 38c9b811..6372e34a 100644 --- a/src/meta.h +++ b/src/meta.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_META_H +#define MESHLINK_META_H + /* meta.h -- header for meta.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_META_H__ -#define __MESHLINK_META_H__ - #include "connection.h" extern bool send_meta(struct meshlink_handle *mesh, struct connection_t *, const char *, int); @@ -28,4 +28,4 @@ extern bool receive_meta_sptps(void *, uint8_t, const void *, uint16_t); extern void broadcast_meta(struct meshlink_handle *mesh, struct connection_t *, const char *, int); extern bool receive_meta(struct meshlink_handle *mesh, struct connection_t *); -#endif /* __MESHLINK_META_H__ */ +#endif diff --git a/src/net.h b/src/net.h index 6c5a0a6f..1eed88d1 100644 --- a/src/net.h +++ b/src/net.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_NET_H +#define MESHLINK_NET_H + /* net.h -- header for net.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_NET_H__ -#define __MESHLINK_NET_H__ - #include "event.h" #include "sockaddr.h" @@ -115,4 +115,4 @@ extern void retry(struct meshlink_handle *mesh); extern CRITICAL_SECTION mutex; #endif -#endif /* __MESHLINK_NET_H__ */ +#endif diff --git a/src/netutl.h b/src/netutl.h index 065f4b20..2f68e832 100644 --- a/src/netutl.h +++ b/src/netutl.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_NETUTL_H +#define MESHLINK_NETUTL_H + /* netutl.h -- header file for netutl.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_NETUTL_H__ -#define __MESHLINK_NETUTL_H__ - #include "net.h" extern bool hostnames; @@ -34,4 +34,4 @@ extern void sockaddrunmap(sockaddr_t *); extern void sockaddrfree(sockaddr_t *); extern void sockaddrcpy(sockaddr_t *, const sockaddr_t *); -#endif /* __MESHLINK_NETUTL_H__ */ +#endif diff --git a/src/node.h b/src/node.h index 0140bb38..33bac256 100644 --- a/src/node.h +++ b/src/node.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_NODE_H +#define MESHLINK_NODE_H + /* node.h -- header for node.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_NODE_H__ -#define __MESHLINK_NODE_H__ - #include "event.h" #include "sockaddr.h" #include "sptps.h" @@ -97,4 +97,4 @@ extern node_t *lookup_node(struct meshlink_handle *mesh, const char *); extern node_t *lookup_node_udp(struct meshlink_handle *mesh, const sockaddr_t *); extern void update_node_udp(struct meshlink_handle *mesh, node_t *, const sockaddr_t *); -#endif /* __MESHLINK_NODE_H__ */ +#endif diff --git a/src/prf.h b/src/prf.h index 67d6845f..1fc0ee19 100644 --- a/src/prf.h +++ b/src/prf.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_PRF_H +#define MESHLINK_PRF_H + /* prf.h -- header file for prf.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_PRF_H__ -#define __MESHLINK_PRF_H__ - extern bool prf(const char *secret, size_t secretlen, char *seed, size_t seedlen, char *out, size_t outlen) __attribute__((__warn_unused_result__)); #endif diff --git a/src/protocol.h b/src/protocol.h index dd042ec6..0070cd02 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_PROTOCOL_H +#define MESHLINK_PROTOCOL_H + /* protocol.h -- header for protocol.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_PROTOCOL_H__ -#define __MESHLINK_PROTOCOL_H__ - #include "ecdsa.h" /* Protocol version. Different major versions are incompatible. */ @@ -111,4 +111,4 @@ extern bool req_key_h(struct meshlink_handle *mesh, struct connection_t *, const extern bool ans_key_h(struct meshlink_handle *mesh, struct connection_t *, const char *); extern bool tcppacket_h(struct meshlink_handle *mesh, struct connection_t *, const char *); -#endif /* __MESHLINK_PROTOCOL_H__ */ +#endif diff --git a/src/route.h b/src/route.h index ea3a7760..16e3a97d 100644 --- a/src/route.h +++ b/src/route.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_ROUTE_H +#define MESHLINK_ROUTE_H + /* route.h -- header file for route.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_ROUTE_H__ -#define __MESHLINK_ROUTE_H__ - #include "net.h" #include "node.h" @@ -27,4 +27,4 @@ extern bool decrement_ttl; extern void route(struct meshlink_handle *mesh, struct node_t *, struct vpn_packet_t *); -#endif /* __MESHLINK_ROUTE_H__ */ +#endif diff --git a/src/sockaddr.h b/src/sockaddr.h index 775f81f6..1a98d478 100644 --- a/src/sockaddr.h +++ b/src/sockaddr.h @@ -1,5 +1,5 @@ -#ifndef SOCKADDR_H -#define SOCKADDR_H +#ifndef MESHLINK_SOCKADDR_H +#define MESHLINK_SOCKADDR_H #define AF_UNKNOWN 255 @@ -25,4 +25,4 @@ typedef union sockaddr_t { struct sockaddr_storage storage; } sockaddr_t; -#endif // SOCKADDR_H +#endif diff --git a/src/splay_tree.h b/src/splay_tree.h index 4b4f18eb..f1ff7db9 100644 --- a/src/splay_tree.h +++ b/src/splay_tree.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_SPLAY_TREE_H +#define MESHLINK_SPLAY_TREE_H + /* splay_tree.h -- header file for splay_tree.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,10 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -#ifndef __SPLAY_TREE_H__ -#define __SPLAY_TREE_H__ - typedef struct splay_node_t { /* Linked list part */ diff --git a/src/sptps.h b/src/sptps.h index ab163442..11c0d2e6 100644 --- a/src/sptps.h +++ b/src/sptps.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_SPTPS_H +#define MESHLINK_SPTPS_H + /* sptps.h -- Simple Peer-to-Peer Security - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __SPTPS_H__ -#define __SPTPS_H__ - #include "system.h" #include "chacha-poly1305/chacha-poly1305.h" diff --git a/src/system.h b/src/system.h index 69622b2c..2c095515 100644 --- a/src/system.h +++ b/src/system.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_SYSTEM_H +#define MESHLINK_SYSTEM_H + /* system.h -- system headers - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_SYSTEM_H__ -#define __MESHLINK_SYSTEM_H__ - #include "../config.h" #include "have.h" @@ -42,4 +42,4 @@ typedef int bool; typedef int socklen_t; #endif -#endif /* __MESHLINK_SYSTEM_H__ */ +#endif diff --git a/src/utils.h b/src/utils.h index 1ea1026a..371a327d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_UTILS_H +#define MESHLINK_UTILS_H + /* utils.h -- header file for utils.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_UTILS_H__ -#define __MESHLINK_UTILS_H__ - extern int hex2bin(const char *src, void *dst, int length); extern int bin2hex(const void *src, char *dst, int length); @@ -47,4 +47,4 @@ extern const char *winerror(int); extern unsigned int bitfield_to_int(const void *bitfield, size_t size); -#endif /* __MESHLINK_UTILS_H__ */ +#endif diff --git a/src/xalloc.h b/src/xalloc.h index fba0be90..f6b895a5 100644 --- a/src/xalloc.h +++ b/src/xalloc.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_XALLOC_H +#define MESHLINK_XALLOC_H + /* xalloc.h -- malloc and related fuctions with out of memory checking - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_XALLOC_H__ -#define __MESHLINK_XALLOC_H__ - static inline void *xmalloc(size_t n) __attribute__((__malloc__)); static inline void *xmalloc(size_t n) { void *p = malloc(n); -- 2.39.2