2 using System
.Text
.RegularExpressions
;
8 static void Main(string[] args
)
10 var sw
= new StreamReader(args
[0] + "\\lsmash.h");
11 var so
= new StreamWriter(args
[0] + "\\lsmash.def");
14 so
.WriteLine("EXPORTS");
16 while (!sw
.EndOfStream
)
18 var funcregex
= new Regex("^\\($");
19 var typeregex
= new Regex("^DEFINE_(ISOM|QTFF)_CODEC_TYPE\\(");
21 string line
= sw
.ReadLine();
23 if (funcregex
.IsMatch(line
) && prevline
!= "")
25 /* Export all public API functions. */
26 var sub
= new Regex(".+\\s+\\*{0,1}(.+)");
27 string newline
= sub
.Replace(prevline
, "$1");
30 so
.WriteLine(newline
);
32 else if (typeregex
.IsMatch(line
))
34 /* Export all codec types. */
35 var sub
= new Regex("^.+\\s+((ISOM|QT|LSMASH)_CODEC_TYPE_.+?),\\s+.+");
36 string newline
= sub
.Replace(line
, "$1");
39 so
.WriteLine(newline
);
47 /* Non-public symbols for the cli apps. */
48 so
.Write("lsmash_importer_open\n" +
49 "lsmash_importer_get_access_unit\n" +
50 "lsmash_importer_close\n" +
51 "lsmash_importer_get_track_count\n" +
52 "lsmash_importer_get_last_delta\n" +
53 "lsmash_importer_construct_timeline\n" +
54 "lsmash_duplicate_summary\n" +
55 "lsmash_string_from_wchar\n" +
56 "lsmash_win32_fopen");