12.9.3 Interacting with foreign streams
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • Foreign access to Prolog IO streams
          • Interacting with foreign streams
            • Sset_timeout()
            • Sunit_size()
            • Sputc()
            • Sgetc()
            • Sfgetc()
            • Sungetc()
            • Sputcode()
            • Sgetcode()
            • Speekcode()
            • Sputw()
            • Sgetw()
            • Sfread()
            • Sfwrite()
            • Sfeof()
            • Sfpasteof()
            • Ssetlocale()
            • Sflush()
            • Ssize()
            • Sseek()
            • Sseek64()
            • Stell()
            • Stell64()
            • Sclose()
            • Sgcclose()
            • Sfgets()
            • Sgets()
            • Sread_pending()
            • Spending()
            • Sfputs()
            • Sputs()
            • Sfprintf()
            • Sprintf()
            • Svprintf()
            • Ssprintf()
            • Ssnprintf()
            • Svsprintf()
            • Svsnprintf()
            • Sdprintf()
            • Svdprintf()
            • Slock()
            • StryLock()
            • Sunlock()
            • Sfileno()
            • Swinsock()
            • Sclosehook()
            • Sset_filter()
            • Ssetbuffer()
    • Packages
Availability:C-language interface function
int Sclose(IOSTREAM *s)
Close the stream. This first locks the stream (see PL_acquire_stream()). When successful it flushes pending output and calls the Sclose_function() hook. Finally, the stream is unlocked and all memory associated to the stream is released. On success, the function returns 0. On failure a Prolog exception is raised and the return value is -1. Regardless of the return value, s becomes invalid after completion of Sclose(). See also Sgcclose().