summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/onigmo/win32/makedef.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/lib/onigmo/win32/makedef.py
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/onigmo/win32/makedef.py')
-rwxr-xr-xsrc/fluent-bit/lib/onigmo/win32/makedef.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/onigmo/win32/makedef.py b/src/fluent-bit/lib/onigmo/win32/makedef.py
new file mode 100755
index 000000000..38e8db494
--- /dev/null
+++ b/src/fluent-bit/lib/onigmo/win32/makedef.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+import re
+
+header_files = (
+ "onigmo.h", "regenc.h",
+ "onigmognu.h", "onigmoposix.h"
+)
+
+exclude_symbols = [
+ "OnigEncodingKOI8",
+
+ # USE_UPPER_CASE_TABLE
+ "OnigEncAsciiToUpperCaseTable",
+ "OnigEncISO_8859_1_ToUpperCaseTable",
+]
+
+features = {
+ "USE_VARIABLE_META_CHARS": ("onig_set_meta_char",),
+ "USE_CAPTURE_HISTORY": ("onig_get_capture_tree",)
+}
+
+for v in features.values():
+ exclude_symbols += list(v)
+
+# Check if the features are enabled
+with open("regint.h", "r") as f:
+ e = set()
+ for line in f:
+ for k, v in features.items():
+ if re.match(r"^#define\s+" + k + r"\b", line):
+ e |= set(v)
+ exclude_symbols = list(set(exclude_symbols) - e)
+
+symbols = set()
+
+rx1 = re.compile("(ONIG_EXTERN.*)$")
+rx2 = re.compile(r"(\w+)( +PV?_\(\(.*\)\)|\[.*\])?;\s*(/\*.*\*/)?$")
+for filename in header_files:
+ with open(filename, "r") as f:
+ for line in f:
+ m = rx1.match(line)
+ if not m:
+ continue
+ s = m.group(1)
+ if s[-1] != ';':
+ s += ' ' + next(f)
+ m2 = rx2.search(s)
+ if m2 and (not m2.group(1) in exclude_symbols):
+ symbols.add(m2.group(1))
+
+print('EXPORTS')
+for s in sorted(symbols):
+ print('\t' + s)