<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [plt-scheme] Help intigrating C/C++ into Scheme</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Well I was hoping to communicate to it the easiest way possible which seemed like calling it directly from the Scheme program. I'm not sure what you mean by sockets exactly, but running it via command-line arguments did cross my mind to. I'm just at a complete loss about how to do, well, any of that from the Scheme program.<BR>
<BR>
Also the program is one I'm writing myself and is very easy to for me to edit.<BR>
<BR>
Steven Zukowski<BR>
<BR>
-----Original Message-----<BR>
From: Geoffrey S. Knauth [<A HREF="mailto:geoff@knauth.org">mailto:geoff@knauth.org</A>]<BR>
Sent: Sat 11/29/2008 5:33 PM<BR>
To: Zukowski, Steven D<BR>
Cc: plt-scheme@list.cs.brown.edu<BR>
Subject: Re: [plt-scheme] Help intigrating C/C++ into Scheme<BR>
<BR>
On Nov 29, 2008, at 16:59, Zukowski, Steven D wrote:<BR>
&gt; I am trying to have a Scheme program take input from the user, store&nbsp;<BR>
&gt; that, and then send that off to a C/C++ program for processing. Once&nbsp;<BR>
&gt; the data has been processed and worked I want to send it back to the&nbsp;<BR>
&gt; waiting Scheme program where it will then be displayed. I want the&nbsp;<BR>
&gt; user to start the Scheme Program which then brings up the GUI&nbsp;<BR>
&gt; interface I'm building, input the data and hit enter. Once the user&nbsp;<BR>
&gt; hits enter I want the Scheme part to call the C program and give it&nbsp;<BR>
&gt; the user provided parameters. The C program works them, then returns&nbsp;<BR>
&gt; the result to Scheme and shuts down.<BR>
&gt;<BR>
&gt; I am stuck at the part where I give data to a C/C++ program and then&nbsp;<BR>
&gt; get it back. I have tried exploring Scheme's Foreign Language&nbsp;<BR>
&gt; Interface but I can't get things working. I have tried reading over&nbsp;<BR>
&gt; the documentation supplied in the PLT docs on the PLT Scheme C API&nbsp;<BR>
&gt; but I just can't follow them. In short, I am completely stuck and I&nbsp;<BR>
&gt; have no idea how to proceed.<BR>
&gt;<BR>
&gt; Please, can someone tell me how to interface to a C program or link&nbsp;<BR>
&gt; one in with Scheme, I'm not sure the right way to say it. Or can&nbsp;<BR>
&gt; someone please point me to a in-depth tutorial for doing this? The&nbsp;<BR>
&gt; instructions on the PLT docs was not helpful because they were over&nbsp;<BR>
&gt; my head.<BR>
&gt;<BR>
<BR>
Steve,<BR>
<BR>
How did you want to communicate to the C/C++ program?&nbsp; Via sockets?&nbsp;&nbsp;<BR>
Command-line arguments?&nbsp; Direct call to C/C++ functions?&nbsp; Is this a C/C<BR>
++ program you wrote?&nbsp; (I'm wondering how easy it is for you to edit&nbsp;<BR>
its source code.)&nbsp; If you didn't write the C/C++ program, is it well&nbsp;<BR>
known?&nbsp; Do other programs or languages typically interface to this C/C+<BR>
+ program already?<BR>
<BR>
Geoff<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>