GWAN webserver allowing dynamic pages in D

Dejan Lekic dejan.lekic at gmail.com
Tue Jun 26 09:49:10 PDT 2012


xbuf_ncat is a C function, you can't give it a D string just like 
that - you must use std.string.toStringz() ...

On Monday, 25 June 2012 at 13:42:39 UTC, Andrea Fontana wrote:
> Using C plain api it's not a good way to use D power IMHO :)
>
> xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World 
> (C)".sizeof - 1);
>
> Probably this example doesn't work properly.
> On my machine writeln("1234".sizeof);  gives "16" because of 
> UTF-8.
> So "1234".sizeof - 1 is 15.
>
> AFAIK D strings are not null-terminated (are they?) and i guess 
> that line of code won't work.
>
> Encapsulate code with classes/template/etc would be a good idea.
>
> On Monday, 25 June 2012 at 13:29:59 UTC, Eric R. Schulz (ers35) 
> wrote:
>> G-WAN exports a C API and D supports calling C functions.
>>
>> In what way could G-WAN better support D?
>>
>> Perhaps reading the G-WAN manual would help to explain: 
>> http://gwan.ch/archives/gwan_linux.pdf
>>
>>> Maybe they should give a better support for D language...




More information about the Digitalmars-d mailing list