libdb.c File Reference

Contains the C version of the Prolog database. More...

#include <stdio.h>
#include "libdb.h"
#include "libicl_private.h"

Go to the source code of this file.

Defines

#define EXPORT_BORLAND
#define EXPORT_MSCPP
#define DB_MAGIC_COOKIE   123456

Functions

int OAA_hash_function (char *str)
 Hash function: simple sum of characters modulo hash table size.
int db_IsValid (ICLDatabase *db)
 Returns TRUE if Database has been properly initialized.
EXPORT_MSCPP ICLDatabase
*EXPORT_BORLAND 
db_NewDB ()
 Returns a pointer to a new database structure.
EXPORT_MSCPP int EXPORT_BORLAND db_FreeDB (ICLDatabase *db)
 Frees all space used by a database.
EXPORT_MSCPP int EXPORT_BORLAND db_Assert (ICLDatabase *db, ICLTerm *term, ICLTerm *params)
 Adds a copy of an ICL term to the database.
EXPORT_MSCPP int EXPORT_BORLAND db_Retract (ICLDatabase *db, ICLTerm *term, ICLTerm *params)
 Removes an ICL term from the database.
EXPORT_MSCPP int EXPORT_BORLAND db_Solve (ICLDatabase *db, ICLTerm *term, ICLTerm *params, ICLTerm **answers)
 Searches the database for matches to term.
EXPORT_MSCPP int EXPORT_BORLAND db_PrintDB (ICLDatabase *db)
 Writes out the entire database.


Detailed Description

Contains the C version of the Prolog database.

Definition in file libdb.c.


Define Documentation

#define DB_MAGIC_COOKIE   123456

Definition at line 43 of file libdb.c.

#define EXPORT_BORLAND

Definition at line 27 of file libdb.c.

#define EXPORT_MSCPP

Definition at line 32 of file libdb.c.


Function Documentation

EXPORT_MSCPP int EXPORT_BORLAND db_Assert ( ICLDatabase db,
ICLTerm term,
ICLTerm params 
)

Adds a copy of an ICL term to the database.

Parameters may include "at_beginning" (boolean parameter).

Returns:
TRUE if success

Definition at line 143 of file libdb.c.

EXPORT_MSCPP int EXPORT_BORLAND db_FreeDB ( ICLDatabase db  ) 

Frees all space used by a database.

Returns:
TRUE if success

Definition at line 112 of file libdb.c.

int db_IsValid ( ICLDatabase db  ) 

Returns TRUE if Database has been properly initialized.

Definition at line 74 of file libdb.c.

EXPORT_MSCPP ICLDatabase* EXPORT_BORLAND db_NewDB (  ) 

Returns a pointer to a new database structure.

Definition at line 93 of file libdb.c.

EXPORT_MSCPP int EXPORT_BORLAND db_PrintDB ( ICLDatabase db  ) 

Writes out the entire database.

Returns:
TRUE if success

Definition at line 292 of file libdb.c.

EXPORT_MSCPP int EXPORT_BORLAND db_Retract ( ICLDatabase db,
ICLTerm term,
ICLTerm params 
)

Removes an ICL term from the database.

Parameters may include "do_all" (boolean parameter).

Returns:
TRUE if success

Definition at line 184 of file libdb.c.

EXPORT_MSCPP int EXPORT_BORLAND db_Solve ( ICLDatabase db,
ICLTerm term,
ICLTerm params,
ICLTerm **  answers 
)

Searches the database for matches to term.

Parameters may include "solution_limit" (integer parameter).

Returns:
TRUE if success

Definition at line 234 of file libdb.c.

int OAA_hash_function ( char *  str  ) 

Hash function: simple sum of characters modulo hash table size.

Definition at line 57 of file libdb.c.


Generated on Wed May 23 17:20:14 2007 using doxygen 1.5.2