/home/dcp1990/prog/fakedbfs/include/fakedbfs/fakedbfs.h File Reference

Main header file. More...

#include <fakedbfs/types.h>
#include <fakedbfs/fdbfsconfig.h>
#include <sqlite3.h>
#include <fakedbfs/conf.h>
#include <fakedbfs/dbspecdata.h>
#include <fakedbfs/query.h>

Go to the source code of this file.

Classes

struct  PluginInfo
union  _ansdata
struct  _answer
struct  _actcat
struct  reg_functype
struct  _fdbfs
struct  _file_id
struct  _crawl
struct  DirState
struct  _crawlframe
struct  _dspdata

Defines

#define ERR(act, fmt,)   fdbfs_ferr(f, act, fmt, __VA_ARGS__)
#define SERR(act, fmt)   fdbfs_ferr(f, act, fmt)
#define CERR(act, fmt,)   fdbfs_cferr(f, act, fmt, __VA_ARGS__)
#define SCERR(act, fmt)   fdbfs_cferr(f, act, fmt)
#define _unused   __attribute__((__unused__))
#define MAJOR_API_VERSION   2
#define MINOR_API_VERSION   0
#define FAKEDBFSVER   "2.0.0"
#define VERNAME   "Doctor Wu"
#define FAKEDBFSMAJOR   2
#define FAKEDBFSMINOR   0
#define FAKEDBFSMICRO   0
#define RCSID(str)   static const char _cvsid[] __unused = str;
#define DELIMCHAR   "|"
#define FDBFSDIR   ".fdbfs"
#define FDBFSPLUGENV   "FDBFSPLUGPATH"
#define FIELDS_FLAG_MMAPED   0x1
#define FIELDS_FLAG_LASTDEF   0x2
#define DEBUGFUNC_STDERR   ((void(*)(char*, enum ErrorAction))0)
#define AFFPROTO
#define ASKFUNC_STD   ((answer_t*(*)AFFPROTO)0)
#define CRAWL_ERROR   0x0
#define CRAWL_FILE   0x1
#define CRAWL_DIR   0x2
#define CRAWL_FINISHED   0x3
#define CRAWL_DIE_ON_ERROR   0x1
#define allocz(x)   calloc(1, x)

Functions

void fdbfs_set_aff (fdbfs_t *f, answer_t *(*aff) AFFPROTO)
 Set askfieldfunction.
fdbfs_tfdbfs_new (const char *dbfile, char **error, void(*debugf)(char *, enum ErrorAction), int useplugins)
 Create a new instance of fakedbfs.
int fdbfs_destroy (fdbfs_t *f)
 Destroy a fdbfs instance.
int fdbfs_read_specs_from_db (fdbfs_t *f)
 Read dbspecs from DB.
char * fdbfs_normalise (const char *s)
 Normalise string.
size_t fdbfs_number_size (unsigned int n)
 Compute number of base10 digits for given unsigned integer.
size_t fdbfs_signed_size (int n)
 Compute number of base10 digits for given signed integer.
char * fdbfs_strdupq (const char *s)
 Duplicate string within quotes.
char * fdbfs_fstrdup (const char *str)
 Same thing as libc strdup().
int fdbfs_create_catalogue (fdbfs_t *f, const char *name, const char *alias, const char *cname)
 Create catalogue.
int fdbfs_cat_type_exists (fdbfs_t *f, const char *ct)
 Check if CFD exists.
actcat_tfdbfs_find_catalogue (fdbfs_t *f, const char *name)
 Finds catalogue.
crawl_tfdbfs_crawler_new (fdbfs_t *f, int mlevels, int mlbd)
void fdbfs_crawler_destroy (crawl_t *cr)
int fdbfs_crawl_dir (crawl_t *cr, const char *dir)

Variables

answer_t *fdbfs_askfunc_std AFFPROTO


Detailed Description

Main header file.


Define Documentation

#define _unused   __attribute__((__unused__))
 

#define AFFPROTO
 

Value:

(answer_t * /* buffer */, answer_t * /* default */, const char * /*fieldname*/, const char * /* unformatted name */, \
                        const char * /* filename */, enum DataType, struct EnumHead * /* if oenum */, struct EnumSubElem * /* if sub */)

#define allocz  )     calloc(1, x)
 

#define ASKFUNC_STD   ((answer_t*(*)AFFPROTO)0)
 

#define CERR act,
fmt   )     fdbfs_cferr(f, act, fmt, __VA_ARGS__)
 

#define CRAWL_DIE_ON_ERROR   0x1
 

#define CRAWL_DIR   0x2
 

#define CRAWL_ERROR   0x0
 

#define CRAWL_FILE   0x1
 

