This removes 30 build warnings and is generally a cleaner way of doing this.
LIBS = -lc
-BASESOURCES = gv.cpp gv.i gv_builtins.c
+BASESOURCES = gv.cpp gv.i gv_builtins.c gv_channel.h
BASELIBS = $(top_builddir)/lib/gvc/libgvc.la \
$(top_builddir)/lib/cgraph/libcgraph.la \
$(top_builddir)/lib/cdt/libcdt.la
#include <cstring>
#include <gvc/gvc.h>
#include <string>
-
-extern "C" {
-extern void gv_string_writer_init(GVC_t *gvc);
-extern void gv_channel_writer_init(GVC_t *gvc);
-extern void gv_writer_reset(GVC_t *gvc);
-}
+#include "gv_channel.h"
#define agfindattr(x, s) agattrsym(x, s)
#define agraphattr(g, n, s) agattr(g, AGRAPH, n, s)
--- /dev/null
+/// \file
+/// \brief language-specific bindings API
+///
+/// Each Graphviz language binding is expected to implement the following
+/// functions as relevant for their implementation.
+
+#pragma once
+
+#include <gvc/gvc.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gv_string_writer_init(GVC_t *gvc);
+void gv_channel_writer_init(GVC_t *gvc);
+void gv_writer_reset(GVC_t *gvc);
+
+#ifdef __cplusplus
+}
+#endif
#include <gvc/gvc.h>
+#include "gv_channel.h"
void gv_string_writer_init (GVC_t *gvc) { (void)gvc; }
void gv_channel_writer_init (GVC_t *gvc) { (void)gvc; }
#include <gvc/gvplugin.h>
#include <gvc/gvcjob.h>
#include <gvc/gvcint.h>
+#include "gv_channel.h"
typedef struct {
char* data;
#include <gvc/gvplugin.h>
#include <gvc/gvcjob.h>
#include <gvc/gvcint.h>
+#include "gv_channel.h"
static size_t gv_string_writer (GVJ_t *job, const char *s, size_t len)
{
#include <gvc/gvcjob.h>
#include <gvc/gvcint.h>
#include <limits.h>
+#include "gv_channel.h"
static size_t gv_string_writer(GVJ_t *job, const char *s, size_t len)
{