/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Fluent Bit * ========== * Copyright (C) 2015 Treasure Data Inc. * * Licensed 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. */ #ifndef FLB_PLUGINS_H #define FLB_PLUGINS_H #include #include #include #include #include #include #include @FLB_IN_PLUGINS_DECL@ @FLB_OUT_PLUGINS_DECL@ @FLB_FILTER_PLUGINS_DECL@ int flb_plugins_register(struct flb_config *config) { struct flb_custom_plugin *custom; struct flb_input_plugin *in; struct flb_output_plugin *out; struct flb_filter_plugin *filter; @FLB_CUSTOM_PLUGINS_ADD@ @FLB_IN_PLUGINS_ADD@ @FLB_OUT_PLUGINS_ADD@ @FLB_FILTER_PLUGINS_ADD@ return 0; } void flb_plugins_unregister(struct flb_config *config) { struct mk_list *tmp; struct mk_list *head; struct flb_custom_plugin *custom; struct flb_input_plugin *in; struct flb_output_plugin *out; struct flb_filter_plugin *filter; mk_list_foreach_safe(head, tmp, &config->custom_plugins) { custom = mk_list_entry(head, struct flb_custom_plugin, _head); mk_list_del(&custom->_head); flb_free(custom); } mk_list_foreach_safe(head, tmp, &config->in_plugins) { in = mk_list_entry(head, struct flb_input_plugin, _head); mk_list_del(&in->_head); flb_free(in); } mk_list_foreach_safe(head, tmp, &config->out_plugins) { out = mk_list_entry(head, struct flb_output_plugin, _head); mk_list_del(&out->_head); flb_free(out); } mk_list_foreach_safe(head, tmp, &config->filter_plugins) { filter = mk_list_entry(head, struct flb_filter_plugin, _head); mk_list_del(&filter->_head); flb_free(filter); } } #endif