C:/Users/Dennis/src/lang/Life_start/Life/life-1.02/source/copy.c File Reference

#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.

Data Structures

struct  hashbucket
struct  hashentry

Defines

#define HASHSIZE   2048
#define NUMBUCKETS   1024
#define HASH(A)   (((long) A + ((long) A >> 3)) & (HASHSIZE-1))
#define HASHEND   (-1)
#define ONHEAP(R)   ((GENERIC)R>=heap_pointer)
#define NEW(A, TYPE)
#define HEAPDONE(R)   (to_heap && ONHEAP(R))
#define EXACT_FLAG   0
#define QUOTE_FLAG   1
#define EVAL_FLAG   2
#define QUOTE_STUB   3

Functions

void init_copy ()
void clear_copy ()
void insert_translation (ptr_psi_term a, ptr_psi_term b, long info)
ptr_psi_term translate (ptr_psi_term a, long **infoptr)
ptr_psi_term copy ()
void mark_quote_c ()
static ptr_node copy_tree (ptr_node t, long copy_flag, long heap_flag)
ptr_psi_term exact_copy (ptr_psi_term t, long heap_flag)
ptr_psi_term quote_copy (ptr_psi_term t, long heap_flag)
ptr_psi_term eval_copy (ptr_psi_term t, long heap_flag)
ptr_psi_term inc_heap_copy (ptr_psi_term t)
ptr_psi_term copy (ptr_psi_term t, long copy_flag, long heap_flag)
ptr_node distinct_tree (ptr_node t)
ptr_psi_term distinct_copy (ptr_psi_term t)
void mark_quote_tree_c ()
void mark_quote_c (ptr_psi_term t, long heap_flag)
void mark_quote_tree_c (ptr_node n, long heap_flag)
void mark_eval_new ()
void mark_quote_new ()
void mark_eval_tree_new ()
void mark_quote_tree_new ()
void mark_eval (ptr_psi_term t)
void mark_nonstrict (ptr_psi_term t)
void mark_quote_new2 (ptr_psi_term t)
void mark_eval_new (ptr_psi_term t)
void mark_eval_tree_new (ptr_node n)
void mark_quote_new (ptr_psi_term t)
void mark_quote_tree_new (ptr_node n)
void mark_quote_tree ()
void mark_quote (ptr_psi_term t)
void mark_quote_tree (ptr_node t)
void bk_mark_quote_tree ()
void bk_mark_quote (ptr_psi_term t)
void bk_mark_quote_tree (ptr_node t)

Variables

static char vcid [] = "$Id: copy.c,v 1.2 1994/12/08 23:21:30 duchier Exp $"
jmp_buf env
static struct hashentry hashtable [HASHSIZE]
static struct hashbuckethashbuckets
static long hashtime
static long hashfree
static long numbuckets
long to_heap
static long curr_status
static long mark_nonstrict_flag


Define Documentation

#define EVAL_FLAG   2

Definition at line 255 of file copy.c.

Referenced by copy(), eval_copy(), and mark_quote_c().

#define EXACT_FLAG   0

Definition at line 253 of file copy.c.

Referenced by exact_copy(), and inc_heap_copy().

#define HASH (  )     (((long) A + ((long) A >> 3)) & (HASHSIZE-1))

Definition at line 37 of file copy.c.

Referenced by insert_translation(), and translate().

#define HASHEND   (-1)

Definition at line 40 of file copy.c.

Referenced by insert_translation(), and translate().

#define HASHSIZE   2048

Definition at line 30 of file copy.c.

Referenced by init_copy().

#define HEAPDONE (  )     (to_heap && ONHEAP(R))

Definition at line 191 of file copy.c.

Referenced by copy(), and copy_tree().

#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

Definition at line 34 of file copy.c.

Referenced by init_copy().

#define ONHEAP (  )     ((GENERIC)R>=heap_pointer)

Definition at line 176 of file copy.c.

#define QUOTE_FLAG   1

Definition at line 254 of file copy.c.

Referenced by copy(), mark_quote_c(), and quote_copy().

#define QUOTE_STUB   3

Definition at line 257 of file copy.c.

Referenced by copy(), and mark_quote_c().


Function Documentation

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  ) 

Definition at line 720 of file copy.c.

References bk_mark_quote(), and bk_mark_quote_tree().

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().

static ptr_node copy_tree ( ptr_node  t,
long  copy_flag,
long  heap_flag 
) [static]

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().

ptr_node distinct_tree ( ptr_node  t  ) 

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.

Referenced by main(), and WFInit().

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  ) 

Definition at line 618 of file copy.c.

References mark_eval_new(), and mark_eval_tree_new().

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  ) 

Definition at line 688 of file copy.c.

References mark_quote(), and mark_quote_tree().

void mark_quote_tree (  ) 

Referenced by mark_quote(), and mark_quote_tree().

void mark_quote_tree_c ( ptr_node  n,
long  heap_flag 
)

Definition at line 490 of file copy.c.

References mark_quote_c(), and mark_quote_tree_c().

void mark_quote_tree_c (  ) 

Referenced by mark_quote_c(), and mark_quote_tree_c().

void mark_quote_tree_new ( ptr_node  n  ) 

Definition at line 653 of file copy.c.

References mark_quote_new(), and mark_quote_tree_new().

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().


Variable Documentation

long curr_status [static]

Definition at line 279 of file copy.c.

Referenced by copy(), and mark_eval_new().

jmp_buf env

Definition at line 18 of file copy.c.

Referenced by copy(), main(), and WFInit().

struct hashbucket* hashbuckets [static]

Definition at line 55 of file copy.c.

long hashfree [static]

Definition at line 57 of file copy.c.

Referenced by clear_copy(), and insert_translation().

struct hashentry hashtable[HASHSIZE] [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]

Definition at line 58 of file copy.c.

Referenced by init_copy(), and insert_translation().

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]

Definition at line 7 of file copy.c.


Generated on Sat Jan 26 08:48:08 2008 for WildLife by  doxygen 1.5.4