| "usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]" |
| output_file = sys.argv[1] |
| header_paths = sys.argv[2:] |
| with open (h, encoding='utf-8') as f: headers_content.append (f.read ()) |
| symbols = sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M)) |
| if '--experimental-api' not in sys.argv: |
| # Move these to harfbuzz-sections.txt when got stable |
| hb_draw_close_path_func_t |
| hb_draw_quadratic_to_func_t |
| hb_draw_funcs_is_immutable |
| hb_draw_funcs_make_immutable |
| hb_draw_funcs_set_close_path_func |
| hb_draw_funcs_set_cubic_to_func |
| hb_draw_funcs_set_line_to_func |
| hb_draw_funcs_set_move_to_func |
| hb_draw_funcs_set_quadratic_to_func |
| hb_font_get_var_coords_design""".splitlines () |
| symbols = [x for x in symbols if x not in experimental_symbols] |
| symbols = "\n".join (symbols) |
| result = symbols if os.getenv ('PLAIN_LIST', '') else """EXPORTS |
| LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('src/', '').replace ('.def', '')) |
| with open (output_file, "w") as f: f.write (result) |