File: databases.texi

package info (click to toggle)
xemacs20 20.4-13
  • links: PTS
  • area: main
  • in suites: slink
  • size: 67,324 kB
  • ctags: 57,643
  • sloc: lisp: 586,197; ansic: 184,662; sh: 4,296; asm: 3,179; makefile: 2,021; perl: 1,059; csh: 96; sed: 22
file content (92 lines) | stat: -rw-r--r-- 2,863 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@c -*-texinfo-*-
@c This is part of the XEmacs Lisp Reference Manual.
@c Copyright (C) 1996 Ben Wing.
@c See the file lispref.texi for copying conditions.
@setfilename ../../info/databases.info
@node Databases, Processes, Range Tables, top
@chapter Databases
@cindex database

@defun databasep object
This function returns non-@code{nil} if @var{object} is a database.
@end defun

@menu
* Connecting to a Database::
* Working With a Database::
* Other Database Functions::
@end menu

@node Connecting to a Database
@section Connecting to a Database

@defun open-database file &optional type subtype access mode
This function opens database @var{file}, using database method
@var{type} and @var{subtype}, with access rights @var{access} and
permissions @var{mode}.  @var{access} can be any combination of @code{r}
@code{w} and @code{+}, for read, write, and creation flags.

@var{type} can have the value @code{'dbm} or @code{'berkeley_db} to
select the type of database file to use.  (Note:  XEmacs may not
support both of these types.)

For a @var{type} of @code{'dbm}, there are no subtypes, so
@var{subtype} should by @code{nil}.

For a @var{type} of @code{'berkeley_db}, the following subtypes are
available:  @code{'hash}, @code{'btree}, and @code{'recno}.  See the
manpages for the Berkeley DB functions to more information about these 
types.
@end defun

@defun close-database obj
This function closes database @var{obj}.
@end defun

@defun database-live-p obj
This function returns @code{t} iff @var{obj} is an active database, else
@code{nil}.
@end defun

@node Working With a Database
@section Working With a Database

@defun get-database key dbase &optional default
This function finds the value for @var{key} in @var{database}.  If there is no
corresponding value, @var{default} is returned (@code{nil} if @var{default} is
omitted).
@end defun

@defun map-database function dbase
This function maps @var{function} over entries in @var{database},
calling it with two args, each key and value in the database.
@end defun

@defun put-database key val dbase &optional replace
This function stores @var{key} and @var{val} in @var{database}.  If
optional fourth arg @var{replace} is non-@code{nil}, replace any
existing entry in the database.
@end defun

@defun remove-database key dbase
This function removes @var{key} from @var{database}.
@end defun

@node Other Database Functions
@section Other Database Functions

@defun database-file-name obj
This function returns the filename associated with the database @var{obj}.
@end defun

@defun database-last-error &optional obj
This function returns the last error associated with database @var{obj}.
@end defun

@defun database-subtype obj
This function returns the subtype of database @var{obj}, if any.
@end defun

@defun database-type obj
This function returns the type of database @var{obj}.
@end defun