comparison src/database.c @ 4351:bc3b9f61018e

Respect the CODESYS argument in #'open-database; don't autodetect EOL. 2007-12-22 Aidan Kehoe <kehoea@parhasard.net> * database.c (Fopen_database): Actually respect the CODESYS argument; don't require EOL autodetection from the coding system, because autodetection mostly fails with reads of small amounts of data. It might be possible with an implicit #'map-database on open, though I don't think that's a great idea. * database.c (print_database): Give the coding system used for text conversion when printing a database object.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 22 Dec 2007 15:02:04 +0100
parents 9a633a00c3f2
children 0e1461b592ce
comparison
equal deleted inserted replaced
4350:50889296c05c 4351:bc3b9f61018e
29 #include <config.h> 29 #include <config.h>
30 #include "lisp.h" 30 #include "lisp.h"
31 31
32 #include "sysfile.h" 32 #include "sysfile.h"
33 #include "buffer.h" 33 #include "buffer.h"
34 #include "file-coding.h"
34 35
35 #ifndef HAVE_DATABASE 36 #ifndef HAVE_DATABASE
36 #error HAVE_DATABASE not defined!! 37 #error HAVE_DATABASE not defined!!
37 #endif 38 #endif
38 39
179 180
180 write_fmt_string_lisp (printcharfun, "#<database \"%s\" (%s/%s/", 181 write_fmt_string_lisp (printcharfun, "#<database \"%s\" (%s/%s/",
181 3, db->fname, db->funcs->get_type (db), 182 3, db->fname, db->funcs->get_type (db),
182 db->funcs->get_subtype (db)); 183 db->funcs->get_subtype (db));
183 184
184 write_fmt_string (printcharfun, "%s) 0x%x>", 185 write_fmt_string (printcharfun, "%s) ",
185 (!DATABASE_LIVE_P (db) ? "closed" : 186 (!DATABASE_LIVE_P (db) ? "closed" :
186 (db->access_ & O_WRONLY) ? "writeonly" : 187 (db->access_ & O_WRONLY) ? "writeonly" :
187 (db->access_ & O_RDWR) ? "readwrite" : "readonly"), 188 (db->access_ & O_RDWR) ? "readwrite" : "readonly"));
188 db->header.uid); 189
190 write_fmt_string_lisp (printcharfun, "coding: %s ", 1,
191 XSYMBOL_NAME (XCODING_SYSTEM_NAME
192 (db->coding_system)));
193
194 write_fmt_string (printcharfun, "0x%x>", db->header.uid);
189 } 195 }
190 196
191 static void 197 static void
192 finalize_database (void *header, int for_disksave) 198 finalize_database (void *header, int for_disksave)
193 { 199 {
652 } 658 }
653 659
654 if (NILP (codesys)) 660 if (NILP (codesys))
655 codesys = Vdatabase_coding_system; 661 codesys = Vdatabase_coding_system;
656 662
657 codesys = get_coding_system_for_text_file (Vdatabase_coding_system, 1); 663 codesys = get_coding_system_for_text_file (codesys, 0);
658 664
659 #ifdef HAVE_DBM 665 #ifdef HAVE_DBM
660 if (NILP (type) || EQ (type, Qdbm)) 666 if (NILP (type) || EQ (type, Qdbm))
661 { 667 {
662 DBM *dbase = dbm_open (filename, accessmask, modemask); 668 DBM *dbase = dbm_open (filename, accessmask, modemask);