Calling SDDS functions from C program

Moderators: cyao, michael_borland

Post Reply
headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Calling SDDS functions from C program

Post by headdoggy64 » 08 Jul 2015, 14:57

Dear All,

I have a quick question. How one would properly call sddsprocess routine with arguments from your own C program?

Thanks,
Alex.

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Calling SDDS functions from C program

Post by michael_borland » 13 Jul 2015, 11:54

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

headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Re: Calling SDDS functions from C program

Post by headdoggy64 » 13 Jul 2015, 13:26

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.

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Calling SDDS functions from C program

Post by michael_borland » 13 Jul 2015, 13:34

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

headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Re: Calling SDDS functions from C program

Post by headdoggy64 » 13 Jul 2015, 14:02

Thanks for the references! I will just proceed with system() functions.

Alex.

Post Reply