Higher abstraction level for calling C functions

Denis Shelomovskij verylonglogin.reg at gmail.com
Mon Jan 30 02:47:23 PST 2012


30.01.2012 4:42, Timon Gehr пишет:
> I suppose the unary + before the second 'num' is required to
> disambiguate from which array length 'num' will be deduced? Shouldn't
> this restriction be lifted? (Obviously, if the lengths have to match,
> both are fine.)

Yes, this restriction isn't necessary. I just was too lazy to add new 
asserts in such cases. Fill be fixed.
>
> In this example:
>
> // from WinBase.h
> __(out) DWORD GetCurrentDirectoryW(
> __(in) DWORD nBufferLength,
> __(out""[nBufferLength]->""[return]) LPWSTR lpBuffer
> )
> __( repeat: return > nBufferLength )
> __( success: return );
> // NOTE: current directory can't have zero length
>
> Maybe the generated bindings should rather look like
>
> char[] winapi_GetCurrentDirectoryW();
>

Maybe. Looks like "if return value is a length, corresponding array 
should be returned instead" rule is good. If I will not find anything 
major against this rule will be added.


More information about the Digitalmars-d mailing list