Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
SbsSW.SwiPlCs.Streams Namespace
SwiPlCs interfaceSbsSW.SwiPlCs.Streams

The namespace SbsSW.SwiPlCs.Streams provides the delegates to redirect the read and write functions of the SWI-Prolog IO Streams.

When Initialize(array<String>[]()[][]) is called the *Sinput->functions.read is replaced by the .NET method 'Sread_function' and *Sinput->functions.write by 'Swrite_funktion'.

For further examples see the methods SetStreamFunctionWrite(PlStreamType, DelegateStreamWriteFunction) and SetStreamFunctionRead(PlStreamType, DelegateStreamReadFunction)

Types
Remarks
Note:
The reason for this is debugging.
Examples
 Copy imageCopy
static internal long Swrite_function(IntPtr handle, string buf, long bufsize)
{
    string s = buf.Substring(0, (int)bufsize);
    Console.Write(s);
    System.Diagnostics.Trace.WriteLine(s);
    return bufsize;
}

static internal long Sread_function(IntPtr handle, IntPtr buf, long bufsize)
{
    throw new PlLibException("SwiPlCs: Prolog try to read from stdin");
}
See Also