View source with raw comments or as raw
    1/*  Part of SWI-Prolog
    2
    3    Author:        Jan Wielemaker
    4    E-mail:        J.Wielemaker@vu.nl
    5    WWW:           http://www.swi-prolog.org
    6    Copyright (c)  2011-2023, VU University Amsterdam
    7                              CWI, Amsterdam
    8                              SWI-Prolog Solutions b.v.
    9    All rights reserved.
   10
   11    Redistribution and use in source and binary forms, with or without
   12    modification, are permitted provided that the following conditions
   13    are met:
   14
   15    1. Redistributions of source code must retain the above copyright
   16       notice, this list of conditions and the following disclaimer.
   17
   18    2. Redistributions in binary form must reproduce the above copyright
   19       notice, this list of conditions and the following disclaimer in
   20       the documentation and/or other materials provided with the
   21       distribution.
   22
   23    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   24    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   25    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   26    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   27    COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
   28    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   29    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   30    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   31    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   32    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   33    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   34    POSSIBILITY OF SUCH DAMAGE.
   35*/
   36
   37:- module(prolog_system_predicate_options, []).

Provide declarations for options to built-in predicates

*/

   42:- predicate_options(system:open/4, 4,
   43		     [ type(oneof([text,binary])),
   44		       alias(atom),
   45		       encoding(encoding),
   46                       newline(oneof([dos,posix,detect])),
   47		       bom(boolean),
   48		       create(list(atom)),
   49		       eof_action(oneof([eof_code,error,reset])),
   50		       buffer(oneof([full,line,false])),
   51		       close_on_abort(boolean),
   52		       close_on_exec(boolean),
   53		       lock(oneof([none,read,shared,write,exclusive])),
   54                       reposition(boolean),
   55		       wait(boolean),
   56		       locale(any)		% no type-check yet
   57		     ]).   58:- predicate_options(system:write_term/3, 3,
   59		     [ attributes(oneof([ignore,dots,write,portray])),
   60		       backquoted_string(boolean),
   61		       blobs(oneof([portray])),
   62                       brace_terms(boolean),
   63		       character_escapes(boolean),
   64                       character_escapes_unicode(boolean),
   65		       cycles(boolean),
   66		       fullstop(boolean),
   67		       nl(boolean),
   68                       no_lists(boolean),
   69		       ignore_ops(boolean),
   70		       max_depth(nonneg),
   71		       module(atom),
   72		       numbervars(boolean),
   73		       partial(boolean),
   74		       portray(boolean),
   75		       portray_goal(callable+2), % as in meta_predicate
   76		       priority(between(0,1200)),
   77                       quote_non_ascii(boolean),
   78		       quoted(boolean),
   79		       spacing(oneof([standard,next_argument])),
   80		       variable_names(list)
   81		     ]).   82:- predicate_options(system:write_term/2, 2,
   83		     [ pass_to(system:write_term/3, 3)
   84		     ]).   85:- predicate_options(system:write_length/3, 3,
   86		     [ max_length(nonneg),
   87		       pass_to(system:write_term/3, 3)
   88		     ]).   89:- predicate_options(system:read_clause/3, 3,
   90		     [ syntax_errors(oneof([error,fail,quiet,dec10])),
   91		       process_comment(boolean),
   92		       term_position(-any),
   93		       variable_names(-list),
   94		       subterm_positions(-any),
   95		       comments(-list)
   96		     ]).   97:- predicate_options(system:read_term/3, 3,
   98		     [ backquoted_string(boolean),
   99		       character_escapes(boolean),
  100		       comments(-any),
  101		       cycles(boolean),
  102		       double_quotes(boolean),
  103		       module(atom),
  104		       singletons(-list),
  105		       syntax_errors(oneof([error,fail,quiet,dec10])),
  106		       subterm_positions(-any),
  107		       term_position(-any),
  108		       variables(-list),
  109		       variable_names(-list)
  110		     ]).  111:- predicate_options(system:read_term/2, 2,
  112		     [ pass_to(system:read_term/3, 3)
  113		     ]).  114:- predicate_options(system:numbervars/4, 4,
  115		     [ functor_name(atom),
  116		       attvar(oneof([skip,bind,error])),
  117		       singletons(boolean)
  118		     ]).  119:- predicate_options(system:absolute_file_name/3, 3,
  120		     [ extensions(list(atom)),
  121		       relative_to(atom),
  122		       access(oneof([read,write,append,execute,exist,none])),
  123		       file_type(oneof([txt,prolog,source,executable,directory])),
  124		       file_errors(oneof([fail,error])),
  125		       solutions(oneof([first,all])),
  126		       expand(boolean)
  127		     ]).  128:- predicate_options(system:load_files/2, 2,
  129		     [ autoload(boolean),
  130		       derived_from(atom),
  131                       dialect(atom),
  132		       encoding(encoding),
  133		       expand(boolean),
  134		       format(oneof([source,qlf])),
  135		       if(oneof([true,changed,not_loaded])),
  136		       imports(any),
  137		       modified(float),
  138		       module(atom),
  139                       check_script(boolean),
  140		       must_be_module(boolean),
  141		       qcompile(oneof([never,auto,large,part])),
  142                       optimise(boolean),
  143		       redefine_module(oneof([false,true,ask])),
  144		       reexport(boolean),
  145		       sandboxed(boolean),
  146		       scope_settings(boolean),
  147		       silent(boolean),
  148		       stream(any)
  149		     ]).  150:- predicate_options(system:qcompile/2, 2,
  151		     [ pass_to(system:load_files/2, 2)
  152		     ]).  153:- predicate_options(system:close/2, 2,
  154		     [ force(boolean)
  155		     ]).  156:- predicate_options(system:create_prolog_flag/3, 3,
  157		     [ access(oneof([read_write,read_only])),
  158		       type(( oneof([boolean,atom,integer,float,term])
  159                            ; compound(oneof(list(atom)))
  160                            )),
  161		       keep(boolean)
  162		     ]).  163:- predicate_options(system:qsave_program/2, 2,
  164		     [ local(nonneg),
  165		       global(nonneg),
  166		       trail(nonneg),
  167		       argument(nonneg),
  168		       goal(callable),
  169		       toplevel(callable),
  170		       init_file(atom),
  171		       class(oneof([runtime,kernel,development])),
  172		       autoload(boolean),
  173		       map(atom),
  174		       op(oneof([save,standard])),
  175		       stand_alone(boolean),
  176		       emulator(atom)
  177		     ]).  178:- predicate_options(system:thread_create/3, 3,
  179		     [ affinity(list(integer)),
  180                       alias(atom),
  181		       at_exit(callable),
  182		       debug(boolean),
  183		       inherit_from(any),
  184		       detached(boolean),
  185                       stack_limit(nonneg),
  186		       c_stack(nonneg),
  187                       queue_max_size(nonneg)
  188		     ]).  189:- predicate_options(system:message_queue_create/2, 2,
  190		     [ alias(atom),
  191		       max_size(nonneg)
  192		     ]).  193:- predicate_options(system:mutex_create/2, 2,
  194		     [ alias(atom)
  195		     ]).  196:- predicate_options(system:thread_send_message/3, 3,
  197		     [ timeout(number),
  198		       deadline(number)
  199		     ]).  200:- predicate_options(system:thread_get_message/3, 3,
  201		     [ timeout(number),
  202		       deadline(number)
  203		     ]).  204:- predicate_options(system:locale_create/3, 3,
  205		     [ alias(atom),
  206		       decimal_point(atom),
  207		       thousands_sep(atom),
  208		       grouping(list(any))
  209		     ]).  210:- predicate_options(system:term_string/3, 3,
  211		     [ pass_to(system:write_term/3, 3),
  212		       pass_to(system:read_term/3, 3)
  213		     ]).  214:- predicate_options(system:wildcard_match/3, 3,
  215		     [ case_sensitive(boolean)
  216		     ]).  217:- predicate_options('$syspreds':(dynamic)/2, 2,
  218		     [ incremental(boolean),
  219                       abstract(between(0,0)),
  220                       volatile(boolean),
  221                       discontiguous(boolean),
  222                       multifile(boolean),
  223                       thread(oneof([local,shared]))
  224		     ]).  225:- predicate_options(system:prolog_listen/3, 3,
  226                     [ as(oneof([first,last])),
  227                       name(atom)
  228                     ]).  229:- predicate_options(system:open_shared_object/3, 3,
  230                     [ resolve(oneof([lazy,now])),
  231                       visibility(oneof([local,global])),
  232                       now(bool),
  233                       global(bool),
  234		       delete(bool),
  235		       load(bool),
  236		       deepbind(bool)
  237                     ]).  238:- predicate_options('$pack':attach_packs/2, 2,
  239                     [ duplicate(oneof([warning,keep,replace])),
  240                       search(oneof([first,last])),
  241                       replace(boolean)
  242                     ]).