.\" Man page generated from reStructuredText. . .TH "TSPLUGININIT" "3ts" "Mar 08, 2019" "7.1" "Apache Traffic Server" .SH NAME TSPluginInit \- traffic Server plugin loading and registration . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fI#include \fP .INDENT 0.0 .TP .B void TSPluginInit(int\fI\ argc\fP, const char*\fI\ argv[]\fP) .UNINDENT .INDENT 0.0 .TP .B TSReturnCode TSPluginRegister(TSPluginRegistrationInfo*\fI\ plugin_info\fP) .UNINDENT .SH DESCRIPTION .sp \fI\%TSPluginInit()\fP must be defined by all plugins. Traffic Server calls this initialization routine when it loads the plugin and sets \fIargc\fP and \fIargv\fP appropriately based on the values in \fBplugin.config\fP\&. .sp \fIargc\fP is a count of the number of arguments in the argument vector, \fIargv\fP\&. 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. .sp \fI\%TSPluginRegister()\fP registers the appropriate SDK version specific in \fIsdk_version\fP for your plugin. Use this function to make sure that the version of Traffic Server on which your plugin is running supports the plugin. .SH RETURN VALUES .sp \fI\%TSPluginRegister()\fP returns \fBTS_ERROR\fP if the plugin registration failed. .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #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(&info) != TS_SUCCESS) { TSError("Plugin registration failed. 0); } } .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBTSAPI(3ts)\fP, \fBTSInstallDirGet(3ts)\fP .SH COPYRIGHT 2019, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .