Page 1 of 1
Calling SDDS functions from C program
Posted: 08 Jul 2015, 14:57
by headdoggy64
Dear All,
I have a quick question. How one would properly call sddsprocess routine with arguments from your own C program?
Thanks,
Alex.
Re: Calling SDDS functions from C program
Posted: 13 Jul 2015, 11:54
by michael_borland
Alex,
Do you want to execute an SDDS program as a subprocess? If so, then you can use the system() call from C and give it an appropriate string containing an arbtrary command.
--Michael
Re: Calling SDDS functions from C program
Posted: 13 Jul 2015, 13:26
by headdoggy64
Dear Michael,
Actually, no. I want to use SDDS.h file and call the function inside my C code.
What would be the standard way to do it?
Alex.
Re: Calling SDDS functions from C program
Posted: 13 Jul 2015, 13:34
by michael_borland
Alex,
To do this with sddsprocess would be quite complicated. There's a source file SDDSaps/SDDSaps.c that contains some of the relevant code. In general, the programs themselves are not designed to be called as subroutines. Also, since the programs are designed to read/write data from/to files, you wouldn't expect any speed-up vs using the system() call method.
Perhaps if you can be more specific about what you want to do, I can give more concrete advice.
--Michael
Re: Calling SDDS functions from C program
Posted: 13 Jul 2015, 14:02
by headdoggy64
Thanks for the references! I will just proceed with system() functions.
Alex.