12.4.2 Atoms and functors
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Atoms and functors
            • PL_new_atom()
            • PL_new_atom_mbchars()
            • PL_atom_mbchars()
            • PL_atom_chars()
            • PL_new_functor()
            • PL_functor_name()
            • PL_functor_arity()
            • Atoms and atom garbage collection
    • Packages
Availability:C-language interface function
int PL_atom_mbchars(atom_t atom, size_t len, char *s, unsigned int flags)
This function generalizes fetching the text associated with an atom. The encoding depends on the flags REP_UTF8, REP_MB or REP_ISO_LATIN_1. Storage is defined by the BUF_* flags as described with PL_get_chars(). The flag CVT_EXCEPTION defines whether or not the function fails silently or raises a Prolog exception. This function may fail because atom is not a text atom but a blob (see section 12.4.9), conversion to the requested encoding is not possible or a resource error occurs.