#include "extern.h"#include "memory.h"#include "parser.h"#include "trees.h"#include "login.h"#include "copy.h"Go to the source code of this file.
| #define EVAL_FLAG 2 |
| #define EXACT_FLAG 0 |
| #define HASH | ( | A | ) | (((long) A + ((long) A >> 3)) & (HASHSIZE-1)) |
| #define HASHEND (-1) |
| #define HASHSIZE 2048 |
| #define HEAPDONE | ( | R | ) | (to_heap && ONHEAP(R)) |
| #define NEW | ( | A, | |||
| TYPE | ) |
Value:
(heap_flag==HEAP \ ? (to_heap \ ? (ONHEAP(A) \ ? A \ : HEAP_ALLOC(TYPE) \ ) \ : HEAP_ALLOC(TYPE) \ ) \ : STACK_ALLOC(TYPE) \ )
Definition at line 179 of file copy.c.
Referenced by copy(), copy_tree(), and mark_quote_c().
| #define NUMBUCKETS 1024 |
| #define ONHEAP | ( | R | ) | ((GENERIC)R>=heap_pointer) |
| #define QUOTE_FLAG 1 |
| #define QUOTE_STUB 3 |
| void bk_mark_quote | ( | ptr_psi_term | t | ) |
Definition at line 703 of file copy.c.
References bk_mark_quote_tree(), heap_pointer, int_ptr, push_ptr_value(), QUOTED_TRUE, and RMASK.
Referenced by bk_mark_quote_tree(), c_assert_first(), c_assert_last(), and pred_clause().
| void bk_mark_quote_tree | ( | ptr_node | t | ) |
| void bk_mark_quote_tree | ( | ) |
Referenced by bk_mark_quote(), and bk_mark_quote_tree().
| void clear_copy | ( | ) |
Definition at line 86 of file copy.c.
References hashfree, and hashtime.
Referenced by add_rule(), apply1_internal(), c_apply(), c_assign(), c_copy_term(), c_eval(), c_freeze_inner(), c_global_assign(), c_project(), c_setq(), clause_aim(), eval_aim(), eval_global_var(), fetch_def(), fetch_def_lazy(), garbage(), global_one(), mark_eval(), mark_nonstrict(), mark_quote_new2(), prove_aim(), and replace().
| ptr_psi_term copy | ( | ptr_psi_term | t, | |
| long | copy_flag, | |||
| long | heap_flag | |||
| ) |
Definition at line 283 of file copy.c.
References abort_life(), wl_psi_term::attr_list, choice_stack, COPY_THRESHOLD, copy_tree(), curr_status, cut, deref_ptr, env, Errorline(), EVAL_FLAG, FALSE, wl_psi_term::flags, function, global, global_time_stamp, HEAP, heap_pointer, HEAPDONE, insert_translation(), mark_quote_c(), NEW, NULL, QUOTE_FLAG, QUOTE_STUB, QUOTED_TRUE, wl_psi_term::resid, stack_pointer, wl_psi_term::status, wl_psi_term::time_stamp, Traceline, translate(), TRUE, type, and wl_psi_term::value.
| ptr_psi_term copy | ( | ) |
Referenced by check_func(), copy_tree(), eval_copy(), exact_copy(), inc_heap_copy(), and quote_copy().
Definition at line 197 of file copy.c.
References copy(), wl_node::data, HEAPDONE, wl_node::key, wl_node::left, NEW, NULL, and wl_node::right.
Referenced by copy().
| ptr_psi_term distinct_copy | ( | ptr_psi_term | t | ) |
Definition at line 422 of file copy.c.
References wl_psi_term::attr_list, distinct_tree(), global_time_stamp, STACK_ALLOC, and wl_psi_term::time_stamp.
Referenced by apply1_internal(), and c_apply().
Definition at line 398 of file copy.c.
References wl_node::data, wl_node::key, wl_node::left, NULL, wl_node::right, and STACK_ALLOC.
Referenced by c_apply(), and distinct_copy().
| ptr_psi_term eval_copy | ( | ptr_psi_term | t, | |
| long | heap_flag | |||
| ) |
Definition at line 269 of file copy.c.
References copy(), EVAL_FLAG, FALSE, and to_heap.
Referenced by c_eval(), c_freeze_inner(), eval_aim(), eval_global_var(), fetch_def(), fetch_def_lazy(), and prove_aim().
| ptr_psi_term exact_copy | ( | ptr_psi_term | t, | |
| long | heap_flag | |||
| ) |
Definition at line 259 of file copy.c.
References copy(), EXACT_FLAG, FALSE, and to_heap.
Referenced by c_assign(), and c_copy_term().
| ptr_psi_term inc_heap_copy | ( | ptr_psi_term | t | ) |
Definition at line 275 of file copy.c.
References copy(), EXACT_FLAG, to_heap, and TRUE.
Referenced by c_global_assign(), and c_project().
| void init_copy | ( | ) |
Definition at line 68 of file copy.c.
References HASHSIZE, hashtable, hashtime, NUMBUCKETS, and numbuckets.
| void insert_translation | ( | ptr_psi_term | a, | |
| ptr_psi_term | b, | |||
| long | info | |||
| ) |
Definition at line 97 of file copy.c.
References hashentry::bucketindex, HASH, HASHEND, hashfree, hashtable, hashtime, hashbucket::info, hashbucket::new_value, hashbucket::next, numbuckets, hashbucket::old_value, hashentry::timestamp, and Traceline.
Referenced by copy(), mark_eval_new(), mark_quote_c(), mark_quote_new(), and rec_replace().
| void mark_eval | ( | ptr_psi_term | t | ) |
Definition at line 524 of file copy.c.
References clear_copy(), FALSE, mark_eval_new(), and mark_nonstrict_flag.
Referenced by c_eval_inplace().
| void mark_eval_new | ( | ptr_psi_term | t | ) |
Definition at line 551 of file copy.c.
References curr_status, deref_ptr, FALSE, function, global, insert_translation(), mark_eval_tree_new(), mark_nonstrict_flag, mark_quote_new(), mark_quote_tree_new(), QUOTED_TRUE, translate(), TRUE, and type.
| void mark_eval_new | ( | ) |
Referenced by mark_eval(), mark_eval_tree_new(), and mark_nonstrict().
| void mark_eval_tree_new | ( | ptr_node | n | ) |
| void mark_eval_tree_new | ( | ) |
Referenced by mark_eval_new(), and mark_eval_tree_new().
| void mark_nonstrict | ( | ptr_psi_term | t | ) |
Definition at line 534 of file copy.c.
References clear_copy(), mark_eval_new(), mark_nonstrict_flag, and TRUE.
Referenced by parse().
| void mark_quote | ( | ptr_psi_term | t | ) |
Definition at line 673 of file copy.c.
References mark_quote_tree(), QUOTED_TRUE, and RMASK.
Referenced by c_parse(), c_read(), and mark_quote_tree().
| void mark_quote_c | ( | ptr_psi_term | t, | |
| long | heap_flag | |||
| ) |
Definition at line 462 of file copy.c.
References deref_ptr, EVAL_FLAG, wl_psi_term::flags, insert_translation(), mark_quote_tree_c(), NEW, QUOTE_FLAG, QUOTE_STUB, QUOTED_TRUE, wl_psi_term::status, and translate().
| void mark_quote_c | ( | ) |
Referenced by copy(), and mark_quote_tree_c().
| void mark_quote_new | ( | ptr_psi_term | t | ) |
Definition at line 629 of file copy.c.
References deref_ptr, FALSE, insert_translation(), mark_quote_tree_new(), QUOTED_TRUE, translate(), and TRUE.
| void mark_quote_new | ( | ) |
Referenced by mark_eval_new(), mark_quote_new2(), and mark_quote_tree_new().
| void mark_quote_new2 | ( | ptr_psi_term | t | ) |
Definition at line 543 of file copy.c.
References clear_copy(), FALSE, mark_nonstrict_flag, and mark_quote_new().
| void mark_quote_tree | ( | ptr_node | t | ) |
| void mark_quote_tree | ( | ) |
Referenced by mark_quote(), and mark_quote_tree().
| void mark_quote_tree_c | ( | ptr_node | n, | |
| long | heap_flag | |||
| ) |
| void mark_quote_tree_c | ( | ) |
Referenced by mark_quote_c(), and mark_quote_tree_c().
| void mark_quote_tree_new | ( | ptr_node | n | ) |
| void mark_quote_tree_new | ( | ) |
Referenced by mark_eval_new(), mark_quote_new(), and mark_quote_tree_new().
| ptr_psi_term quote_copy | ( | ptr_psi_term | t, | |
| long | heap_flag | |||
| ) |
Definition at line 264 of file copy.c.
References copy(), FALSE, QUOTE_FLAG, and to_heap.
Referenced by add_rule(), c_freeze_inner(), c_setq(), clause_aim(), eval_aim(), global_one(), and prove_aim().
| ptr_psi_term translate | ( | ptr_psi_term | a, | |
| long ** | infoptr | |||
| ) |
Definition at line 135 of file copy.c.
References hashentry::bucketindex, HASH, HASHEND, hashtable, hashtime, hashbucket::info, hashbucket::new_value, hashbucket::next, NULL, and hashbucket::old_value.
Referenced by copy(), mark_eval_new(), mark_quote_c(), mark_quote_new(), and rec_replace().
long curr_status [static] |
struct hashbucket* hashbuckets [static] |
long hashfree [static] |
Definition at line 54 of file copy.c.
Referenced by init_copy(), insert_translation(), and translate().
long hashtime [static] |
Definition at line 56 of file copy.c.
Referenced by clear_copy(), init_copy(), insert_translation(), and translate().
long mark_nonstrict_flag [static] |
Definition at line 514 of file copy.c.
Referenced by mark_eval(), mark_eval_new(), mark_nonstrict(), and mark_quote_new2().
long numbuckets [static] |
| long to_heap |
Definition at line 173 of file copy.c.
Referenced by eval_copy(), exact_copy(), inc_heap_copy(), and quote_copy().
char vcid[] = "$Id: copy.c,v 1.2 1994/12/08 23:21:30 duchier Exp $" [static] |
1.5.4