-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flb_lib: allow public-API use without dependencies via fluent-bit-min…
…imal.h Currently, fluent-bit.h and flb_lib.h are un-usable by third-parties becuase the fluent-bit build process does not install all of the required header files for fluent-bit's dependencies into the Debian packages. Skipping that problem for the moment, I'm proposing that users of the public API don't actually need or want all the headers required for the interenals of fluent-bit, and there should just be a simple header that declares the public API. This new header sets a preprocessor variable and then includes the normal flb_lib.h, which defines the public API. flb_lib.h sees the preprocessor variable and skips loading any of the dependency headers, instead just declaring the referenced types without defining them. This is an improvement over [an earlier version I proposed][1] where fluent-bit-minimal.h re-defined all the exported symbols of the public API. This new mechanism avoids code duplication and the need to maintain two headers in tandem. [1]: #7165 Signed-off-by: Michael Conrad <[email protected]>
- Loading branch information
Showing
5 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | ||
|
||
/* Fluent Bit | ||
* ========== | ||
* Copyright (C) 2015-2022 The Fluent Bit Authors | ||
* | ||
* 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 FLUENT_BIT_MINIMAL_H | ||
#define FLUENT_BIT_MINIMAL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <fluent-bit/flb_lib.h> | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters