LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2004, 07:57 PM   #1
hippo100
LQ Newbie
 
Registered: Nov 2004
Location: Texas
Distribution: Gentoo
Posts: 6

Rep: Reputation: 0
Spim C++


Is there any way to incorporate SPIM into a C++ program?
 
Old 11-12-2004, 03:12 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
What would you like to do exactly? You can run it using one of teh functions from the exec() family.
 
Old 11-12-2004, 03:44 PM   #3
hippo100
LQ Newbie
 
Registered: Nov 2004
Location: Texas
Distribution: Gentoo
Posts: 6

Original Poster
Rep: Reputation: 0
My main question is how, once the SPIM simulator is started, I can send commands to it.

Last edited by hippo100; 11-12-2004 at 04:11 PM.
 
Old 11-13-2004, 02:12 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I don't remember how spim works exactly, but how it may be done:
* fork your process
* redirect standard input and output from one (file descriptors 0 and 1) to a pipe connected to the second one (pipe is one direction)
* exec spim in on of the processes
Then you should be able to read from pipe connected to spim's descriptor 1 (what means its messages) and write to one connected to 0 (so give it commands).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
spim/xspim Gueron Linux - Software 0 10-12-2005 04:46 PM
Spim crash75uk Linux - Newbie 5 11-12-2003 01:27 PM
Installing SPIM on Mandrake! crash75uk Linux - Software 1 11-11-2003 08:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration