comparison src/database.c @ 203:850242ba4a81 r20-3b28

Import from CVS: tag r20-3b28
author cvs
date Mon, 13 Aug 2007 10:02:21 +0200
parents b405438285a2
children e45d5e7c476e
comparison
equal deleted inserted replaced
202:61eefc8fc970 203:850242ba4a81
192 ("Can't dump an emacs containing window system objects", obj); 192 ("Can't dump an emacs containing window system objects", obj);
193 } 193 }
194 db->funcs->close (db); 194 db->funcs->close (db);
195 } 195 }
196 196
197 DEFUN ("close-database", Fdatabase_close, 1, 1, 0, /* 197 DEFUN ("close-database", Fclose_database, 1, 1, 0, /*
198 Close database OBJ. 198 Close database OBJ.
199 */ 199 */
200 (obj)) 200 (obj))
201 { 201 {
202 CHECK_LIVE_DATABASE (obj); 202 CHECK_LIVE_DATABASE (obj);
490 berkdb_close, 490 berkdb_close,
491 berkdb_lasterr 491 berkdb_lasterr
492 }; 492 };
493 #endif /* HAVE_BERKELEY_DB */ 493 #endif /* HAVE_BERKELEY_DB */
494 494
495 DEFUN ("database-last-error", Fdatabase_error, 0, 1, 0, /* 495 DEFUN ("database-last-error", Fdatabase_last_error, 0, 1, 0, /*
496 Return the last error associated with database OBJ. 496 Return the last error associated with database OBJ.
497 */ 497 */
498 (obj)) 498 (obj))
499 { 499 {
500 if (NILP (obj)) 500 if (NILP (obj))
503 CHECK_DATABASE (obj); 503 CHECK_DATABASE (obj);
504 504
505 return XDATABASE (obj)->funcs->last_error (XDATABASE (obj)); 505 return XDATABASE (obj)->funcs->last_error (XDATABASE (obj));
506 } 506 }
507 507
508 DEFUN ("open-database", Fmake_database, 1, 5, 0, /* 508 DEFUN ("open-database", Fopen_database, 1, 5, 0, /*
509 Open database FILE, using database method TYPE and SUBTYPE, with 509 Open database FILE, using database method TYPE and SUBTYPE, with
510 access rights ACCESS and permissions MODE. ACCESS can be any 510 access rights ACCESS and permissions MODE. ACCESS can be any
511 combination of 'r' 'w' and '+', for read, write, and creation flags. 511 combination of 'r' 'w' and '+', for read, write, and creation flags.
512 */ 512 */
513 (file, type, subtype, access_, mode)) 513 (file, type, subtype, access_, mode))
610 XSETDATABASE (retval, dbase); 610 XSETDATABASE (retval, dbase);
611 611
612 return retval; 612 return retval;
613 } 613 }
614 614
615 DEFUN ("put-database", Fputdatabase, 3, 4, 0, /* 615 DEFUN ("put-database", Fput_database, 3, 4, 0, /*
616 Store KEY and VAL in DATABASE. If optional fourth arg REPLACE is 616 Store KEY and VAL in DATABASE. If optional fourth arg REPLACE is
617 non-nil, replace any existing entry in the database. 617 non-nil, replace any existing entry in the database.
618 */ 618 */
619 (key, val, dbase, replace)) 619 (key, val, dbase, replace))
620 { 620 {
627 XDATABASE (dbase)->funcs->put (XDATABASE (dbase), key, val, replace); 627 XDATABASE (dbase)->funcs->put (XDATABASE (dbase), key, val, replace);
628 return status ? Qt : Qnil; 628 return status ? Qt : Qnil;
629 } 629 }
630 } 630 }
631 631
632 DEFUN ("remove-database", Fremdatabase, 2, 2, 0, /* 632 DEFUN ("remove-database", Fremove_database, 2, 2, 0, /*
633 Remove KEY from DATABASE. 633 Remove KEY from DATABASE.
634 */ 634 */
635 (key, dbase)) 635 (key, dbase))
636 { 636 {
637 CHECK_LIVE_DATABASE (dbase); 637 CHECK_LIVE_DATABASE (dbase);
638 CHECK_STRING (key); 638 CHECK_STRING (key);
639 639
640 return XDATABASE (dbase)->funcs->rem (XDATABASE (dbase), key) ? Qt : Qnil; 640 return XDATABASE (dbase)->funcs->rem (XDATABASE (dbase), key) ? Qt : Qnil;
641 } 641 }
642 642
643 DEFUN ("get-database", Fgetdatabase, 2, 3, 0, /* 643 DEFUN ("get-database", Fget_database, 2, 3, 0, /*
644 Find value for KEY in DATABASE. 644 Find value for KEY in DATABASE.
645 If there is no corresponding value, return DEFAULT (defaults to nil). 645 If there is no corresponding value, return DEFAULT (defaults to nil).
646 */ 646 */
647 (key, dbase, default_)) 647 (key, dbase, default_))
648 { 648 {
682 defsymbol (&Qhash, "hash"); 682 defsymbol (&Qhash, "hash");
683 defsymbol (&Qbtree, "btree"); 683 defsymbol (&Qbtree, "btree");
684 defsymbol (&Qrecno, "recno"); 684 defsymbol (&Qrecno, "recno");
685 #endif 685 #endif
686 686
687 DEFSUBR (Fmake_database); 687 DEFSUBR (Fopen_database);
688 DEFSUBR (Fdatabasep); 688 DEFSUBR (Fdatabasep);
689 DEFSUBR (Fmapdatabase); 689 DEFSUBR (Fmapdatabase);
690 DEFSUBR (Fputdatabase); 690 DEFSUBR (Fput_database);
691 DEFSUBR (Fgetdatabase); 691 DEFSUBR (Fget_database);
692 DEFSUBR (Fremdatabase); 692 DEFSUBR (Fremove_database);
693 DEFSUBR (Fdatabase_type); 693 DEFSUBR (Fdatabase_type);
694 DEFSUBR (Fdatabase_subtype); 694 DEFSUBR (Fdatabase_subtype);
695 DEFSUBR (Fdatabase_error); 695 DEFSUBR (Fdatabase_last_error);
696 DEFSUBR (Fdatabase_live_p); 696 DEFSUBR (Fdatabase_live_p);
697 DEFSUBR (Fdatabase_file_name); 697 DEFSUBR (Fdatabase_file_name);
698 DEFSUBR (Fdatabase_close); 698 DEFSUBR (Fclose_database);
699 } 699 }
700 700
701 void 701 void
702 vars_of_dbm (void) 702 vars_of_dbm (void)
703 { 703 {