12.4.8 Serializing and deserializing Prolog terms
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Serializing and deserializing Prolog terms
            • PL_put_term_from_chars()
    • Packages
Availability:C-language interface function
int PL_put_term_from_chars(term_t t, int flags, size_t len, const char *s)
Parse the text from the C-string s holding len bytes and put the resulting term in t. len can be (size_t)-1, assuming a 0-terminated string. The flags argument controls the encoding and is currently one of REP_UTF8 (string is UTF8 encoded), REP_MB (string is encoded in the current locale) or 0 (string is encoded in ISO latin 1). The string may, but is not required, to be closed by a full stop (.).

If parsing produces an exception the behaviour depends on the CVT_EXCEPTION flag. If present, the exception is propagated into the environment. Otherwise, the exception is placed in t and the return value is FALSE.217The CVT_EXCEPTION was added in version 8.3.12.