#define CRAWL_FINISHED   0x3
 

#define DEBUGFUNC_STDERR   ((void(*)(char*, enum ErrorAction))0)
 

#define DELIMCHAR   "|"
 

#define ERR act,
fmt   )     fdbfs_ferr(f, act, fmt, __VA_ARGS__)
 

#define FAKEDBFSMAJOR   2
 

#define FAKEDBFSMICRO   0
 

#define FAKEDBFSMINOR   0
 

#define FAKEDBFSVER   "2.0.0"
 

#define FDBFSDIR   ".fdbfs"
 

#define FDBFSPLUGENV   "FDBFSPLUGPATH"
 

#define FIELDS_FLAG_LASTDEF   0x2
 

#define FIELDS_FLAG_MMAPED   0x1
 

#define MAJOR_API_VERSION   2
 

#define MINOR_API_VERSION   0
 

#define RCSID str   )     static const char _cvsid[] __unused = str;
 

#define SCERR act,
fmt   )     fdbfs_cferr(f, act, fmt)
 

#define SERR act,
fmt   )     fdbfs_ferr(f, act, fmt)
 

#define VERNAME   "Doctor Wu"
 


Function Documentation

int fdbfs_cat_type_exists fdbfs_t f,
const char *  ct
 

Check if CFD exists.

Parameters:
f Instance of fakedbfs.
ct Name to look for.

int fdbfs_crawl_dir crawl_t cr,
const char *  dir
 

void fdbfs_crawler_destroy crawl_t cr  ) 
 

crawl_t* fdbfs_crawler_new fdbfs_t f,
int  mlevels,
int  mlbd
 

int fdbfs_create_catalogue fdbfs_t f,
const char *  name,
const char *  alias,
const char *  cname
 

Create catalogue.

Parameters:
f Fakedbfs instance.
name Name of new catalogue.
alias Alias of new catalogue.
cname Name of CFD for new catalogue.
Returns:
0 on error.

int fdbfs_destroy fdbfs_t f  ) 
 

Destroy a fdbfs instance.

fdbfs_destroy() destroys a previously-created instance of fakedbfs.

Parameters:
f The instance to destroy.
Returns:
Non-zero on success.

actcat_t* fdbfs_find_catalogue fdbfs_t f,
const char *  name
 

Finds catalogue.

Parameters:
f Instance of fakedbfs to search in.
name Name of catalogue to search for.
Returns:
NULL on not found or error.

char* fdbfs_fstrdup const char *  str  ) 
 

Same thing as libc strdup().

Parameters:
str String to duplicate.
Returns:
Malloc'd string, NULL on error.

fdbfs_t* fdbfs_new const char *  dbfile,
char **  error,
void(*)(char *, enum ErrorAction debugf,
int  useplugins
 

Create a new instance of fakedbfs.

fdbfs_new() creates a new instance of fakedbfs.

Parameters:
[in] dbfile The filename of the database.
[out] error On error, *error will be set. *error must be freed.
[in] debugf The function to use as the debug function.
[in] useplugins Whether to enable the plugin, configuration, and ficl subsystems.
Returns:
A new fdbfs object.

char* fdbfs_normalise const char *  s  ) 
 

Normalise string.

Parameters:
s String to normalise.
Returns:
Copy (from strdup()) of the string, normalised. Free when done.

size_t fdbfs_number_size unsigned int  n  ) 
 

Compute number of base10 digits for given unsigned integer.

Parameters:
n Number to examine.
Returns:
Number of digits.

int fdbfs_read_specs_from_db fdbfs_t f  ) 
 

Read dbspecs from DB.

fdbfs_read_specs_from_db() reads all the dbspecs from the database and stores them in the instance of fakedbfs specified.

Parameters:
f The instance of fakedbfs on which to operate.
Returns:
Non-zero on success, zero on error.

void fdbfs_set_aff fdbfs_t f,
answer_t **aff  AFFPROTO
 

Set askfieldfunction.

fdbfs_set_aff() sets the askfieldfunction used in indexing.

Parameters:
f The instance of fakedbfs on which to operate.
AFFPROTO The new askfieldfunc.

size_t fdbfs_signed_size int  n  ) 
 

Compute number of base10 digits for given signed integer.

Parameters:
n Number to examine.
Returns:
Number of digits.

char* fdbfs_strdupq const char *  s  ) 
 

Duplicate string within quotes.

Returns a malloc()'d string containing whatever was inside the quotes of the operand.

Parameters:
s String to copy from.
Returns:
Malloc'd string, NULL on error.


Variable Documentation

answer_t* fdbfs_askfunc_std AFFPROTO
 


Generated on Wed Apr 19 16:26:23 2006 for fakedbfs by  doxygen 1.4.6