|
NAMEafopen - open a database SYNOPSIS#include af.h int afopen(const Afopen *r, Afopen_r *rr); DESCRIPTIONThe afopen function opens a database so that it can be accessed for searching, updating, etc. The argument r specifies a set of options defined by the following structure: typedef struct {
char *dbpath;
char *mode;
int phrase;
int stem;
} Afopen;
The dbpath option specifies the database to be opened, consisting of a path name. The file names that make up the database are constructed by appending suffixes to this path name. The mode option specifies how the database will be accessed:
RETURN VALUEThis function returns 0 if it exited normally. If an error occurred, it returns -1 and aferrno is set. If the function exited normally, the structure pointed to by rr is filled in with the following values: typedef struct {
Uint2 dbid;
} Afopen_r;
The dbid value is a database descriptor that can be used to refer to the database while it remains open. ERRORSIn addition to the set of "core" errors, this function can return:
|