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

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

[nongnu] elpa/sqlite3 7abb3c6f70 28/62: fixed callback example; added Ho


From: ELPA Syncer
Subject: [nongnu] elpa/sqlite3 7abb3c6f70 28/62: fixed callback example; added Homebrew linkage
Date: Tue, 14 Mar 2023 11:01:46 -0400 (EDT)

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

    fixed callback example; added Homebrew linkage
---
 Makefile     | 21 ++++++++++-----------
 README-in.md | 12 +++++++++---
 README.md    | 12 +++++++++---
 3 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index c32f088469..3361fa8156 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,18 @@
 CC = gcc
 INC=-I.
 LIB=-lsqlite3
+
+ifeq ($(HOMEBREW), 1)
+ INC=-I/usr/local/opt/sqlite3/include
+ LIB=-L/usr/local/opt/sqlite3/lib -lsqlite3
+endif
+
 CFLAGS=-g3 -Wall -std=c99 $(INC)
 
 EMACS252=$(HOME)/test-emacs/bin/emacs
 EMACS251=$(HOME)/test-emacs-251/bin/emacs
 EMACS253=$(HOME)/test-emacs-253/bin/emacs
 
-SQLITE3_H=$(shell tools/find-sqlite3-h.sh $(INC))
-
 # Melpa package
 PKG=sqlite3-api
 
@@ -35,23 +39,18 @@ module: $(MODULE).so
 install: module
        emacsclient -e '(package-install-file "$(MODULE_TAR)")'
 
-#consts.c: $(SQLITE_H)
-#      grep "^#define SQLITE" $(SQLITE3_H) | tools/gen-consts.py > $@
-
 %.so: %.o
        $(CC) -shared -o $@ $< $(LIB)
 
 %.o: %.c
        $(CC) $(CFLAGS) -fPIC -c $<
 
-# Emacs 25.2
+# Emacs 25.3
 test:
+       $(EMACS253) -batch -Q -L . -l tests/regression.el
+
+t252:
        $(EMACS252) -batch -Q -L . -l tests/regression.el
 
-# Emacs 25.1
 t251:
        $(EMACS251) -batch -Q -L . -l tests/regression.el
-
-# Emacs 25.1
-t253:
-       $(EMACS253) -batch -Q -L . -l tests/regression.el
diff --git a/README-in.md b/README-in.md
index 40c6af38cb..6c17b7275e 100644
--- a/README-in.md
+++ b/README-in.md
@@ -52,6 +52,12 @@ $ make module
 A tar archive called `sqlite3-api-X.Y.tar` will be created. Do a `M-x 
package-install-file` in Emacs to install that tar archive and 
 you'll all set.
 -->
+For Mac users:
+~~~sh
+$ make HOMEBREW=1
+~~~
+to build the module against sqlite3 installed by homebrew.
+
 If you have sqlite3 installed in a nonstandard location, you can do
 ~~~sh
 $ make INC=/path/to/sqlite3/include LIB="-L/path/to/sqlite3/lib -lsqlite3"
@@ -168,9 +174,9 @@ An example of a callback:
 ~~~el
 (defun print-row (ncols data names)
   (cl-loop for i from 0 to (1- ncols) do
-           (message "[%d]%s->%s" elt (ncols names i) (elt data i))
-           (message "--------------------"))
-  t) ;; t means everything's OK
+           (message "[Column %d/%d]%s=%s" (1+ i) ncols (elt names i) (elt data 
i)))
+  (message "--------------------")
+  t)
   
 (sqlite3-exec dbh "select * from table_a; select * from table b"
               #'print-row)
diff --git a/README.md b/README.md
index 1fd2a8f298..92ccd577c0 100644
--- a/README.md
+++ b/README.md
@@ -77,6 +77,12 @@ $ make module
 A tar archive called `sqlite3-api-X.Y.tar` will be created. Do a `M-x 
package-install-file` in Emacs to install that tar archive and 
 you'll all set.
 -->
+For Mac users:
+~~~sh
+$ make HOMEBREW=1
+~~~
+to build the module against sqlite3 installed by homebrew.
+
 If you have sqlite3 installed in a nonstandard location, you can do
 ~~~sh
 $ make INC=/path/to/sqlite3/include LIB="-L/path/to/sqlite3/lib -lsqlite3"
@@ -193,9 +199,9 @@ An example of a callback:
 ~~~el
 (defun print-row (ncols data names)
   (cl-loop for i from 0 to (1- ncols) do
-           (message "[%d]%s->%s" elt (ncols names i) (elt data i))
-           (message "--------------------"))
-  t) ;; t means everything's OK
+           (message "[Column %d/%d]%s=%s" (1+ i) ncols (elt names i) (elt data 
i)))
+  (message "--------------------")
+  t)
   
 (sqlite3-exec dbh "select * from table_a; select * from table b"
               #'print-row)



reply via email to

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