Ansi Win32 API implementation only moudles in Tango
Bill Baxter
dnewsgroup at billbaxter.com
Thu Apr 10 16:44:55 PDT 2008
yidabu wrote:
> 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 :
You, sir (or ma'am), are hard core. And I applaud that.
> tango/tango/io/FileRoots.d contains GetLogicalDriveStringsA, but not contains GetLogicalDriveStringsW
I don't think it's posssible for a logical drive to have non-ascii
characters is it? So that should be ok.
> tango/tango/io/Console.d contains CreateFileA, but not contains CreateFileW
It only creates a few specially named files, which are always ascii
names. ("CONIN$\0", "CONOUT$\0", "CONOUT$\0")
> tango/tango/io/MappedBuffer.d contains CreateFileMappingA, but not contains CreateFileMappingW
Passes null in for all string parameters, so shouldn't matter that it's
just using the A version.
> tango/tango/core/sync/Semaphore.d contains CreateSemaphoreA, but not contains CreateSemaphoreW
> tango/tango/core/sync/Condition.d contains CreateSemaphoreA, but not
contains CreateSemaphoreW
Ditto for these. They use null for the string params.
> tango/tango/sys/Process.d contains CreateProcessA, but not contains CreateProcessW
*THIS* looks like it could be a genuine problem. So someone more
familiar with the code should take a closer look.
> tango/tango/sys/SharedLib.d contains LoadLibraryA, but not contains LoadLibraryW
This looks potentially problematic too.
--bb
More information about the Digitalmars-d
mailing list