annotate man/lispref/databases.texi @ 408:501cfd01ee6d r21-2-34

Import from CVS: tag r21-2-34
author cvs
date Mon, 13 Aug 2007 11:18:11 +0200
parents cc15677e0335
children 697ef44129c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @c Copyright (C) 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @setfilename ../../info/databases.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @node Databases, Processes, Range Tables, top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @chapter Databases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @cindex database
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 @defun databasep object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 This function returns non-@code{nil} if @var{object} is a database.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 * Connecting to a Database::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 * Working With a Database::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 * Other Database Functions::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 @node Connecting to a Database
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @section Connecting to a Database
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 @defun open-database file &optional type subtype access mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 This function opens database @var{file}, using database method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @var{type} and @var{subtype}, with access rights @var{access} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 permissions @var{mode}. @var{access} can be any combination of @code{r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 @code{w} and @code{+}, for read, write, and creation flags.
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
28
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 367
diff changeset
29 @var{type} can have the value @code{'dbm} or @code{'berkeley_db} to
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
30 select the type of database file to use. (Note: XEmacs may not
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
31 support both of these types.)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
32
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
33 For a @var{type} of @code{'dbm}, there are no subtypes, so
408
501cfd01ee6d Import from CVS: tag r21-2-34
cvs
parents: 371
diff changeset
34 @var{subtype} should be @code{nil}.
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
35
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 367
diff changeset
36 For a @var{type} of @code{'berkeley_db}, the following subtypes are
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
37 available: @code{'hash}, @code{'btree}, and @code{'recno}. See the
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 367
diff changeset
38 manpages for the Berkeley DB functions to more information about these
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents: 0
diff changeset
39 types.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @defun close-database obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 This function closes database @var{obj}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @defun database-live-p obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 This function returns @code{t} iff @var{obj} is an active database, else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @code{nil}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @node Working With a Database
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 @section Working With a Database
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @defun get-database key dbase &optional default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 This function finds the value for @var{key} in @var{database}. If there is no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 corresponding value, @var{default} is returned (@code{nil} if @var{default} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 omitted).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 @defun map-database function dbase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 This function maps @var{function} over entries in @var{database},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 calling it with two args, each key and value in the database.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @defun put-database key val dbase &optional replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 This function stores @var{key} and @var{val} in @var{database}. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 optional fourth arg @var{replace} is non-@code{nil}, replace any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 existing entry in the database.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 @defun remove-database key dbase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 This function removes @var{key} from @var{database}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 @node Other Database Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 @section Other Database Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 @defun database-file-name obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 This function returns the filename associated with the database @var{obj}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 @defun database-last-error &optional obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 This function returns the last error associated with database @var{obj}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @defun database-subtype obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 This function returns the subtype of database @var{obj}, if any.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 @end defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 @defun database-type obj
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 This function returns the type of database @var{obj}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @end defun