[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)
- [nongnu] branch elpa/sqlite3 created (now 50b814063b), ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 04fc60e2cf 01/62: Initial commit, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 48c913559f 03/62: -std=c99 to Makefile, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 94f0c69538 06/62: improved doc, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 ce41ac18bc 02/62: first commit, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 8ad45baacf 05/62: fixed memory leak; used sqlite3_close_v2, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 ed7ea9c919 18/62: removed sqlite3-api-constants.el from repo, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 0bae137c63 26/62: LIB and INC added to Makefile, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 9e6dbe5d37 15/62: fixed typo, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 0131cc617d 19/62: python3 -> python, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 7abb3c6f70 28/62: fixed callback example; added Homebrew linkage,
ELPA Syncer <=
- [nongnu] elpa/sqlite3 71d35506ec 07/62: minor adjustment to Makefile, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 a2d5e39133 43/62: Removed unused codes from consts.c, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 b72c2c40d9 44/62: Better handling of SQLite codes in consts.c, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 a51467b031 04/62: added test for Emacs 25.1, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 1f1f7ab2db 09/62: added package creation section, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 1b7b1fc03f 10/62: fixed module installation bug, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 a69ff5a456 11/62: github installation function added, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 47391311a9 12/62: edited sqlite3-api.el to adhere to melpa guidelines, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 723787e6d9 21/62: added 'make install', ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 77e719fb88 24/62: better comments, ELPA Syncer, 2023/03/14