emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sqlite3 71d35506ec 07/62: minor adjustment to Makefile


From: ELPA Syncer
Subject: [nongnu] elpa/sqlite3 71d35506ec 07/62: minor adjustment to Makefile
Date: Tue, 14 Mar 2023 11:01:44 -0400 (EDT)

branch: elpa/sqlite3
commit 71d35506ec5c334ebdfcdeae906a2987959d5889
Author: Y. N. Lo <gordonynlo@yahoo.com>
Commit: Y. N. Lo <gordonynlo@yahoo.com>

    minor adjustment to Makefile
---
 Makefile             |  4 ++--
 sqlite3-api-module.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index d3c714837f..645be9cbf0 100644
--- a/Makefile
+++ b/Makefile
@@ -4,12 +4,12 @@ EMACS252=$(HOME)/test-emacs/bin/emacs
 EMACS251=$(HOME)/test-emacs-251/bin/emacs
 MODULE=sqlite3-api-module.so
 
-all: $(MODULE) misc
+all: $(MODULE)
 
 clean:
        rm -f *.so *.o
 
-misc:
+consts:
        (cd tools; ./run.sh)
 
 %.so: %.o
diff --git a/sqlite3-api-module.c b/sqlite3-api-module.c
index 15c3c54922..28ec06320d 100644
--- a/sqlite3-api-module.c
+++ b/sqlite3-api-module.c
@@ -820,6 +820,34 @@ static emacs_value sqlite3_api_last_insert_rowid(
   return env->make_integer(env, (intmax_t)sqlite3_last_insert_rowid(dbh));
 }
 
+
+#if 0
+/* sqlite version >= 3.18 only */
+static emacs_value sqlite3_api_set_last_insert_rowid(
+    emacs_env *env,
+    ptrdiff_t n,
+    emacs_value *args,
+    void *ptr) {
+  (void)ptr;
+  (void)n;
+
+  if (!env->is_not_nil(env, args[0])) {
+    WARN(env, "%s: database handle is nil", __func__);
+    return SYM(env, "nil");
+  }
+
+  sqlite3 *dbh = (sqlite3 *)env->get_user_ptr(env, args[0]);
+  NON_LOCAL_EXIT_CHECK(env);
+
+  sqlite3_int64 rowid = env->extract_integer(env, args[1]);
+  NON_LOCAL_EXIT_CHECK(env);
+
+  sqlite3_set_last_insert_rowid(dbh, rowid);
+
+  return SYM(env, "nil");
+}
+#endif
+
 static emacs_value sqlite3_api_set_log_level(
     emacs_env *env,
     ptrdiff_t n,
@@ -917,6 +945,11 @@ int emacs_module_init(struct emacs_runtime *ert) {
         "Reset a prepared SQL statement." },
       { "sqlite3-last-insert-rowid", 1, 1, sqlite3_api_last_insert_rowid,
         "Return last insert rowid." },
+#if 0
+      { "sqlite3-set-last-insert-rowid", 2, 2,
+        sqlite3_api_set_last_insert_rowid,
+        "Set last insert rowid." },
+#endif
       { "sqlite3-get-autocommit", 1, 1, sqlite3_api_get_autocommit,
         "Test for auto-commit mode." },
       { "sqlite3-exec", 2, 3, sqlite3_api_exec,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]