3 "usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]"
10 output_file
= sys
.argv
[1]
11 header_paths
= sys
.argv
[2:]
14 for h
in header_paths
:
16 with
open (h
, encoding
='utf-8') as f
: headers_content
.append (f
.read ())
18 symbols
= sorted (re
.findall (r
"^hb_\w+(?= \()", "\n".join (headers_content
), re
.M
))
19 if '--experimental-api' not in sys
.argv
:
20 # Move these to harfbuzz-sections.txt when got stable
21 experimental_symbols
= \
23 hb_subset_repack_or_fail
24 hb_subset_input_override_name_table
25 hb_subset_input_set_axis_range
27 symbols
= [x
for x
in symbols
if x
not in experimental_symbols
]
28 symbols
= "\n".join (symbols
)
30 result
= symbols
if os
.getenv ('PLAIN_LIST', '') else """EXPORTS
32 LIBRARY lib%s-0.dll""" % (symbols
, output_file
.replace ('src/', '').replace ('.def', ''))
34 with
open (output_file
, "w") as f
: f
.write (result
)