You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/10/25 23:12:32 UTC
git commit: TSPluginInit man page
Updated Branches:
refs/heads/master b8a8e390f -> d8cc12446
TSPluginInit man page
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d8cc1244
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d8cc1244
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d8cc1244
Branch: refs/heads/master
Commit: d8cc12446e0d7274ba5d0da9f07ba2f0966c6a45
Parents: b8a8e39
Author: James Peach <jp...@apache.org>
Authored: Thu Oct 25 14:00:59 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Oct 25 14:00:59 2012 -0700
----------------------------------------------------------------------
doc/Makefile.am | 1 +
doc/sdk/TSDebug.3 | 4 +-
doc/sdk/TSMalloc.3 | 2 +-
doc/sdk/TSPluginInit.3 | 99 ++++++++++++++++++++++++++++++
doc/sdk/TSTrafficServerVersionGet.3 | 2 +-
5 files changed, 104 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8cc1244/doc/Makefile.am
----------------------------------------------------------------------
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3767152..4092bf8 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -83,6 +83,7 @@ man3_MANS = \
sdk/TSAPI.3 \
sdk/TSDebug.3 \
sdk/TSMalloc.3 \
+ sdk/TSPluginInit.3 \
sdk/TSTrafficServerVersionGet.3
EXTRA_DIST = \
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8cc1244/doc/sdk/TSDebug.3
----------------------------------------------------------------------
diff --git a/doc/sdk/TSDebug.3 b/doc/sdk/TSDebug.3
index ba6d1d8..b1b2d33 100644
--- a/doc/sdk/TSDebug.3
+++ b/doc/sdk/TSDebug.3
@@ -27,7 +27,7 @@
.Nm TSHttpSsnDebugGet,
.Nm TSAssert,
.Nm TSReleaseAssert
-.Nd TrafficServer debugging APIs
+.Nd Traffic Server debugging APIs
.Sh LIBRARY
Apache Traffic Server plugin API
.Sh SYNOPSIS
@@ -141,5 +141,5 @@ TSDebugSpecifc(TSHttpTxnDebugGet(txn), "tag" ,
.fi
.Sh SEE ALSO
-.Xr tsapi 3ts
+.Xr TSAPI 3ts
.\" vim: set ts=4 sw=4 et :
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8cc1244/doc/sdk/TSMalloc.3
----------------------------------------------------------------------
diff --git a/doc/sdk/TSMalloc.3 b/doc/sdk/TSMalloc.3
index 14ec42f..53d5295 100644
--- a/doc/sdk/TSMalloc.3
+++ b/doc/sdk/TSMalloc.3
@@ -149,5 +149,5 @@ is NULL,
does no operation.
.Sh SEE ALSO
-.Xr tsapi 3ts
+.Xr TSAPI 3ts
.\" vim: set ts=4 sw=4 et :
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8cc1244/doc/sdk/TSPluginInit.3
----------------------------------------------------------------------
diff --git a/doc/sdk/TSPluginInit.3 b/doc/sdk/TSPluginInit.3
new file mode 100644
index 0000000..547024d
--- /dev/null
+++ b/doc/sdk/TSPluginInit.3
@@ -0,0 +1,99 @@
+.\" Licensed to the Apache Software Foundation (ASF) under one .\"
+.\" or more contributor license agreements. See the NOTICE file .\"
+.\" distributed with this work for additional information .\"
+.\" regarding copyright ownership. The ASF licenses this file .\"
+.\" to you under the Apache License, Version 2.0 (the .\"
+.\" "License"); you may not use this file except in compliance .\"
+.\" with the License. You may obtain a copy of the License at .\"
+.\" .\"
+.\" http://www.apache.org/licenses/LICENSE-2.0 .\"
+.\" .\"
+.\" Unless required by applicable law or agreed to in writing, software .\"
+.\" distributed under the License is distributed on an "AS IS" BASIS, .\"
+.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\"
+.\" See the License for the specific language governing permissions and .\"
+.Dd October 25, 2012
+.Dt TSPluginInit 3ts TSAPI
+.Sh NAME
+.Nm TSPluginInit,
+.Nm TSPluginRegister,
+.Nm TSPluginDirGet,
+.Nd Traffic Server plugin loading and registration
+.Sh LIBRARY
+Apache Traffic Server plugin API
+.Sh SYNOPSIS
+.In ts/ts.h
+.Ft void
+.Fo TSPluginInit
+.Fa "int argc"
+.Fa "const char* argv[]"
+.Fc
+.Ft TSReturnCode
+.Fo TSPluginRegister
+.Fa "TSSDKVersion sdk_version"
+.Fa "TSPluginRegistrationInfo* plugin_info"
+.Fc
+.Ft "const char *"
+.Fo TSPluginDirGet
+.Fa void
+.Fc
+.Sh DESCRIPTION
+
+.Fn TSPluginInit
+must be defined by all plugins. Traffic Server calls this initialization routine
+when it loads the plugin and sets
+.Fa argc
+and
+.Fa argv
+appropriately based on the values in plugin.config.
+.Fa argc
+is a count of the number of arguments in the argument vector,
+.Fa argv .
+The count is at least one because the first argument in the argument vector is the plugin’s name, which must exist in order for the plugin to be loaded.
+.Fa argv
+is the vector of arguments. The number of arguments in the vector is
+.Fa argc ,
+and
+.Fa argv[0]
+always contains the name of the plugin shared library.
+
+.Fn TSPluginRegister
+registers the appropriate SDK version for your plugin. Use this function to
+make sure that the version of Traffic Server on which your plugin is running
+supports the plugin.
+
+.Fn TSPluginDirGet
+gets the plugin directory relative to the Traffic Server install
+directory. This path (relative to the Traffic Server install
+directory) is stored in the records.config variable
+proxy.config.plugin.plugin_dir.
+
+.Sh RETURN VALUES
+.Fn TSPluginRegister
+returns
+.Fa TS_ERROR
+if the plugin registration failed.
+
+.Fn TSPluginDirGet
+returns a constant NUL-terminated string.
+
+.Sh EXAMPLES
+.nf
+#include <ts/ts.h>
+
+void
+TSPluginInit (int argc, const char *argv[])
+{
+ TSPluginRegistrationInfo info;
+
+ info.plugin_name = "hello-world";
+ info.vendor_name = "MyCompany";
+ info.support_email = "ts-api-support@MyCompany.com";
+
+ if (!TSPluginRegister (TS_SDK_VERSION_2_0 , &info)) {
+ TSError ("Plugin registration failed. \n");
+ }
+}
+.fi
+.Sh SEE ALSO
+.Xr TSAPI 3ts
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8cc1244/doc/sdk/TSTrafficServerVersionGet.3
----------------------------------------------------------------------
diff --git a/doc/sdk/TSTrafficServerVersionGet.3 b/doc/sdk/TSTrafficServerVersionGet.3
index ff443b5..5713321 100644
--- a/doc/sdk/TSTrafficServerVersionGet.3
+++ b/doc/sdk/TSTrafficServerVersionGet.3
@@ -106,5 +106,5 @@ TSPluginInit (int argc, const char *argv[])
}
.fi
.Sh SEE ALSO
-.Xr tsapi 3ts
+.Xr TSAPI 3ts
.\" vim: set ts=4 sw=4 et :