[master] 4507c59 Also split out the VSC part of the (v)abi

Poul-Henning Kamp phk at varnish-cache.org
Sun Oct 9 18:20:20 CEST 2011


commit 4507c59580f9e5089d9d4e863ca2740daf975fc0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 9 16:20:05 2011 +0000

    Also split out the VSC part of the (v)abi

diff --git a/include/Makefile.am b/include/Makefile.am
index 93f61e0..47fede9 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -16,6 +16,7 @@ pkginclude_HEADERS = \
 	tbl/vsc_fields.h \
 	tbl/vsl_tags.h \
 	vapi/vsm.h \
+	vapi/vsc.h \
 	varnishapi.h \
 	vcli.h \
 	vsc.h \
diff --git a/include/vapi/vsc.h b/include/vapi/vsc.h
new file mode 100644
index 0000000..290db9d
--- /dev/null
+++ b/include/vapi/vsc.h
@@ -0,0 +1,85 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2011 Varnish Software AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#ifndef VAPI_VSC_H_INCLUDED
+#define VAPI_VSC_H_INCLUDED
+
+/*---------------------------------------------------------------------
+ * VSC level access functions
+ */
+
+void VSC_Setup(struct VSM_data *vd);
+	/*
+	 * Setup vd for use with VSC functions.
+	 */
+
+#define VSC_ARGS	"f:n:"
+#define VSC_n_USAGE	VSM_n_USAGE
+#define VSC_USAGE	VSC_N_USAGE
+
+int VSC_Arg(struct VSM_data *vd, int arg, const char *opt);
+	/*
+	 * Handle standard stat-presenter arguments
+	 * Return:
+	 *	-1 error
+	 *	 0 not handled
+	 *	 1 Handled.
+	 */
+
+int VSC_Open(struct VSM_data *vd, int diag);
+	/*
+	 * Open shared memory for VSC processing.
+	 * args and returns as VSM_Open()
+	 */
+
+struct VSC_C_main *VSC_Main(struct VSM_data *vd);
+	/*
+	 * return Main stats structure
+	 */
+
+struct VSC_point {
+	const char *class;		/* stat struct type		*/
+	const char *ident;		/* stat struct ident		*/
+	const char *name;		/* field name			*/
+	const char *fmt;		/* field format ("uint64_t")	*/
+	int flag;			/* 'a' = counter, 'i' = gauge	*/
+	const char *desc;		/* description			*/
+	const volatile void *ptr;	/* field value			*/
+};
+
+typedef int VSC_iter_f(void *priv, const struct VSC_point *const pt);
+
+int VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv);
+	/*
+	 * Iterate over all statistics counters, calling "func" for
+	 * each counter not suppressed by any "-f" arguments.
+	 */
+
+#endif /* VAPI_VSC_H_INCLUDED */
diff --git a/include/varnishapi.h b/include/varnishapi.h
index 235308a..6960720 100644
--- a/include/varnishapi.h
+++ b/include/varnishapi.h
@@ -32,6 +32,7 @@
 #define VARNISHAPI_H_INCLUDED
 
 #include <vapi/vsm.h>
+#include <vapi/vsc.h>
 
 #include <stdint.h>
 
@@ -43,58 +44,6 @@
  *	API use failures will trip assert.
  */
 
-
-/*---------------------------------------------------------------------
- * VSC level access functions
- */
-
-void VSC_Setup(struct VSM_data *vd);
-	/*
-	 * Setup vd for use with VSC functions.
-	 */
-
-#define VSC_ARGS	"f:n:"
-#define VSC_n_USAGE	VSM_n_USAGE
-#define VSC_USAGE	VSC_N_USAGE
-
-int VSC_Arg(struct VSM_data *vd, int arg, const char *opt);
-	/*
-	 * Handle standard stat-presenter arguments
-	 * Return:
-	 *	-1 error
-	 *	 0 not handled
-	 *	 1 Handled.
-	 */
-
-int VSC_Open(struct VSM_data *vd, int diag);
-	/*
-	 * Open shared memory for VSC processing.
-	 * args and returns as VSM_Open()
-	 */
-
-struct VSC_C_main *VSC_Main(struct VSM_data *vd);
-	/*
-	 * return Main stats structure
-	 */
-
-struct VSC_point {
-	const char *class;		/* stat struct type		*/
-	const char *ident;		/* stat struct ident		*/
-	const char *name;		/* field name			*/
-	const char *fmt;		/* field format ("uint64_t")	*/
-	int flag;			/* 'a' = counter, 'i' = gauge	*/
-	const char *desc;		/* description			*/
-	const volatile void *ptr;	/* field value			*/
-};
-
-typedef int VSC_iter_f(void *priv, const struct VSC_point *const pt);
-
-int VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv);
-	/*
-	 * Iterate over all statistics counters, calling "func" for
-	 * each counter not suppressed by any "-f" arguments.
-	 */
-
 /*---------------------------------------------------------------------
  * VSL level access functions
  */



More information about the varnish-commit mailing list