Go to the source code of this file.
Data Structures | |
struct | a_stream |
struct | psi_feature |
Macros | |
#define | BYTEDATA_SIZE(X) (*(unsigned long *)(X->value_3)) |
#define | BYTEDATA_DATA(X) ((char*)((char*)X->value_3 + sizeof(unsigned long))) |
#define | BV_AND 0 |
#define | BV_OR 1 |
#define | BV_XOR 2 |
#define | BV_NOT 0 |
#define | BV_COUNT 1 |
#define | BV_GET 0 |
#define | BV_SET 1 |
#define | BV_CLEAR 2 |
#define | FP_NONE 0 |
#define | FP_INPUT 1 |
#define | FP_OUTPUT 2 |
#define | FP_PREPARE(s, OP) |
#define | SEEK_SET 0 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | SETFEATURE(lst, n, nam, val) ((lst[n].name_str=nam),(lst[n].value_str=val)) |
Typedefs | |
typedef struct a_stream * | ptr_stream |
Functions | |
long | call_primitive (long(*fun)(), int num, argi, GENERIC info) |
static ptr_psi_term | make_bytedata (ptr_definition sort, unsigned long bytes) |
static long | make_bitvector_internal (args, result, funct) |
static long | c_make_bitvector () |
static long | bitvector_binop_code (unsigned long *bv1, unsigned long *bv2, ptr_psi_term result, GENERIC op) |
static long | bitvector_binop_internal (ptr_psi_term *args, ptr_psi_term result, ptr_psi_term funct, GENERIC op) |
static long | bitvector_binop (long op) |
static long | c_bitvector_and () |
static long | c_bitvector_or () |
static long | c_bitvector_xor () |
static long | bitvector_unop_code (unsigned long *bv1, ptr_psi_term result, int op) |
static long | bitvector_unop_internal (args, result, funct, GENERIC op) |
static long | bitvector_unop (long op) |
static long | c_bitvector_not () |
static long | c_bitvector_count () |
static long | bitvector_bit_code (unsigned long *bv1, long idx, ptr_psi_term result, int op, ptr_psi_term funct) |
static long | bitvector_bit_internal (args, result, funct, GENERIC op) |
static long | bitvector_bit (long op) |
static long | c_bitvector_get () |
static long | c_bitvector_set () |
static long | c_bitvector_clear () |
void | regerror (char *s) |
static long | regexp_compile_internal (args, result, funct) |
static long | c_regexp_compile () |
static long | regexp_execute_internal (args, result, funct) |
static long | c_regexp_execute () |
ptr_psi_term | fileptr2stream (FILE *fp, ptr_definition typ) |
static long | int2stream_internal (args, result, funct) |
static long | c_int2stream () |
static long | fopen_internal (args, result, funct) |
static long | c_fopen () |
static long | fclose_internal (args, result, funct) |
static long | c_fclose () |
static long | fwrite_internal (args, result, funct) |
static long | c_fwrite () |
static long | fflush_internal (args, result, funct) |
static long | c_fflush () |
static long | get_buffer_internal (args, result, funct) |
static long | c_get_buffer () |
int | text_buffer_next (struct text_buffer *buf, int idx, char c, struct text_buffer **rbuf, int *ridx) |
char * | text_buffer_cmp (struct text_buffer *buf, int idx, char *str) |
void | text_buffer_push (struct text_buffer **buf, char c) |
void | text_buffer_free (struct text_buffer *buf) |
static long | get_record_internal (args, result, funct) |
static long | c_get_record () |
static long | get_code_internal (args, result, funct) |
static long | c_get_code () |
static long | ftell_internal (args, result, funct) |
static long | c_ftell () |
static long | fseek_internal (args, result, funct) |
static long | c_fseek () |
static long | stream2sys_stream_internal (args, result, funct) |
static long | c_stream2sys_stream () |
static long | sys_stream2stream_internal (args, result, funct) |
static long | c_sys_stream2stream () |
static long | socket_internal (args, result, funct) |
static long | c_socket () |
int | is_ipaddr (char *s) |
static long | bind_or_connect_internal (args, result, funct, void *info) |
static long | c_bind () |
static long | c_connect () |
static long | listen_internal (args, result, funct) |
static long | c_listen () |
static long | accept_internal (args, result, funct) |
static long | c_accept () |
static long | errno_internal (args, result, funct) |
static long | c_errno () |
static long | errmsg_internal (args, result, funct) |
static long | c_errmsg () |
static long | import_symbol_internal (args, result, funct) |
static long | c_import_symbol () |
static long | fork_internal (args, result, funct) |
static long | c_fork () |
static long | unify_pterm_result (ptr_psi_term t, ptr_definition sym, lst, int n) |
char * | get_numeric_feature (long n) |
static long | unify_wait_result (ptr_psi_term result, pid_t id, int status) |
static long | wait_internal (args, result, funct) |
static long | c_wait () |
static long | waitpid_internal (args, result, funct) |
static long | c_waitpid () |
static long | kill_internal (args, result, funct) |
static long | c_kill () |
static long | cuserid_internal (args, result, funct) |
static long | c_cuserid () |
static long | gethostname_internal (args, result, funct) |
static long | c_gethostname () |
static long | lazy_project_internal (args, result, funct) |
static long | c_lazy_project () |
static long | wait_on_feature_internal (args, result, funct) |
static long | c_wait_on_feature () |
static long | my_wait_on_feature_internal (args, result, funct) |
static long | c_my_wait_on_feature () |
static long | call_once_internal (args, result, funct) |
static long | c_call_once () |
static long | apply1_internal (args, result, funct) |
static long | c_apply1 () |
static long | getpid_internal (args, result, funct) |
static long | c_getpid () |
void | make_sys_type_links () |
void | check_sys_definitions () |
void | insert_sys_builtins () |
Variables | |
ptr_definition | sys_process_no_children |
ptr_definition | sys_process_exited |
ptr_definition | sys_process_signaled |
ptr_definition | sys_process_stopped |
ptr_definition | sys_process_continued |
#define BYTEDATA_DATA | ( | X | ) | ((char*)((char*)X->value_3 + sizeof(unsigned long))) |
#define FP_PREPARE | ( | s, | |
OP | |||
) |
#define SETFEATURE | ( | lst, | |
n, | |||
nam, | |||
val | |||
) | ((lst[n].name_str=nam),(lst[n].value_str=val)) |
typedef struct a_stream * ptr_stream |
|
static |
(FILE**)BYTEDATA_DATA(args[0]));
Definition at line 1188 of file sys.c.
References BYTEDATA_DATA, Errorline(), FALSE, fileptr2stream(), NULL, push_goal(), sys_socket_stream, TRUE, and unify.
|
static |
Definition at line 1670 of file sys.c.
References wl_psi_term::attr_list, clear_copy(), distinct_copy(), Errorline(), eval, FALSE, FEATCMP, function_it, get_numeric_feature(), heap_copy_string(), integer, push_goal(), quoted_string, REAL, residuate(), wl_definition::rule, stack_insert(), sub_type(), top, TRUE, and wl_psi_term::type.
|
static |
(FILE**)BYTEDATA_DATA(args[0]));
Definition at line 1079 of file sys.c.
References BYTEDATA_DATA, Errorline(), FALSE, is_ipaddr(), NULL, REAL, and TRUE.
|
static |
Definition at line 216 of file sys.c.
References bitvector_binop_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
Definition at line 167 of file sys.c.
References BV_AND, BV_OR, BV_XOR, c_abort(), make_bytedata(), NULL, push_goal(), sys_bitvector, TRUE, unify, and wl_psi_term::value_3.
|
static |
Definition at line 206 of file sys.c.
References bitvector_binop_code().
|
static |
Definition at line 371 of file sys.c.
References bitvector_bit_internal(), call_primitive(), integer, NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
Definition at line 324 of file sys.c.
References BV_CLEAR, BV_GET, BV_SET, Errorline(), FALSE, make_bytedata(), NULL, push_goal(), REAL, sys_bitvector, TRUE, unify, unify_real_result(), and wl_psi_term::value_3.
|
static |
Definition at line 361 of file sys.c.
References bitvector_bit_code(), and REAL.
|
static |
Definition at line 299 of file sys.c.
References bitvector_unop_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
Definition at line 247 of file sys.c.
References BV_COUNT, BV_NOT, c_abort(), make_bytedata(), NULL, push_goal(), REAL, sys_bitvector, TRUE, unify, unify_real_result(), and wl_psi_term::value_3.
|
static |
Definition at line 290 of file sys.c.
References bitvector_unop_code().
|
static |
Definition at line 1212 of file sys.c.
References accept_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_socket_stream.
|
static |
Definition at line 1698 of file sys.c.
References apply1_internal(), call_primitive(), NARGS, NOVALUE, REQUIRED, SETARG, and top.
|
static |
Definition at line 1146 of file sys.c.
References bind_or_connect_internal(), call_primitive(), integer, MANDATORY, NARGS, NULL, OPTIONAL, quoted_string, SETARG, and sys_socket_stream.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1662 of file sys.c.
References call_once_internal(), call_primitive(), MANDATORY, NARGS, NOVALUE, SETARG, top, and UNEVALED.
|
static |
Definition at line 1157 of file sys.c.
References bind_or_connect_internal(), call_primitive(), integer, MANDATORY, NARGS, OPTIONAL, quoted_string, SETARG, and sys_socket_stream.
|
static |
|
static |
Definition at line 1253 of file sys.c.
References call_primitive(), errmsg_internal(), integer, NARGS, OPTIONAL, and SETARG.
|
static |
|
static |
Definition at line 642 of file sys.c.
References call_primitive(), fclose_internal(), NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
Definition at line 684 of file sys.c.
References call_primitive(), fflush_internal(), MANDATORY, NARGS, SETARG, and sys_stream.
|
static |
Definition at line 623 of file sys.c.
References call_primitive(), fopen_internal(), NARGS, quoted_string, REQUIRED, and SETARG.
|
static |
|
static |
Definition at line 955 of file sys.c.
References call_primitive(), fseek_internal(), integer, MANDATORY, NARGS, OPTIONAL, SETARG, and sys_file_stream.
|
static |
Definition at line 924 of file sys.c.
References call_primitive(), ftell_internal(), NARGS, REQUIRED, SETARG, and sys_file_stream.
|
static |
Definition at line 664 of file sys.c.
References call_primitive(), fwrite_internal(), MANDATORY, NARGS, quoted_string, SETARG, and sys_stream.
|
static |
Definition at line 710 of file sys.c.
References call_primitive(), get_buffer_internal(), integer, NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
Definition at line 903 of file sys.c.
References call_primitive(), get_code_internal(), NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
Definition at line 883 of file sys.c.
References call_primitive(), get_record_internal(), NARGS, quoted_string, REQUIRED, SETARG, and sys_stream.
|
static |
Definition at line 1516 of file sys.c.
References call_primitive(), gethostname_internal(), and NULL.
|
static |
|
static |
Definition at line 1305 of file sys.c.
References call_primitive(), import_symbol_internal(), MANDATORY, NARGS, NOVALUE, OPTIONAL, SETARG, top, and UNEVALED.
|
static |
Definition at line 598 of file sys.c.
References call_primitive(), int2stream_internal(), integer, NARGS, quoted_string, REQUIRED, and SETARG.
|
static |
Definition at line 1470 of file sys.c.
References call_primitive(), integer, kill_internal(), MANDATORY, NARGS, and SETARG.
|
static |
Definition at line 1552 of file sys.c.
References call_primitive(), lazy_project_internal(), NARGS, NOVALUE, REQUIRED, SETARG, and top.
|
static |
Definition at line 1179 of file sys.c.
References call_primitive(), integer, listen_internal(), MANDATORY, NARGS, SETARG, and sys_socket_stream.
|
static |
Definition at line 155 of file sys.c.
References call_primitive(), integer, make_bitvector_internal(), NARGS, REQUIRED, and SETARG.
|
static |
Definition at line 1628 of file sys.c.
References call_primitive(), MANDATORY, my_wait_on_feature_internal(), NARGS, NOVALUE, SETARG, top, and UNEVALED.
|
static |
Definition at line 453 of file sys.c.
References call_primitive(), NARGS, quoted_string, regexp_compile_internal(), REQUIRED, and SETARG.
|
static |
Definition at line 538 of file sys.c.
References call_primitive(), integer, NARGS, NOVALUE, OPTIONAL, quoted_string, regexp_execute_internal(), REQUIRED, SETARG, sys_regexp, and top.
|
static |
Definition at line 1059 of file sys.c.
References call_primitive(), NARGS, OPTIONAL, quoted_string, SETARG, and socket_internal().
|
static |
Definition at line 974 of file sys.c.
References call_primitive(), NARGS, REQUIRED, SETARG, stream, and stream2sys_stream_internal().
|
static |
Definition at line 994 of file sys.c.
References call_primitive(), NARGS, REQUIRED, SETARG, sys_stream, and sys_stream2stream_internal().
|
static |
|
static |
Definition at line 1590 of file sys.c.
References call_primitive(), MANDATORY, NARGS, NOVALUE, SETARG, top, UNEVALED, and wait_on_feature_internal().
|
static |
Definition at line 1453 of file sys.c.
References call_primitive(), integer, NARGS, OPTIONAL, REQUIRED, SETARG, and waitpid_internal().
|
static |
Definition at line 1644 of file sys.c.
References choice_stack, DEFRULES, general_cut, lf_false, lf_true, NULL, prove, push_choice_point(), push_goal(), resid_aim, stack_psi_term(), TRUE, wl_psi_term::type, and unify.
long call_primitive | ( | long (*)() | fun, |
int | num, | ||
argi | , | ||
GENERIC | info | ||
) |
Definition at line 12 of file sys.c.
References wl_goal::aaaa_1, aim, ARGNN, wl_psi_term::attr_list, wl_goal::bbbb_1, c_abort(), curry(), wl_node::data, deref, deref_ptr, Errorline(), FALSE, FEATCMP, find(), JUSTFAIL, MANDATORY, NOVALUE, NULL, overlap_type(), POLYTYPE, REQUIRED, residuate(), sub_type(), TRUE, wl_psi_term::type, psi_arg::type, UNEVALED, and wl_psi_term::value_3.
void check_sys_definitions | ( | ) |
Definition at line 1740 of file sys.c.
References check_definition(), sys_bitvector, sys_bytedata, sys_file_stream, sys_regexp, sys_socket_stream, and sys_stream.
|
static |
Definition at line 1482 of file sys.c.
References NULL, push_goal(), stack_string(), TRUE, and unify.
|
static |
Definition at line 1241 of file sys.c.
References NULL, push_goal(), REAL, stack_string(), TRUE, unify, and wl_psi_term::value_3.
|
static |
|
static |
|
static |
Definition at line 673 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_NONE, a_stream::op, and TRUE.
ptr_psi_term fileptr2stream | ( | FILE* | fp, |
ptr_definition | typ | ||
) |
Definition at line 571 of file sys.c.
References BYTEDATA_DATA, FP_NONE, and make_bytedata().
|
static |
Definition at line 607 of file sys.c.
References FALSE, fileptr2stream(), NULL, push_goal(), sys_file_stream, TRUE, and unify.
|
static |
|
static |
(FILE**)BYTEDATA_DATA(args[0])
Definition at line 942 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_NONE, a_stream::op, REAL, SEEK_SET, and TRUE.
|
static |
Definition at line 911 of file sys.c.
References BYTEDATA_DATA, a_stream::fp, FP_INPUT, FP_NONE, a_stream::op, REAL, and unify_real_result().
|
static |
Definition at line 650 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_OUTPUT, FP_PREPARE, and TRUE.
|
static |
Definition at line 692 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_INPUT, FP_PREPARE, heap_alloc(), NULL, push_goal(), quoted_string, REAL, stack_psi_term(), TRUE, wl_psi_term::type, unify, and wl_psi_term::value_3.
|
static |
Definition at line 892 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_INPUT, FP_PREPARE, REAL, and unify_real_result().
char* get_numeric_feature | ( | long | n | ) |
|
static |
Definition at line 807 of file sys.c.
References BYTEDATA_DATA, text_buffer::data, a_stream::fp, FP_INPUT, FP_PREPARE, heap_alloc(), text_buffer::next, NULL, push_goal(), quoted_string, stack_psi_term(), text_buffer_cmp(), text_buffer_free(), text_buffer_next(), text_buffer_push(), text_buffer::top, TRUE, wl_psi_term::type, unify, and wl_psi_term::value_3.
|
static |
Definition at line 1504 of file sys.c.
References FALSE, NULL, push_goal(), stack_string(), TRUE, and unify.
|
static |
|
static |
Definition at line 1269 of file sys.c.
References wl_keyword::combined_name, current_module, wl_keyword::definition, Errorline(), FALSE, hash_insert(), hash_lookup(), HEAP_ALLOC, heap_copy_string(), make_module_token(), wl_keyword::module, wl_keyword::private_feature, wl_keyword::public, wl_keyword::symbol, wl_module::symbol_table, TRUE, wl_definition::type_def, and undef.
void insert_sys_builtins | ( | ) |
Definition at line 1760 of file sys.c.
References bi_module, c_accept(), c_apply1(), c_bind(), c_bitvector_and(), c_bitvector_clear(), c_bitvector_count(), c_bitvector_get(), c_bitvector_not(), c_bitvector_or(), c_bitvector_set(), c_bitvector_xor(), c_call_once(), c_connect(), c_cuserid(), c_errmsg(), c_errno(), c_fclose(), c_fflush(), c_fopen(), c_fork(), c_fseek(), c_ftell(), c_fwrite(), c_get_buffer(), c_get_code(), c_get_record(), c_gethostname(), c_getpid(), c_import_symbol(), c_int2stream(), c_kill(), c_lazy_project(), c_listen(), c_make_bitvector(), c_my_wait_on_feature(), c_regexp_compile(), c_regexp_execute(), c_socket(), c_stream2sys_stream(), c_sys_stream2stream(), c_wait(), c_wait_on_feature(), c_waitpid(), current_module, function_it, insert_dbm_builtins(), new_built_in(), predicate, set_current_module(), sys_bitvector, sys_bytedata, sys_file_stream, sys_module, sys_regexp, sys_socket_stream, sys_stream, and update_symbol().
|
static |
Definition at line 582 of file sys.c.
References FALSE, fileptr2stream(), NULL, push_goal(), REAL, sys_stream, TRUE, and unify.
int is_ipaddr | ( | char* | s | ) |
|
static |
|
static |
Definition at line 1525 of file sys.c.
References wl_node::data, FEATCMP, find(), integer, NULL, push_goal(), quoted_string, REAL, residuate(), sub_type(), top, TRUE, and unify.
|
static |
(FILE**)BYTEDATA_DATA(args[0]));
Definition at line 1168 of file sys.c.
References BYTEDATA_DATA, FALSE, REAL, and TRUE.
|
static |
Definition at line 138 of file sys.c.
References Errorline(), FALSE, make_bytedata(), NULL, push_goal(), REAL, sys_bitvector, TRUE, and unify.
|
static |
Definition at line 113 of file sys.c.
References heap_alloc(), stack_psi_term(), wl_psi_term::type, and wl_psi_term::value_3.
void make_sys_type_links | ( | ) |
Definition at line 1726 of file sys.c.
References built_in, make_type_link(), sys_bitvector, sys_bytedata, sys_file_stream, sys_regexp, sys_socket_stream, and sys_stream.
|
static |
Definition at line 1600 of file sys.c.
References DEFRULES, FEATCMP, find(), integer, NULL, prove, push_goal(), quoted_string, REAL, residuate(), sub_type(), top, TRUE, and unify_bool_result().
void regerror | ( | char* | s | ) |
|
static |
Definition at line 416 of file sys.c.
References c_abort(), Errorline(), make_bytedata(), NULL, push_goal(), sys_regexp, TRUE, unify, and wl_psi_term::value_3.
|
static |
Definition at line 469 of file sys.c.
References wl_psi_term::attr_list, c_abort(), wl_node::data, Errorline(), FALSE, FEATCMP, find(), NULL, push_goal(), REAL, stack_insert_copystr(), stack_int(), stack_pair(), stack_psi_term(), top, TRUE, wl_psi_term::type, unify, and unify_bool_result().
|
static |
Definition at line 1012 of file sys.c.
References Errorline(), FALSE, fileptr2stream(), NULL, push_goal(), sys_socket_stream, TRUE, and unify.
|
static |
Definition at line 965 of file sys.c.
References fileptr2stream(), NULL, push_goal(), sys_stream, TRUE, and unify.
|
static |
Definition at line 982 of file sys.c.
References BYTEDATA_DATA, NULL, push_goal(), stack_psi_term(), stream, TRUE, wl_psi_term::type, unify, and wl_psi_term::value_3.
char* text_buffer_cmp | ( | struct text_buffer * | buf, |
int | idx, | ||
char * | str | ||
) |
void text_buffer_free | ( | struct text_buffer * | buf | ) |
int text_buffer_next | ( | struct text_buffer * | buf, |
int | idx, | ||
char | c, | ||
struct text_buffer** | rbuf, | ||
int* | ridx | ||
) |
void text_buffer_push | ( | struct text_buffer ** | buf, |
char | c | ||
) |
Definition at line 773 of file sys.c.
References text_buffer::data, and TEXTBUFSIZE.
|
static |
Definition at line 1339 of file sys.c.
References wl_psi_term::attr_list, FEATCMP, NULL, push_goal(), stack_insert(), stack_psi_term(), TRUE, wl_psi_term::type, unify, and psi_feature::value_str.
|
static |
Definition at line 1384 of file sys.c.
References Errorline(), FALSE, one, SETFEATURE, stack_int(), sys_process_continued, sys_process_exited, sys_process_no_children, sys_process_signaled, sys_process_stopped, two, and unify_pterm_result().
|
static |
Definition at line 1428 of file sys.c.
References unify_wait_result().
|
static |
Definition at line 1564 of file sys.c.
References DEFRULES, FEATCMP, find(), integer, NULL, prove, push_goal(), quoted_string, REAL, residuate(), sub_type(), top, and TRUE.
|
static |
Definition at line 1443 of file sys.c.
References REAL, and unify_wait_result().
ptr_definition sys_process_continued |
ptr_definition sys_process_exited |
ptr_definition sys_process_no_children |
ptr_definition sys_process_signaled |
ptr_definition sys_process_stopped |