loader_xsb.c File Reference

#include "xsb_config.h"
#include "xsb_debug.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "auxlry.h"
#include "context.h"
#include "psc_xsb.h"
#include "psc_defs.h"
#include "loader_xsb.h"
#include "extensions_xsb.h"
#include "cell_xsb.h"
#include "heap_xsb.h"
#include "flags_xsb.h"
#include "tries.h"
#include "macro_xsb.h"
#include "error_xsb.h"
#include "io_builtins_xsb.h"
#include "inst_xsb.h"
#include "memory_xsb.h"
#include "register.h"
#include "varstring_xsb.h"
#include "thread_xsb.h"
#include "debug_xsb.h"

Data Structures

struct  hrec

Defines

#define st_ptrpsc(i_addr)   (cell(i_addr) = *reloc_table[cell(i_addr)])
#define st_pscname(i_addr)
#define gentry(opcode, arg1, arg2, ep)
#define gentabletry(opcode, arg1, arg2, arg3, ep)
#define reloc_addr(offset, base)
#define get_obj_data(x, y)   (fread((char *)(x), 1, (y), fd))
#define get_obj_byte(x)   (get_obj_data((x),1))
#define get_obj_word(x)   (get_obj_data((x),OBJ_WORD_SIZE))
#define get_obj_string(x, len)   (get_obj_data((x),(len)))
#define get_obj_word_bb(x)   {get_obj_word(x) ; fix_bb(x) ; }
#define get_obj_word_bbsig(x)
#define get_obj_word_bbsig_notag(x)
#define NUM_INDEX_BLKS   256
#define T_NEW   3
#define E_HIDDEN   -1
#define E_NOUSE   -2

Functions

TIFptrget_tip_or_tdisp (Psc)
void add_prog_seg (Psc, byte *, long)
void remove_prog_seg (byte *)
void delete_predicate_table (CTXTdeclc TIFptr)
static int hsize (int numentry)
void unload_seg (pseg s)
static void inserth (CPtr label, struct hrec *bucket)
Integer float_val_to_hash (Float Flt)
static int get_index_tab (FILE *fd, int clause_no)
static pindex new_index_seg (int no_cells)
static void gen_index (xsbBool tabled, int clause_no, CPtr sob_arg_p, byte arity)
static int load_text (FILE *fd, int seg_num, int text_bytes, int *current_tab)
static void load_index (FILE *fd, int index_bytes, int table_num)
static pseg load_seg (FILE *fd, int seg_num, int text_bytes, int index_bytes)
void env_type_set (Psc psc, byte t_env, byte t_type, xsbBool is_new)
unsigned int read_magic (FILE *fd)
static void get_obj_atom (FILE *fd, VarString *atom)
static xsbBool load_one_sym (FILE *fd, Psc cur_mod, int count, int exp)
static xsbBool load_syms (FILE *fd, int psc_count, int count, Psc cur_mod, int exp)
static byteloader1 (CTXTdeclc FILE *fd, int exp)
byteloader (CTXTdeclc char *file, int exp)

Variables

int xsb_profiling_enabled
Psc global_mod
tif_list tif_list = {NULL, NULL}
TDispBlkHdr_t tdispblkhdr = {NULL, NULL}
static pwreloc_table = NULL
static unsigned long reloc_table_size = 0
static pseg last_text = NULL
static pseg current_seg
static CPtrindex_reloc
static int num_index_reloc
static struct hrecindextab
static TIFptr tab_info_ptr
static CPtr hptr
static pindexindex_block_chain
static int env_check [4][5]
static int warned_old_obj = 0

Define Documentation

#define E_HIDDEN   -1
 

#define E_NOUSE   -2
 

#define gentabletry opcode,
arg1,
arg2,
arg3,
ep   ) 
 

Value:

{ \
        gentry(opcode, arg1, arg2, ep);                 \
        cell(ep) = (Cell) (arg3);                       \
        (ep)++; }

#define gentry opcode,
arg1,
arg2,
ep   ) 
 

Value:

{       \
        (cell_opcode(ep)) = (opcode);           \
        (cell_operand1(ep)) = 0;                \
        (cell_operand2(ep)) = 0;                \
        (cell_operand3(ep)) = (arg1);           \
        (ep)++;                                 \
        cell(ep) = (Cell) (arg2);               \
        (ep)++; }

#define get_obj_byte  )     (get_obj_data((x),1))
 

