Ansi Win32 API implementation only moudles in Tango
yidabu
yidabu.nospam at gmail.com
Thu Apr 10 03:41:42 PDT 2008
On Thu, 10 Apr 2008 01:23:35 -0800
"Kris" <foo at bar.com> wrote:
>
> "yidabu" wrote in message
>
> > Some Tango modules only have Ansi Win32 API implementation
>
> If this is true, then please write a ticket for it noting the module(s) in
> question
I've written a funciton to find the modules:
import dwin.text.pcre.RegExp;
import tango.text.Util;
import tango.io.File;
import tango.util.log.Trace;
FileScan findAnsiWinAPI(char[] path)
{
auto regex = RegExp(r"\b([A-Z][a-z][a-zA-Z]+?)A\b\s*\(");
auto scan = new FileScan;
scan
(
path,
(FilePath fp, bool isDir)
{
if(isDir) return true;
if(fp.suffix != ".d") return false;
auto content = cast(char[]) (new File(fp)).read;
if(auto m = regex.execute(content))
{
if(!content.containsPattern(m[1] ~ "W"))
{
Trace.formatln("{} contains {}, but not contains {}", fp.toString, m[1] ~ "A", m[1] ~ "W");
return true;
}
}
return false;
}
);
return scan;
}
void main()
{
char[] path = r"path\to\tango\tango\";
auto fs = findAnsiWinAPI(path);
}
the result is :
tango/tango/io/FileRoots.d contains GetLogicalDriveStringsA, but not contains GetLogicalDriveStringsW
tango/tango/io/Console.d contains CreateFileA, but not contains CreateFileW
tango/tango/io/MappedBuffer.d contains CreateFileMappingA, but not contains CreateFileMappingW
tango/tango/core/sync/Semaphore.d contains CreateSemaphoreA, but not contains CreateSemaphoreW
tango/tango/core/sync/Condition.d contains CreateSemaphoreA, but not contains CreateSemaphoreW
tango/tango/sys/Process.d contains CreateProcessA, but not contains CreateProcessW
tango/tango/sys/SharedLib.d contains LoadLibraryA, but not contains LoadLibraryW
--
yidabu <yidabu.nospam at gmail.com>
DWin http://www.dsource.org/projects/dwin
D语言 中文支持(D Chinese Support)
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/
More information about the Digitalmars-d
mailing list