system functions More...
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, psi_arg argi[], GENERIC info) |
call_primitive More... | |
static ptr_psi_term | make_bytedata (ptr_definition sort, unsigned long bytes) |
make_bytedata( More... | |
static long | make_bitvector_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
make_bitvector_internal More... | |
static long | c_make_bitvector () |
c_make_bitvector More... | |
static long | bitvector_binop_code (unsigned long *bv1, unsigned long *bv2, ptr_psi_term result, GENERIC op) |
bitvector_binop_code More... | |
static long | bitvector_binop_internal (ptr_psi_term *args, ptr_psi_term result, ptr_psi_term funct, GENERIC op) |
bitvector_binop_internal More... | |
static long | bitvector_binop (long op) |
bitvector_binop More... | |
static long | c_bitvector_and () |
c_bitvector_and More... | |
static long | c_bitvector_or () |
c_bitvector_or More... | |
static long | c_bitvector_xor () |
c_bitvector_xor More... | |
static long | bitvector_unop_code (unsigned long *bv1, ptr_psi_term result, int op) |
bitvector_unop_code More... | |
static long | bitvector_unop_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct, int op) |
bitvector_unop_internal More... | |
static long | bitvector_unop (GENERIC op) |
bitvector_unop More... | |
static long | c_bitvector_not () |
c_bitvector_not More... | |
static long | c_bitvector_count () |
c_bitvector_count More... | |
static long | bitvector_bit_code (unsigned long *bv1, long idx, ptr_psi_term result, int op, ptr_psi_term funct) |
bitvector_bit_code More... | |
static long | bitvector_bit_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct, int op) |
bitvector_bit_internal More... | |
static long | bitvector_bit (long op) |
bitvector_bit More... | |
static long | c_bitvector_get () |
c_bitvector_get More... | |
static long | c_bitvector_set () |
c_bitvector_set More... | |
static long | c_bitvector_clear () |
c_bitvector_clear More... | |
void | regerror (char *s) |
regerror More... | |
static long | regexp_compile_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
regexp_compile_internal More... | |
static long | c_regexp_compile () |
c_regexp_compile More... | |
static long | regexp_execute_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
regexp_execute_internal More... | |
static long | c_regexp_execute () |
c_regexp_execute More... | |
ptr_psi_term | fileptr2stream (FILE *fp, ptr_definition typ) |
fileptr2stream More... | |
static long | int2stream_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
int2stream_internal More... | |
static long | c_int2stream () |
c_int2stream More... | |
static long | fopen_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
fopen_internal More... | |
static long | c_fopen () |
c_fopen More... | |
static long | fclose_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
fclose_internal More... | |
static long | c_fclose () |
c_fclose More... | |
static long | fwrite_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
fwrite_internal More... | |
static long | c_fwrite () |
c_fwrite More... | |
static long | fflush_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
fflush_internal More... | |
static long | c_fflush () |
c_fflush More... | |
static long | get_buffer_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
get_buffer_internal More... | |
static long | c_get_buffer () |
c_get_buffer More... | |
int | text_buffer_next (struct text_buffer *buf, int idx, char c, struct text_buffer **rbuf, int *ridx) |
text_buffer_next More... | |
char * | text_buffer_cmp (struct text_buffer *buf, int idx, char *str) |
text_buffer_cmp More... | |
void | text_buffer_push (struct text_buffer **buf, char c) |
text_buffer_push More... | |
void | text_buffer_free (struct text_buffer *buf) |
text_buffer_free More... | |
static long | get_record_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
get_record_internal More... | |
static long | c_get_record () |
c_get_record More... | |
static long | get_code_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
get_code_internal More... | |
static long | c_get_code () |
c_get_code More... | |
static long | ftell_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
ftell_internal More... | |
static long | c_ftell () |
c_ftell More... | |
static long | fseek_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
fseek_internal More... | |
static long | c_fseek () |
c_fseek More... | |
static long | stream2sys_stream_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
stream2sys_stream_internal More... | |
static long | c_stream2sys_stream () |
c_stream2sys_stream More... | |
static long | sys_stream2stream_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
sys_stream2stream_internal More... | |
static long | c_sys_stream2stream () |
c_sys_stream2stream More... | |
static long | socket_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
socket_internal More... | |
static long | c_socket () |
c_socket More... | |
int | is_ipaddr (char *s) |
is_ipaddr More... | |
static long | bind_or_connect_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct, void *info) |
bind_or_connect_internal More... | |
static long | c_bind () |
c_bind More... | |
static long | c_connect () |
c_connect More... | |
static long | listen_internal (args, result, funct) |
static long | c_listen () |
c_listen More... | |
static long | accept_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
accept_internal More... | |
static long | c_accept () |
c_accept More... | |
static long | errno_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
errno_internal More... | |
static long | c_errno () |
c_errno More... | |
static long | errmsg_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
errmsg_internal More... | |
static long | c_errmsg () |
c_errmsg More... | |
static long | import_symbol_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
import_symbol_internal More... | |
static long | c_import_symbol () |
c_import_symbol More... | |
static long | fork_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
static long | c_fork () |
c_fork More... | |
static long | unify_pterm_result (ptr_psi_term t, ptr_definition sym, psi_feature lst[], int n) |
unify_pterm_result More... | |
char * | get_numeric_feature (long n) |
get_numeric_feature More... | |
static long | unify_wait_result (ptr_psi_term result, pid_t id, int status) |
unify_wait_result More... | |
static long | wait_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
wait_internal More... | |
static long | c_wait () |
c_wait More... | |
static long | waitpid_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
waitpid_internal More... | |
static long | c_waitpid () |
c_waitpid More... | |
static long | kill_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
kill_internal More... | |
static long | c_kill () |
c_kill More... | |
static long | cuserid_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
cuserid_internal More... | |
static long | c_cuserid () |
c_cuserid More... | |
static long | gethostname_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
gethostname_internal More... | |
static long | c_gethostname () |
c_gethostname More... | |
static long | lazy_project_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
lazy_project_internal More... | |
static long | c_lazy_project () |
c_lazy_project More... | |
static long | wait_on_feature_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
wait_on_feature_internal More... | |
static long | c_wait_on_feature () |
c_wait_on_feature More... | |
static long | my_wait_on_feature_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
my_wait_on_feature_internal More... | |
static long | c_my_wait_on_feature () |
c_my_wait_on_feature More... | |
static long | call_once_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
call_once_internal More... | |
static long | c_call_once () |
c_call_once More... | |
static long | apply1_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
apply1_internal More... | |
static long | c_apply1 () |
c_apply1() More... | |
static long | getpid_internal (ptr_psi_term args[], ptr_psi_term result, ptr_psi_term funct) |
getpid_internal More... | |
static long | c_getpid () |
c_getpid More... | |
void | make_sys_type_links () |
make_sys_type_links More... | |
void | check_sys_definitions () |
check_sys_definitions More... | |
void | insert_sys_builtins () |
insert_sys_builtins More... | |
system functions
All new system utilities and extensions to Wild LIFE 1.01 are implemented in this file and made available in LIFE module "sys"
Definition in file sys.c.
#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 |
accept_internal
args | - ptr_psi_term args[] |
argsresult | - ptr_psi_term argsresult |
argsfunct | - ptr_psi_term argsfunct |
(FILE**)BYTEDATA_DATA(args[0]));
Definition at line 1476 of file sys.c.
References BYTEDATA_DATA, Errorline(), FALSE, fileptr2stream(), NULL, push_goal(), sys_socket_stream, TRUE, and unify.
|
static |
apply1_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 2099 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 |
bind_or_connect_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
info | - void *info |
(FILE**)BYTEDATA_DATA(args[0]));
Definition at line 1351 of file sys.c.
References BYTEDATA_DATA, Errorline(), FALSE, is_ipaddr(), NULL, REAL, and TRUE.
|
static |
bitvector_binop
op | - long op |
Definition at line 248 of file sys.c.
References bitvector_binop_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
bitvector_binop_code
bv1 | - unsigned long *bv1 |
bv2 | - unsigned long *bv2 |
result | - ptr_psi_term result |
op | - GENERIC op changed to GENERIC 2.16 no effect DJD |
Definition at line 194 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 |
bitvector_binop_internal
args | - ptr_psi_term *args |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
op | - GENERIC op changed to GENERIC 2.16 DJD |
BITVECTOR_BINOP
Definition at line 235 of file sys.c.
References bitvector_binop_code().
|
static |
bitvector_bit
op | - long op |
Definition at line 449 of file sys.c.
References bitvector_bit_internal(), call_primitive(), integer, NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
bitvector_bit_code
bv1 | - unsigned long *bv1 |
idx | - long idx |
result | - ptr_psi_term result |
op | - int op |
funct | - ptr_psi_term funct |
Definition at line 395 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 |
bitvector_bit_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
op | - int op 12/10/2016 changed from GENERIC to int 2.29 DJD |
Definition at line 436 of file sys.c.
References bitvector_bit_code(), and REAL.
|
static |
bitvector_unop
op | - GENERIC op 12/10/2016 changed from long to GENERIC (2.29) DJD |
Definition at line 354 of file sys.c.
References bitvector_unop_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_bitvector.
|
static |
bitvector_unop_code
bv1 | - unsigned long *bv1 |
result | - ptr_psi_term result |
op | - int op |
Definition at line 297 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 |
bitvector_unop_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
op | - int op 12/10/2016 changed from GENERIC to int (2.29) DJD |
BITVECTOR_UNOP
Definition at line 343 of file sys.c.
References bitvector_unop_code().
|
static |
c_accept
Definition at line 1503 of file sys.c.
References accept_internal(), call_primitive(), NARGS, REQUIRED, SETARG, and sys_socket_stream.
|
static |
Definition at line 2130 of file sys.c.
References apply1_internal(), call_primitive(), NARGS, NOVALUE, REQUIRED, SETARG, and top.
|
static |
c_bind
Definition at line 1419 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 |
c_call_once
Definition at line 2084 of file sys.c.
References call_once_internal(), call_primitive(), MANDATORY, NARGS, NOVALUE, SETARG, top, and UNEVALED.
|
static |
c_connect
Definition at line 1434 of file sys.c.
References bind_or_connect_internal(), call_primitive(), integer, MANDATORY, NARGS, OPTIONAL, quoted_string, SETARG, and sys_socket_stream.
|
static |
c_cuserid
Definition at line 1869 of file sys.c.
References call_primitive(), cuserid_internal(), and NULL.
|
static |
c_errmsg
Definition at line 1564 of file sys.c.
References call_primitive(), errmsg_internal(), integer, NARGS, OPTIONAL, and SETARG.
|
static |
c_errno
Definition at line 1532 of file sys.c.
References call_primitive(), errno_internal(), and NULL.
|
static |
c_fclose
Definition at line 787 of file sys.c.
References call_primitive(), fclose_internal(), NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
c_fflush
Definition at line 849 of file sys.c.
References call_primitive(), fflush_internal(), MANDATORY, NARGS, SETARG, and sys_stream.
|
static |
c_fopen
Definition at line 758 of file sys.c.
References call_primitive(), fopen_internal(), NARGS, quoted_string, REQUIRED, and SETARG.
|
static |
c_fork
Definition at line 1655 of file sys.c.
References call_primitive(), fork_internal(), and NULL.
|
static |
c_fseek
Definition at line 1185 of file sys.c.
References call_primitive(), fseek_internal(), integer, MANDATORY, NARGS, OPTIONAL, SETARG, and sys_file_stream.
|
static |
c_ftell
Definition at line 1144 of file sys.c.
References call_primitive(), ftell_internal(), NARGS, REQUIRED, SETARG, and sys_file_stream.
|
static |
c_fwrite
Definition at line 819 of file sys.c.
References call_primitive(), fwrite_internal(), MANDATORY, NARGS, quoted_string, SETARG, and sys_stream.
|
static |
c_get_buffer
Definition at line 885 of file sys.c.
References call_primitive(), get_buffer_internal(), integer, NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
c_get_code
Definition at line 1113 of file sys.c.
References call_primitive(), get_code_internal(), NARGS, REQUIRED, SETARG, and sys_stream.
|
static |
c_get_record
Definition at line 1083 of file sys.c.
References call_primitive(), get_record_internal(), NARGS, quoted_string, REQUIRED, SETARG, and sys_stream.
|
static |
c_gethostname
Definition at line 1901 of file sys.c.
References call_primitive(), gethostname_internal(), and NULL.
|
static |
c_getpid
Definition at line 2157 of file sys.c.
References call_primitive(), and getpid_internal().
|
static |
c_import_symbol
C_IMPORT_SYMBOL import a public symbol from another module into the current one, optionally renaming it.
Definition at line 1624 of file sys.c.
References call_primitive(), import_symbol_internal(), MANDATORY, NARGS, NOVALUE, OPTIONAL, SETARG, top, and UNEVALED.
|
static |
c_int2stream
Definition at line 723 of file sys.c.
References call_primitive(), int2stream_internal(), integer, NARGS, quoted_string, REQUIRED, and SETARG.
|
static |
c_kill
Definition at line 1835 of file sys.c.
References call_primitive(), integer, kill_internal(), MANDATORY, NARGS, and SETARG.
|
static |
c_lazy_project
Definition at line 1947 of file sys.c.
References call_primitive(), lazy_project_internal(), NARGS, NOVALUE, REQUIRED, SETARG, and top.
|
static |
c_listen
Definition at line 1460 of file sys.c.
References call_primitive(), integer, listen_internal(), MANDATORY, NARGS, SETARG, and sys_socket_stream.
|
static |
c_make_bitvector
Definition at line 174 of file sys.c.
References call_primitive(), integer, make_bitvector_internal(), NARGS, REQUIRED, and SETARG.
|
static |
c_my_wait_on_feature
Definition at line 2043 of file sys.c.
References call_primitive(), MANDATORY, my_wait_on_feature_internal(), NARGS, NOVALUE, SETARG, top, and UNEVALED.
|
static |
c_regexp_compile
Definition at line 554 of file sys.c.
References call_primitive(), NARGS, quoted_string, regexp_compile_internal(), REQUIRED, and SETARG.
|
static |
c_regexp_execute
Definition at line 648 of file sys.c.
References call_primitive(), integer, NARGS, NOVALUE, OPTIONAL, quoted_string, regexp_execute_internal(), REQUIRED, SETARG, sys_regexp, and top.
|
static |
c_socket
Definition at line 1319 of file sys.c.
References call_primitive(), NARGS, OPTIONAL, quoted_string, SETARG, and socket_internal().
|
static |
c_stream2sys_stream
Definition at line 1214 of file sys.c.
References call_primitive(), NARGS, REQUIRED, SETARG, stream, and stream2sys_stream_internal().
|
static |
c_sys_stream2stream
Definition at line 1244 of file sys.c.
References call_primitive(), NARGS, REQUIRED, SETARG, sys_stream, and sys_stream2stream_internal().
|
static |
c_wait
Definition at line 1782 of file sys.c.
References call_primitive(), NULL, and wait_internal().
|
static |
c_wait_on_feature
Definition at line 1995 of file sys.c.
References call_primitive(), MANDATORY, NARGS, NOVALUE, SETARG, top, UNEVALED, and wait_on_feature_internal().
|
static |
c_waitpid
Definition at line 1808 of file sys.c.
References call_primitive(), integer, NARGS, OPTIONAL, REQUIRED, SETARG, and waitpid_internal().
|
static |
call_once_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
CALL_ONCE
call_once(G) -> T | G,!,T=lf_true;T=lf_false.
Definition at line 2063 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.
call_primitive
fun | - (long (*fun)(), |
num | - int num |
argi | - psi_arg argi[] |
info | - GENERIC info |
Definition at line 24 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 | ( | ) |
check_sys_definitions
Definition at line 2186 of file sys.c.
References check_definition(), sys_bitvector, sys_bytedata, sys_file_stream, sys_process_continued, sys_process_exited, sys_process_no_children, sys_process_signaled, sys_process_stopped, sys_regexp, sys_socket_stream, and sys_stream.
|
static |
cuserid_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1854 of file sys.c.
References NULL, push_goal(), stack_string(), TRUE, and unify.
|
static |
errmsg_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1549 of file sys.c.
References NULL, push_goal(), REAL, stack_string(), TRUE, unify, and wl_psi_term::value_3.
|
static |
errno_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1521 of file sys.c.
References NULL, push_goal(), stack_int(), TRUE, and unify.
|
static |
fclose_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 774 of file sys.c.
References BYTEDATA_DATA, FALSE, and TRUE.
|
static |
fflush_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 835 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 | ||
) |
fileptr2stream
fp | - FILE *fp |
typ | - ptr_definition typ removed * DJD = prior to 2.29 |
Definition at line 688 of file sys.c.
References BYTEDATA_DATA, FP_NONE, and make_bytedata().
|
static |
fopen_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 739 of file sys.c.
References FALSE, fileptr2stream(), NULL, push_goal(), sys_file_stream, TRUE, and unify.
|
static |
Definition at line 1643 of file sys.c.
References FALSE, REAL, and unify_real_result().
|
static |
fseek_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
(FILE**)BYTEDATA_DATA(args[0])
Definition at line 1169 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_NONE, a_stream::op, REAL, SEEK_SET, TRUE, and wl_psi_term::value_3.
|
static |
ftell_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1128 of file sys.c.
References BYTEDATA_DATA, a_stream::fp, FP_INPUT, FP_NONE, a_stream::op, REAL, and unify_real_result().
|
static |
fwrite_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 802 of file sys.c.
References BYTEDATA_DATA, FALSE, a_stream::fp, FP_OUTPUT, FP_PREPARE, and TRUE.
|
static |
get_buffer_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 864 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 |
get_code_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1099 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 |
get_record_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1004 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 |
gethostname_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1886 of file sys.c.
References FALSE, NULL, push_goal(), stack_string(), TRUE, and unify.
|
static |
getpid_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 2147 of file sys.c.
References REAL, and unify_real_result().
|
static |
import_symbol_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1582 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(), wl_definition::keyword, make_module_token(), wl_keyword::module, wl_keyword::private_feature, wl_keyword::public, wl_keyword::symbol, wl_module::symbol_table, TRUE, wl_psi_term::type, wl_definition::type_def, and undef_it.
void insert_sys_builtins | ( | ) |
insert_sys_builtins
Definition at line 2209 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_it, set_current_module(), sys_bitvector, sys_bytedata, sys_file_stream, sys_module, sys_process_continued, sys_process_exited, sys_process_no_children, sys_process_signaled, sys_process_stopped, sys_regexp, sys_socket_stream, sys_stream, and update_symbol().
|
static |
int2stream_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 704 of file sys.c.
References FALSE, fileptr2stream(), NULL, push_goal(), REAL, sys_stream, TRUE, and unify.
int is_ipaddr | ( | char * | s | ) |
|
static |
|
static |
lazy_project_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1917 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 1445 of file sys.c.
References BYTEDATA_DATA, FALSE, REAL, and TRUE.
|
static |
make_bitvector_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
C_MAKE_BITVECTOR make a bitvector that can hold at least the given number of bits
Definition at line 154 of file sys.c.
References Errorline(), FALSE, make_bytedata(), NULL, push_goal(), REAL, sys_bitvector, TRUE, and unify.
|
static |
make_bytedata(
sort | - ptr_definition sort |
bytes | - unsigned long bytes |
MAKE_BYTEDATA construct a psi term of the given sort whose value points to a bytedata block that can hold the given number of bytes
Definition at line 126 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 | ( | ) |
make_sys_type_links
INITIALIZATION FUNCTIONS
Definition at line 2168 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 |
my_wait_on_feature_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 2012 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 |
regexp_compile_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
C_REGEXP_COMPILE given a string returns, compiles it into a regexp structure, then copies that structure into a bytedata block on the heap.
Definition at line 514 of file sys.c.
References c_abort(), Errorline(), make_bytedata(), NULL, push_goal(), sys_regexp, TRUE, unify, and wl_psi_term::value_3.
|
static |
regexp_execute_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | ptr_psi_term funct |
C_REGEXP_EXECUTE Attempts to match a regexp with a string regexp_execute(RE:regexp,S:string) -> @(0=>(S0,E0),(S1,E1),...) regexp_execute(RE:regexp,S:string,@(N=>(SN,EN),...)) -> boolean 2nd form only instantiates the bounds requested in the mask (3rd arg) and returns a boolean so that it can be used as a predicate. The optional argument "offset" specifies an offset into the string.
Definition at line 576 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, unify_bool_result(), and wl_psi_term::value_3.
|
static |
socket_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1269 of file sys.c.
References Errorline(), FALSE, fileptr2stream(), NULL, push_goal(), sys_socket_stream, TRUE, and unify.
|
static |
stream2sys_stream_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1202 of file sys.c.
References fileptr2stream(), NULL, push_goal(), sys_stream, TRUE, and unify.
|
static |
sys_stream2stream_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1229 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 | ||
) |
text_buffer_cmp
buf | - struct text_buffer *buf |
idx | - int idx |
str | - char *str |
compare string str with text in buffer buf starting at index idx. if the text to the end matches a prefix of the string, return pointer to remaining suffix of str to be matched, else return 0.
Definition at line 934 of file sys.c.
References text_buffer::data, text_buffer::next, and top.
void text_buffer_free | ( | struct text_buffer * | buf | ) |
text_buffer_free
buf | - struct text_buffer *buf |
free a linked list of buffers
Definition at line 986 of file sys.c.
References text_buffer::next.
int text_buffer_next | ( | struct text_buffer * | buf, |
int | idx, | ||
char | c, | ||
struct text_buffer ** | rbuf, | ||
int * | ridx | ||
) |
text_buffer_next
buf | - struct text_buffer *buf |
idx | - int idx |
c | - char c |
rbuf | - struct text_buffer **rbuf |
ridx | - int *ridx |
find the first match for character c starting from index idx in buffer buf. if found place new buffer and index in rbuf and ridx and return 1, else return 0
Definition at line 907 of file sys.c.
References text_buffer::data, text_buffer::next, and top.
void text_buffer_push | ( | struct text_buffer ** | buf, |
char | c | ||
) |
text_buffer_push
buf | - struct text_buffer **buf |
c | - char c |
add a character at the end of a buffer. if the buffer is full, allocate a new buffer and link it to the current one, then overwrite the variable holding the pointer to the current buffer with the pointer to the new buffer.
Definition at line 961 of file sys.c.
References text_buffer::next, TEXTBUFSIZE, and text_buffer::top.
|
static |
unify_pterm_result
t | - ptr_psi_term t |
sym | - ptr_definition sym |
lst | - psi_feature lst[] |
n | - int n |
Definition at line 1676 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 |
unify_wait_result
result | - ptr_psi_term result |
id | - pid_t id |
status | - int status |
Definition at line 1722 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 |
wait_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1770 of file sys.c.
References unify_wait_result().
|
static |
wait_on_feature_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1966 of file sys.c.
References DEFRULES, FEATCMP, find(), integer, NULL, prove, push_goal(), quoted_string, REAL, residuate(), sub_type(), top, and TRUE.
|
static |
waitpid_internal
args | - ptr_psi_term args[] |
result | - ptr_psi_term result |
funct | - ptr_psi_term funct |
Definition at line 1795 of file sys.c.
References REAL, and unify_wait_result().