#define get_obj_data x,
 )     (fread((char *)(x), 1, (y), fd))
 

#define get_obj_string x,
len   )     (get_obj_data((x),(len)))
 

#define get_obj_word  )     (get_obj_data((x),OBJ_WORD_SIZE))
 

#define get_obj_word_bb  )     {get_obj_word(x) ; fix_bb(x) ; }
 

#define get_obj_word_bbsig  ) 
 

Value:

{get_obj_word(x) ; fix_bb4(x) ;\
                               *(Cell *)(x) = makeint(*(int *)(x));}

#define get_obj_word_bbsig_notag  ) 
 

Value:

{get_obj_word(x) ; fix_bb4(x) ; \
                               *(Integer *)(x) = *(int *)(x);}

#define NUM_INDEX_BLKS   256
 

#define reloc_addr offset,
base   ) 
 

Value:

((CPtr)((offset)<0 ? \
                (pb)&fail_inst : ((pb)(base))+(long)(offset)*ZOOM_FACTOR))

#define st_pscname i_addr   ) 
 

Value:

(cell(i_addr) = \
        (Cell) get_name((Psc)(*reloc_table[cell(i_addr)])))

#define st_ptrpsc i_addr   )     (cell(i_addr) = *reloc_table[cell(i_addr)])
 

#define T_NEW   3
 


Function Documentation

void add_prog_seg Psc  ,
byte ,
long 
 

void delete_predicate_table CTXTdeclc  TIFptr  ) 
 

void env_type_set Psc  psc,
byte  t_env,
byte  t_type,
xsbBool  is_new
 

Integer float_val_to_hash Float  Flt  ) 
 

static void gen_index xsbBool  tabled,
int  clause_no,
CPtr  sob_arg_p,
byte  arity
[static]
 

static int get_index_tab FILE *  fd,
int  clause_no
[static]
 

static void get_obj_atom FILE *  fd,
VarString atom
[inline, static]
 

TIFptr* get_tip_or_tdisp Psc   ) 
 

static int hsize int  numentry  )  [inline, static]
 

static void inserth CPtr  label,
struct hrec bucket
[inline, static]
 

static void load_index FILE *  fd,
int  index_bytes,
int  table_num
[static]
 

static xsbBool load_one_sym FILE *  fd,
Psc  cur_mod,
int  count,
int  exp
[static]
 

static pseg load_seg FILE *  fd,
int  seg_num,
int  text_bytes,
int  index_bytes
[static]
 

static xsbBool load_syms FILE *  fd,
int  psc_count,
int  count,
Psc  cur_mod,
int  exp
[static]
 

static int load_text FILE *  fd,
int  seg_num,
int  text_bytes,
int current_tab
[static]
 

byte* loader CTXTdeclc char *  file,
int  exp
 

static byte* loader1 CTXTdeclc FILE *  fd,
int  exp
[static]
 

static pindex new_index_seg int  no_cells  )  [inline, static]
 

unsigned int read_magic FILE *  fd  ) 
 

void remove_prog_seg byte  ) 
 

void unload_seg pseg  s  ) 
 


Variable Documentation

pseg current_seg [static]
 

int env_check[4][5] [static]
 

Initial value:

 {


 { T_VISIBLE, T_HIDDEN, T_VISIBLE,  E_NOUSE, T_VISIBLE  },
 { T_HIDDEN,  T_HIDDEN, E_HIDDEN,   E_NOUSE, T_VISIBLE  },
 { T_VISIBLE, E_HIDDEN, T_UNLOADED, E_NOUSE, T_UNLOADED },
 { T_VISIBLE, T_HIDDEN, T_UNLOADED, E_NOUSE, T_VISIBLE  }
}

Psc global_mod
 

CPtr hptr [static]
 

pindex* index_block_chain [static]
 

CPtr* index_reloc [static]
 

struct hrec* indextab [static]
 

pseg last_text = NULL [static]
 

int num_index_reloc [static]
 

pw* reloc_table = NULL [static]
 

unsigned long reloc_table_size = 0 [static]
 

TIFptr tab_info_ptr [static]
 

struct TDispBlkHdr_t tdispblkhdr = {NULL, NULL}
 

struct tif_list tif_list = {NULL, NULL}
 

int warned_old_obj = 0 [static]
 

int xsb_profiling_enabled
 


Generated on Wed Jul 26 13:26:54 2006 for XSB by  doxygen 1.4.5