GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AFOPEN(3) Amberfish AFOPEN(3)

afopen - open a database

#include af.h

int afopen(const Afopen *r, Afopen_r *rr);

The 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:

Open database for reading. This opens the database files for searching or other read-only access.

Open database for reading and writing. This is commonly used to add to or modify an existing database.

Open database for reading and writing; the database is created if it does not exist, and otherwise its contents are erased.

This 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.

In addition to the set of "core" errors, this function can return:

The database is locked.

Too many open databases.

The database was created with an earlier, incompatible version of this library.

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.