On Wednesday, 30 November 2016 at 12:41:24 UTC, Stefan Koch wrote:
On Wednesday, 30 November 2016 at 10:20:35 UTC, Anders S wrote:
        int     [1] argv;               /* list of arguments */
Is that supposed to be a VLAIS ?
That will not port to D.

It would be helpful If you could share the code and state the intent.

Hi,
No to VLAIS (Variable length array in structure). All known size of arrays and structures. My intent is to find a way to write a request for data (the IOREQ.fc) to an application. The IOREQ is my message struct and the c-code on the other end of the pipe use same struct to identify request. to keep it backward compatible I need to keep IOREQ. The c-code application will switch out request and return the answer with char[] of data using the (IOREQ.src) dlang's created pipe. i.e. the pipes is oneway "streets"

The purpose is to port a c-application to use dlang with a web ui

Since I'm new to dlang but know c-code I need to ask stupid level questions ;) Also I'm experimenting on OS X but it is intended for linux x86 in production, for now.

Only requirement is the struct IOREQ as sending structure and char[] as receiving structure, using FIFO pipe's. Outgoing pipe is fixed named and returning is based on mypid().

In pseudo code (don't have any working code yet)

open pipe and if doesn't exist create it, to receiver
open own pipe for reading.
create ioreq *io;
create spec sized char buffer
point io to start of buffer
add request to io.fc
add return pipe to io.src
write in pipe
read pipe for answer, into char array
close pipe
disassemble response into various struct data depending on request. Here I simply try by returning the sent ioreq and echo out the fc and src.

/anders

Reply via email to