public int FindSource(string file_name)
{
if (reader == null)
throw new InvalidOperationException ();
lock (this) {
if (source_name_hash == null) {
source_name_hash = new Dictionary<string, int> ();
for (int i = 0; i < ot.SourceCount; i++) {
SourceFileEntry source = GetSourceFile (i + 1);
source_name_hash.Add (source.FileName, i);
}
}
int value;
if (!source_name_hash.TryGetValue (file_name, out value))
return -1;
return value;
}
}