User_defined Streams

In Quintus Prolog releases prior to 3.0, QP_make_stream() was the function used to create a user-defined stream. Quintus Prolog 3.1 users should use the method described in fli-ios-cps. QP_make_stream() creates an unbuffered Prolog stream. This is not very efficient.

QP_make_stream() can still be used in release 3, but may not be supported in the future. Other old QP I/O functions that may not be available in future release are:

     QP_sprintf()     QP_getc()       QP_sgetc()
     QP_putc()        QP_sputc()      QP_sputs()

The naming convention of these functions does not match well with their counterparts on C standard I/O library. For instance, QP_sprintf() performs formatted output on a Prolog stream as the same operation for fprintf(3) on a C standard I/O stream. It is therefore renamed to be QP_fprintf() in release 3. For the same reason, QP_sgetc() is renamed as QP_fgetc(); QP_sputc() is renamed as QP_fputc(). QP_getc() and QP_putc() are now actually macros defined in <quintus/quintus.h>. However, all these functions are still available in release 3. If a user's foreign code calls either QP_getc() or QP_putc() without including <quintus/quintus.h>, the old version of the function will be called. If <quintus/quintus.h> is included, the call is expanded to another function since both QP_getc() and QP_putc() are macros in <quintus/quintus.h>.