diff --git a/include/villas/format_type.h b/include/villas/format_type.h index c8771e9ae..cc233effe 100644 --- a/include/villas/format_type.h +++ b/include/villas/format_type.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; struct io; @@ -106,7 +102,3 @@ struct format_type { struct format_type * format_type_lookup(const char *name); const char * format_type_name(struct format_type *vt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/csv.h b/include/villas/formats/csv.h index 09352492f..97ca93a1f 100644 --- a/include/villas/formats/csv.h +++ b/include/villas/formats/csv.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations. */ struct io; struct sample; @@ -37,7 +33,3 @@ void csv_header(struct io *io, const struct sample *smp); int csv_sprint(struct io *io, char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt); int csv_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/json-reserve.h b/include/villas/formats/json-reserve.h index c36a69c5b..2b10e2537 100644 --- a/include/villas/formats/json-reserve.h +++ b/include/villas/formats/json-reserve.h @@ -24,10 +24,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; struct io; @@ -37,7 +33,3 @@ int json_reserve_sscan(struct io *io, const char *buf, size_t len, size_t *rbyte int json_reserve_print(struct io *io, struct sample *smps[], unsigned cnt); int json_reserve_scan(struct io *io, struct sample *smps[], unsigned cnt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/json.h b/include/villas/formats/json.h index 1e156d959..da685fa18 100644 --- a/include/villas/formats/json.h +++ b/include/villas/formats/json.h @@ -24,10 +24,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; @@ -37,6 +33,3 @@ int json_sscan(struct io *io, const char *buf, size_t len, size_t *wbytes, struc int json_print(struct io *io, struct sample *smps[], unsigned cnt); int json_scan(struct io *io, struct sample *smps[], unsigned cnt); -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/msg.h b/include/villas/formats/msg.h index 753040026..5a06520f5 100644 --- a/include/villas/formats/msg.h +++ b/include/villas/formats/msg.h @@ -22,10 +22,6 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declaration */ struct msg; struct sample; @@ -58,7 +54,3 @@ int msg_to_sample(struct msg *msg, struct sample *smp, struct vlist *signals); /** Copy fields form \p smp into \p msg. */ int msg_from_sample(struct msg *msg, struct sample *smp, struct vlist *signals); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/msg_format.h b/include/villas/formats/msg_format.h index 1d7aaecc0..029cf5210 100644 --- a/include/villas/formats/msg_format.h +++ b/include/villas/formats/msg_format.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /** The current version number for the message format */ #define MSG_VERSION 2 @@ -86,7 +82,3 @@ struct msg uint32_t i; /**< Integer values. */ } data[]; } __attribute__((packed)); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/protobuf.h b/include/villas/formats/protobuf.h index 360131877..f02985536 100644 --- a/include/villas/formats/protobuf.h +++ b/include/villas/formats/protobuf.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; @@ -38,6 +34,3 @@ int protobuf_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct /** Read struct sample's from buffer \p buf into samples \p smps. */ int protobuf_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt); -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/raw.h b/include/villas/formats/raw.h index 5bb340102..3b3742644 100644 --- a/include/villas/formats/raw.h +++ b/include/villas/formats/raw.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* float128 is currently not yet supported as htole128() functions a missing */ #if 0 && defined(__GNUC__) && defined(__linux__) #define HAS_128BIT @@ -57,6 +53,3 @@ int raw_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct samp /** Read struct sample's from buffer \p buf into samples \p smps. */ int raw_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt); -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/villas_binary.h b/include/villas/formats/villas_binary.h index 16fc6d5ad..824e993fd 100644 --- a/include/villas/formats/villas_binary.h +++ b/include/villas/formats/villas_binary.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations. */ struct sample; struct msg; @@ -43,7 +39,3 @@ int villas_binary_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, s /** Read struct sample's from buffer \p buf into samples \p smps. */ int villas_binary_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct sample *smps[], unsigned cnt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/formats/villas_human.h b/include/villas/formats/villas_human.h index 12e44a441..51b03b382 100644 --- a/include/villas/formats/villas_human.h +++ b/include/villas/formats/villas_human.h @@ -25,10 +25,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct io; struct sample; @@ -37,7 +33,3 @@ void villas_human_header(struct io *io, const struct sample *smp); int villas_human_print(struct io *io, struct sample *smps[], unsigned cnt); int villas_human_scan(struct io *io, struct sample *smps[], unsigned cnt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/hook.h b/include/villas/hook.h index b736cf26c..b8d4021a8 100644 --- a/include/villas/hook.h +++ b/include/villas/hook.h @@ -33,10 +33,6 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - enum hook_flags { HOOK_BUILTIN = (1 << 0), /**< Should we add this hook by default to every path?. */ HOOK_PATH = (1 << 1), /**< This hook type is used by paths. */ @@ -50,7 +46,3 @@ enum hook_reason { HOOK_SKIP_SAMPLE, HOOK_STOP_PROCESSING }; - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/io.h b/include/villas/io.h index e0d18c700..a74718368 100644 --- a/include/villas/io.h +++ b/include/villas/io.h @@ -28,10 +28,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; struct format_type; @@ -150,7 +146,3 @@ int io_sscan(struct io *io, const char *buf, size_t len, size_t *rbytes, struct * @retval <0 Something went wrong. */ int io_sprint(struct io *io, char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/kernel/if.h b/include/villas/kernel/if.h index ab46e37d5..665a6b0fe 100644 --- a/include/villas/kernel/if.h +++ b/include/villas/kernel/if.h @@ -35,10 +35,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - #define IF_IRQ_MAX 3 /**< Maxmimal number of IRQs of an interface */ #ifndef SO_MARK @@ -134,8 +130,4 @@ int if_get_irqs(struct interface *i); */ int if_set_affinity(struct interface *i, int affinity); - -#ifdef __cplusplus -} -#endif /** @} */ diff --git a/include/villas/kernel/nl.h b/include/villas/kernel/nl.h index b62d701ea..727babadf 100644 --- a/include/villas/kernel/nl.h +++ b/include/villas/kernel/nl.h @@ -31,10 +31,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /** Get index of outgoing interface for given destination address. * * @retval >=0 Interface index of outgoing interface. @@ -48,8 +44,4 @@ struct nl_sock *nl_init(); /** Close and free global netlink socket. */ void nl_shutdown(); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/kernel/tc.h b/include/villas/kernel/tc.h index 6e0fb9b0f..4fdcde5d2 100644 --- a/include/villas/kernel/tc.h +++ b/include/villas/kernel/tc.h @@ -39,10 +39,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - typedef uint32_t tc_hdl_t; struct interface; @@ -78,8 +74,4 @@ int tc_prio(struct interface *i, struct rtnl_qdisc **qd, tc_hdl_t handle, tc_hdl */ int tc_mark(struct interface *i, struct rtnl_cls **cls, tc_hdl_t flowid, uint32_t mark); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/kernel/tc_netem.h b/include/villas/kernel/tc_netem.h index 3cb67dc0b..868ced83b 100644 --- a/include/villas/kernel/tc_netem.h +++ b/include/villas/kernel/tc_netem.h @@ -39,10 +39,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - typedef uint32_t tc_hdl_t; struct interface; @@ -76,8 +72,4 @@ int tc_netem(struct interface *i, struct rtnl_qdisc **qd, tc_hdl_t handle, tc_hd int tc_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, json_t *json); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/mapping.h b/include/villas/mapping.h index 3505f2531..eb816b76b 100644 --- a/include/villas/mapping.h +++ b/include/villas/mapping.h @@ -28,10 +28,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct node; struct sample; @@ -101,7 +97,3 @@ int mapping_list_parse(struct vlist *ml, json_t *cfg, struct vlist *nodes); int mapping_list_prepare(struct vlist *ml); int mapping_list_remap(const struct vlist *ml, struct sample *remapped, const struct sample *original); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/memory.h b/include/villas/memory.h index 2678679eb..55515c343 100644 --- a/include/villas/memory.h +++ b/include/villas/memory.h @@ -30,10 +30,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct node; @@ -85,7 +81,3 @@ void * memory_alloc_aligned(struct memory_type *m, size_t len, size_t alignment) int memory_free(void *ptr); struct memory_allocation * memory_get_allocation(void *ptr); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/memory/ib.h b/include/villas/memory/ib.h index 049ac863a..356c1efa2 100644 --- a/include/villas/memory/ib.h +++ b/include/villas/memory/ib.h @@ -25,17 +25,9 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - struct memory_ib { struct ibv_pd *pd; struct memory_type *parent; }; struct ibv_mr * memory_ib_get_mr(void *ptr); - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/include/villas/memory_type.h b/include/villas/memory_type.h index 76aeefaea..b0823642b 100644 --- a/include/villas/memory_type.h +++ b/include/villas/memory_type.h @@ -26,10 +26,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct memory_type; struct node; @@ -66,6 +62,3 @@ int memory_hugepage_init(int hugepages); struct memory_type * memory_type_lookup(enum memory_type_flags flags); -#ifdef __cplusplus -} -#endif diff --git a/include/villas/node.h b/include/villas/node.h index 0275343d5..1b831ad72 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -43,10 +43,6 @@ #define WITH_NETEM #endif /* LIBNL3_ROUTE_FOUND */ -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ #ifdef WITH_NETEM struct rtnl_qdisc; @@ -204,8 +200,4 @@ bool node_is_enabled(const struct node *n); struct vlist * node_get_signals(struct node *n, enum node_dir dir); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/node_direction.h b/include/villas/node_direction.h index 48a8ee289..ed07b4cf8 100644 --- a/include/villas/node_direction.h +++ b/include/villas/node_direction.h @@ -33,10 +33,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct node; @@ -76,7 +72,3 @@ int node_direction_destroy(struct node_direction *nd, struct node *n); struct vlist * node_direction_get_signals(struct node_direction *nd); /** @} */ - -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/include/villas/node_type.h b/include/villas/node_type.h index d1729f179..c311d2139 100644 --- a/include/villas/node_type.h +++ b/include/villas/node_type.h @@ -24,10 +24,6 @@ * @{ *********************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif - #pragma once #include @@ -245,8 +241,4 @@ const char * node_type_name(struct node_type *vt); struct node_type * node_type_lookup(const char *name); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/path.h b/include/villas/path.h index dfacf125d..5775c86d0 100644 --- a/include/villas/path.h +++ b/include/villas/path.h @@ -29,6 +29,8 @@ #pragma once +#include + #include #include @@ -39,13 +41,7 @@ #include #include -#ifdef __cplusplus - #include - - #include - -extern "C" { -#endif +#include /* Forward declarations */ struct stats; @@ -92,12 +88,10 @@ struct path { pthread_t tid; /**< The thread id for this path. */ json_t *cfg; /**< A JSON object containing the configuration of the path. */ -#ifdef __cplusplus villas::Logger logger; std::bitset mask; /**< A mask of path_sources which are enabled for poll(). */ std::bitset received; /**< A mask of path_sources for which we already received samples. */ -#endif }; /** Initialize internal data structures. */ @@ -172,7 +166,3 @@ bool path_is_reversed(const struct path *p); struct vlist * path_get_signals(struct path *p); /** @} */ - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/path_destination.h b/include/villas/path_destination.h index fede6ffb6..c65c56073 100644 --- a/include/villas/path_destination.h +++ b/include/villas/path_destination.h @@ -31,10 +31,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct path; struct sample; @@ -53,8 +49,4 @@ void path_destination_enqueue(struct path *p, struct sample *smps[], unsigned cn void path_destination_write(struct path_destination *pd, struct path *p); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/path_source.h b/include/villas/path_source.h index 4114dcda2..bc288249f 100644 --- a/include/villas/path_source.h +++ b/include/villas/path_source.h @@ -32,10 +32,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct path; struct sample; @@ -55,8 +51,4 @@ int path_source_destroy(struct path_source *ps); int path_source_read(struct path_source *ps, struct path *p, int i); -#ifdef __cplusplus -} -#endif - /** @} */ diff --git a/include/villas/plugin.h b/include/villas/plugin.h index b6dbd3264..ac2b6b962 100644 --- a/include/villas/plugin.h +++ b/include/villas/plugin.h @@ -28,10 +28,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /** (De-)Register a plugin by adding it to the global plugin list. * * We make use of GCC's / Clang's constructor/destructor function @@ -83,7 +79,3 @@ void plugin_dump(enum plugin_type type); /** Find registered and loaded plugin with given name and type. */ struct plugin * plugin_lookup(enum plugin_type type, const char *name); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/pool.h b/include/villas/pool.h index 6167ceacb..310ba8ebc 100644 --- a/include/villas/pool.h +++ b/include/villas/pool.h @@ -32,10 +32,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /** A thread-safe memory pool */ struct pool { enum state state; @@ -95,7 +91,3 @@ INLINE int pool_put(struct pool *p, void *buf) { return queue_push(&p->queue, buf); } - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/queue.h b/include/villas/queue.h index 7cfe5a5a6..edf8efa59 100644 --- a/include/villas/queue.h +++ b/include/villas/queue.h @@ -41,10 +41,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct memory_type; @@ -114,7 +110,3 @@ int queue_pull_many(struct queue *q, void *ptr[], size_t cnt); * @return -1 on failure. */ int queue_close(struct queue *q); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/queue_signalled.h b/include/villas/queue_signalled.h index bc2286005..744f46daf 100644 --- a/include/villas/queue_signalled.h +++ b/include/villas/queue_signalled.h @@ -27,10 +27,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - enum queue_signalled_flags { /* Mode */ QUEUE_SIGNALLED_AUTO = (0 << 0), /**< We will choose the best method available on the platform */ @@ -84,7 +80,3 @@ int queue_signalled_close(struct queue_signalled *qs); /** Returns a file descriptor which can be used with poll / select to wait for new data */ int queue_signalled_fd(struct queue_signalled *qs); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/sample.h b/include/villas/sample.h index 163d28f2f..52af980a2 100644 --- a/include/villas/sample.h +++ b/include/villas/sample.h @@ -31,10 +31,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct pool; @@ -138,7 +134,3 @@ enum signal_type sample_format(const struct sample *s, unsigned idx); void sample_data_insert(struct sample *smp, const union signal_data *src, size_t offset, size_t len); void sample_data_remove(struct sample *smp, size_t offset, size_t len); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/shmem.h b/include/villas/shmem.h index 4c696ddfd..7aa491f45 100644 --- a/include/villas/shmem.h +++ b/include/villas/shmem.h @@ -37,10 +37,6 @@ #define DEFAULT_SHMEM_QUEUELEN 512u #define DEFAULT_SHMEM_SAMPLELEN 64u -#ifdef __cplusplus -extern "C" { -#endif - /** Struct containing all parameters that need to be known when creating a new * shared memory object. */ struct shmem_conf { @@ -128,7 +124,3 @@ int shmem_int_alloc(struct shmem_int *shm, struct sample *smps[], unsigned cnt); size_t shmem_total_size(int queuelen, int samplelen); /** @} */ - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/signal.h b/include/villas/signal.h index 6fa7dbd5a..f763f81d1 100644 --- a/include/villas/signal.h +++ b/include/villas/signal.h @@ -33,10 +33,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct vlist; struct node; @@ -133,6 +129,3 @@ int signal_data_parse_json(union signal_data *data, const struct signal *sig, js void signal_data_set(union signal_data *data, const struct signal *sig, double val); -#ifdef __cplusplus -} -#endif diff --git a/include/villas/socket_addr.h b/include/villas/socket_addr.h index b089fb8e0..9e2bf3ef0 100644 --- a/include/villas/socket_addr.h +++ b/include/villas/socket_addr.h @@ -55,10 +55,6 @@ union sockaddr_union { #endif }; -#ifdef __cplusplus -extern "C" { -#endif - /** Generate printable socket address depending on the address family * * A IPv4 address is formatted as dotted decimals followed by the port/protocol number @@ -86,7 +82,3 @@ char * socket_print_addr(struct sockaddr *saddr); int socket_parse_address(const char *str, struct sockaddr *sa, enum socket_layer layer, int flags); int socket_compare_addr(struct sockaddr *x, struct sockaddr *y); - -#ifdef __cplusplus -} -#endif diff --git a/include/villas/stats.h b/include/villas/stats.h index 448a56349..0668f3243 100644 --- a/include/villas/stats.h +++ b/include/villas/stats.h @@ -30,10 +30,6 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - /* Forward declarations */ struct sample; struct node; @@ -122,6 +118,3 @@ void stats_print(struct stats *s, FILE *f, enum stats_format fmt, int verbose); union signal_data stats_get_value(const struct stats *s, enum stats_metric sm, enum stats_type st); -#ifdef __cplusplus -} -#endif