Return-Path: X-Original-To: apmail-trafficserver-commits-archive@www.apache.org Delivered-To: apmail-trafficserver-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B249310D9A for ; Thu, 1 Aug 2013 18:58:20 +0000 (UTC) Received: (qmail 33246 invoked by uid 500); 1 Aug 2013 18:58:19 -0000 Delivered-To: apmail-trafficserver-commits-archive@trafficserver.apache.org Received: (qmail 33198 invoked by uid 500); 1 Aug 2013 18:58:19 -0000 Mailing-List: contact commits-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list commits@trafficserver.apache.org Received: (qmail 32574 invoked by uid 99); 1 Aug 2013 18:58:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 18:58:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4F7D68B62BE; Thu, 1 Aug 2013 18:58:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jpeach@apache.org To: commits@trafficserver.apache.org Date: Thu, 01 Aug 2013 18:58:19 -0000 Message-Id: <7a64ecb7837a494f8fa5456249f84e88@git.apache.org> In-Reply-To: <90dade17ed4a48589fcb3b76971436c5@git.apache.org> References: <90dade17ed4a48589fcb3b76971436c5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/11] git commit: doc: convert TSPluginInit(3) to sphinx doc: convert TSPluginInit(3) to sphinx Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/80b644e7 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/80b644e7 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/80b644e7 Branch: refs/heads/master Commit: 80b644e7267cd543aad3a60230968cb7ed5c194d Parents: c976718 Author: James Peach Authored: Thu Aug 1 10:51:12 2013 -0700 Committer: James Peach Committed: Thu Aug 1 10:51:12 2013 -0700 ---------------------------------------------------------------------- doc/conf.py | 1 + doc/reference/api/TSPluginInit.en.rst | 75 ++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/80b644e7/doc/conf.py ---------------------------------------------------------------------- diff --git a/doc/conf.py b/doc/conf.py index 75bf8b1..9d8edfd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -221,6 +221,7 @@ man_pages = [ ('reference/api/TSInstallDirGet.en', 'TSInstallDirGet', u'Return Traffic Server installation directories', None, u'3ts'), ('reference/api/TSMBufferCreate.en', 'TSMBufferCreate', u'Traffic Server marshall buffer API', None, u'3ts'), ('reference/api/TSmalloc.en', 'TSmalloc', u'Traffic Server memory allocation API', None, u'3ts'), + ('reference/api/TSPluginInit.en', 'TSPluginInit', u'Traffic Server plugin loading and registration', None, u'3ts'), ('reference/commands/traffic_cop.en', 'traffic_cop', u'Traffic Server watchdog', None, '8'), ('reference/commands/traffic_line.en', 'traffic_line', u'Traffic Server command line', None, '8'), http://git-wip-us.apache.org/repos/asf/trafficserver/blob/80b644e7/doc/reference/api/TSPluginInit.en.rst ---------------------------------------------------------------------- diff --git a/doc/reference/api/TSPluginInit.en.rst b/doc/reference/api/TSPluginInit.en.rst new file mode 100644 index 0000000..ad75d9b --- /dev/null +++ b/doc/reference/api/TSPluginInit.en.rst @@ -0,0 +1,75 @@ +.. 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 + limitations under the License. + +.. default-domain:: c + +============ +TSPluginInit +============ + +Synopsis +======== + +`#include ` + +.. function:: void TSPluginInit(int argc, const char* argv[]) +.. function:: TSReturnCode TSPluginRegister(TSSDKVersion sdk_version, TSPluginRegistrationInfo* plugin_info) + +Description +=========== + +:func:`TSPluginInit` must be defined by all plugins. Traffic Server +calls this initialization routine when it loads the plugin and sets +argc and argv appropriately based on the values in plugin.config. +argc is a count of the number of arguments in the argument vector, +argv. The count is at least one because the first argument in the +argument vector is the plugins name, which must exist in order for +the plugin to be loaded. argv is the vector of arguments. The number +of arguments in the vector is argc, and argv[0] always contains the +name of the plugin shared library. :func:`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. + +Return values +============= + +:func:`TSPluginRegister` returns :data:`TS_ERROR` if the plugin registration failed. + +Examples +======== + +:: + + #include + + 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_3_0 , &info) != TS_SUCCESS) { + TSError("Plugin registration failed. 0); + } + } + +See also +======== + +:manpage:`TSAPI(3ts)`, :manpage:`TSInstallDirGet(3ts)`