atscppapi  1.0.9
C++ wrapper for Apache Traffic Server API
 All Classes Files Functions Enumerations Enumerator Macros
PluginInit.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 LinkedIn Corp. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
4  * except in compliance with the License. You may obtain a copy of the license at
5  * http://www.apache.org/licenses/LICENSE-2.0
6  *
7  * Unless required by applicable law or agreed to in writing, software distributed under the
8  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
9  * either express or implied.
10  *
11  */
12 
13 /**
14  * @file PluginInit.h
15  * @author Brian Geffon
16  * @author Manjesh Nilange
17  * @brief Provides hooks that plugins have to implement. ATS will invoke these when loading the plugin .so files.
18  */
19 
20 #pragma once
21 #ifndef ATSCPPAPI_PLUGININIT_H_
22 #define ATSCPPAPI_PLUGININIT_H_
23 
24 extern "C" {
25 
26 /**
27  * Invoked for "general" plugins - listed in plugin.config. The arguments in the
28  * plugin.config line are provided in this invocation.
29  *
30  * @param argc Count of arguments
31  * @param argv Array of pointers pointing to arguments
32  */
33 void TSPluginInit(int argc, const char *argv[]);
34 
35 enum TsReturnCode { TS_ERROR = -1, TS_SUCCESS = 0 };
36 
37 /**
38  * Invoked for remap plugins - listed in remap.config. The arguments provided as @pparam
39  * in the remap.config line are provided in this invocation.
40  *
41  * @param argc Count of arguments
42  * @param argv Array of pointers pointing to arguments
43  * @param instance_handle Should be passed to the RemapPlugin constructor
44  * @param errbuf Not used
45  * @param errbuf_size Not used
46  */
47 TsReturnCode TSRemapNewInstance(int argc, char *argv[], void **instance_handle, char *errbuf, int errbuf_size);
48 
49 }
50 
51 
52 #endif /* ATSCPPAPI_PLUGININIT_H_ */