00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef PLANG_DATABASE_PRIV_H
00021 #define PLANG_DATABASE_PRIV_H
00022 
00023 #include <plang/database.h>
00024 #include "term-priv.h"
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00032 
00033 typedef struct p_class_info p_class_info;
00034 struct p_class_info
00035 {
00036     p_term *class_object;
00037     p_class_info *parent;
00038     p_term *var_list;
00039 };
00040 
00041 
00042 
00043 struct p_database_info
00044 {
00045     p_database_info *next;
00046     unsigned int arity;
00047     unsigned int flags : 8;
00048     unsigned int op_specifier : 8;
00049     unsigned int op_priority : 16;
00050     p_db_builtin builtin_func;
00051     p_db_arith arith_func;
00052     p_class_info *class_info;
00053     p_term *predicate;
00054 };
00055 
00056 struct p_builtin
00057 {
00058     const char *name;
00059     int arity;
00060     p_db_builtin func;
00061 };
00062 
00063 struct p_arith
00064 {
00065     const char *name;
00066     int arity;
00067     p_db_arith arith_func;
00068 };
00069 
00070 void _p_db_register_builtins(p_context *context, const struct p_builtin *builtins);
00071 void _p_db_register_ariths(p_context *context, const struct p_arith *ariths);
00072 void _p_db_register_sources(p_context *context, const char * const *sources);
00073 
00074 void _p_db_init(p_context *context);
00075 void _p_db_init_builtins(p_context *context);
00076 void _p_db_init_arith(p_context *context);
00077 void _p_db_init_io(p_context *context);
00078 void _p_db_init_fuzzy(p_context *context);
00079 void _p_db_init_sort(p_context *context);
00080 
00081 p_database_info *_p_db_find_arity(const p_term *atom, unsigned int arity);
00082 p_database_info *_p_db_create_arity(p_term *atom, unsigned int arity);
00083 
00084 p_term *_p_db_clause_assert_last(p_context *context, p_term *clause);
00085 
00088 #ifdef __cplusplus
00089 };
00090 #endif
00091 
00092 #endif