Thanks for all the replies to my question.

Most of suggestions focus on starting the C program as a separate process
then using pipes to communicate between the C and the Java program.

I have to add 3 conditions here which I didn't clearly explained in my
previous mail.

Condition 1:

I am using RedHat 6.0 and egcs and Blackdown Java 1.2 pre2

Condition 2:

The C program is just a set of API and doesn't have a main() function.  The
functions in C APIs are called from a JNI program which itself is called
from the Java program. So the C program runs in the same process space as
the Java program.

Conditon 3:

In this set of APIs, there is a function called "init".  It's arguments are:

extern int init(int argc, char* argv[], FILE* stdin, FILE* stdout, FILE*
stderr);

Users of the API can define the stdin, stdout and stderr here (or use NULL
for standard ones).  Once defined, in the rest of the API,  the output will
be printed to the specified FILEs.

The problem here is how can I pass a FILE structure from the Java program?
Once I can do this, the rest should be easy enouth.

Thanks again.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to