12.3.1 Type term_t: a reference to a Prolog term
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • Interface Data Types
          • Type term_t: a reference to a Prolog term
            • PL_new_term_ref()
            • PL_new_term_refs()
            • PL_copy_term_ref()
            • PL_reset_term_refs()
            • Interaction with the garbage collector and stack-shifter
    • Packages
Availability:C-language interface function
term_t PL_new_term_refs(int n)
Return n new term references. The first term reference is returned. The others are t+1, t+2, etc. Raise a resource exception and returns (term_t)0 on failure. There are two reasons for using this function. PL_open_query() expects the arguments as a set of consecutive term references, and very time-critical code requiring a number of term references can be written as:
pl_mypredicate(term_t a0, term_t a1)
{ term_t t0 = PL_new_term_refs(2);
  term_t t1 = t0+1;

  ...
}