Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1035 (closed defect: fixed)

Opened 17 years ago

Last modified 17 years ago

Ansi Win32 API implementation only moudles in Tango

Reported by: yidabu Assigned to: kris
Priority: major Milestone: 0.99.6
Component: Core Functionality Version: 0.99.5 Jascha
Keywords: Win32 Cc:

Description

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

Change History

04/10/08 23:16:24 changed by kris

could you explain what is wrong with the usage of these functions, please?

04/11/08 22:27:21 changed by yidabu

By Bill Baxter : http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=69626

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.

04/11/08 22:59:19 changed by kris

yep, the last one is already fixed while the prior one has a separate ticket assigned to it. The other five were those I was interested in hearing about ;)

04/18/08 04:40:48 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.