BOOTSTRAP (klibdb) functions


LIBRARY ROUTINE

kdbm_open - Open the dbm file and initialize data structures for use.

LIBRARY CALL

kdbm *kdbm_open(
     char *filename,
     int  flags,
     int  mode)

INPUT

OUTPUT

none

RETURN VALUE

a pointer to a open database structure

DESCRIPTION

Initialize dbm system. FILE is a pointer to the file name. If the file has a size of zero bytes, a file initialization procedure is performed, setting up the initial structure in the file.

If "flags" is set to KOPEN_RDONLY the user wants to just read the database and any call to dbm_store or dbm_delete will fail. Many readers can access the database at the same time. If "flags" is set to KOPEN_WRONLY, the user wants both read and write access to the database and requires exclusive access. If "flags" is KOPEN_WRONLY|KOPEN_CREAT, the user wants both read and write access to the database and if the database does not exist, create a new one. If "flags" is KOPEN_WRONLY|KOPEN_CREAT|KOPEN_TRUNC, the user want a new database created, regardless of whether one existed, and wants read and write access to the new database. Any error detected will cause a return value of null and an approprate value will be in errno. If no errors occur, a pointer to the "kdbm file descriptor" will be returned.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/klibdb/src/kdbm.c

SEE ALSO

klibdb(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.