From 3d38d1d1345aa65c4018b42e6c648606e32216f8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 11 Dec 2021 04:55:57 +0100 Subject: Add sqlite3 support to Emacs * configure.ac: Add check for the sqlite library. * doc/lispref/text.texi (Database): Document it. * lisp/sqlite.el: New file. * lisp/term/w32-win.el (dynamic-library-alist): Add a mapping. * src/Makefile.in (SQLITE3_LIBS): Add the libraries. * src/alloc.c (union emacs_align_type): Add a Lisp_Sqlite struct. * src/data.c (Ftype_of): Add sqlite. * src/emacs.c (main): Load the syms. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add PVEC_SQLITE. (GCALIGNED_STRUCT): New struct to keep data for sqlite database objects and statement objects. (SQLITEP, SQLITE, CHECK_SQLITE, XSQLITE): New macros for accessing the objects. * src/pdumper.c (dump_vectorlike): Update hash. (dump_vectorlike): Don't dump it. * src/print.c (print_vectorlike): Add a printer for the sqlite object. * src/sqlite.c: New file. * test/src/sqlite-tests.el: Add tests. --- src/print.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/print.c') diff --git a/src/print.c b/src/print.c index adadb289de0..214f1d12c11 100644 --- a/src/print.c +++ b/src/print.c @@ -1875,6 +1875,22 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, } break; #endif + case PVEC_SQLITE: + { + print_c_string ("#db); + strout (buf, i, i, printcharfun); + if (XSQLITE (obj)->is_statement) + { + i = sprintf (buf, " stmt=%p", XSQLITE (obj)->stmt); + strout (buf, i, i, printcharfun); + } + i = sprintf (buf, " name=%s", XSQLITE (obj)->name); + strout (buf, i, i, printcharfun); + printchar ('>', printcharfun); + } + break; + default: emacs_abort (); } -- cgit v1.2.1 From 4d1968b4c9eb1d42c125b4536e3b4543b91f3634 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 1 Jan 2022 08:54:51 +0800 Subject: Print dead xwidgets specially * src/print.c (print_vectorlike) : Print "killed xwidget" for dead xwidgets. --- src/print.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/print.c') diff --git a/src/print.c b/src/print.c index 214f1d12c11..9f3d8317ae3 100644 --- a/src/print.c +++ b/src/print.c @@ -1524,16 +1524,21 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag, case PVEC_XWIDGET: #ifdef HAVE_XWIDGETS { + if (NILP (XXWIDGET (obj)->buffer)) + print_c_string ("#", printcharfun); + else + { #ifdef USE_GTK - int len = sprintf (buf, "#", - XXWIDGET (obj)->xwidget_id, - XXWIDGET (obj)->widget_osr); + int len = sprintf (buf, "#", + XXWIDGET (obj)->xwidget_id, + XXWIDGET (obj)->widget_osr); #else - int len = sprintf (buf, "#", - XXWIDGET (obj)->xwidget_id, - XXWIDGET (obj)->xwWidget); + int len = sprintf (buf, "#", + XXWIDGET (obj)->xwidget_id, + XXWIDGET (obj)->xwWidget); #endif - strout (buf, len, len, printcharfun); + strout (buf, len, len, printcharfun); + } break; } #else -- cgit v1.2.1 From 19dcb237b5b02b36580294ab309124f346a66024 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Jan 2022 02:45:51 -0500 Subject: ; Add 2022 to copyright years. --- src/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/print.c') diff --git a/src/print.c b/src/print.c index 9f684bbeb53..3a26e5665e5 100644 --- a/src/print.c +++ b/src/print.c @@ -1,6 +1,6 @@ /* Lisp object printing and output streams. -Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2021 Free Software +Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2022 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1