[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sqlite3 77e719fb88 24/62: better comments
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sqlite3 77e719fb88 24/62: better comments |
Date: |
Tue, 14 Mar 2023 11:01:46 -0400 (EDT) |
branch: elpa/sqlite3
commit 77e719fb8850e55bda3068a713d99d8a4547379c
Author: Y. N. Lo <gordonynlo@yahoo.com>
Commit: Y. N. Lo <gordonynlo@yahoo.com>
better comments
---
README-in.md | 4 +++-
sqlite3-api.c | 16 +++++++++-------
tools/find-sqlite3-h.sh | 1 +
tools/gen-consts.py | 7 ++++---
4 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/README-in.md b/README-in.md
index fcca28c6ca..ffbf18cd9d 100644
--- a/README-in.md
+++ b/README-in.md
@@ -51,7 +51,7 @@ A tar archive called `sqlite3-api-X.Y.tar` will be created.
Do a `M-x package-in
you'll all set.
-->
Currently there's no way to reload a dynamic module in Emacs
-(`unload-feature` doesn't seem to work for dynamic module.)
+(`unload-feature` doesn't seem to work for dynamic modules.)
If you are updating from an older version, you'll need to restart Emacs
for the new module to take effect.
@@ -287,6 +287,8 @@ For integers > 61 bits you can retrieve them as text as a
workaround.
The code is licensed under the [GNU GPL
v3](https://www.gnu.org/licenses/gpl-3.0.html).
## Changelog
+*2017-09-04*
+- Emacs Lisp code removed. The package is now pure C.
*2017-08-29*
- Fixed a memory leak in `sql_api_exec()`
- Changed `sqlite3_close()` to `sqlite3_close_v2()` in `sqlite_api_close()`
diff --git a/sqlite3-api.c b/sqlite3-api.c
index 84d27319fd..27718e143a 100644
--- a/sqlite3-api.c
+++ b/sqlite3-api.c
@@ -120,7 +120,8 @@ static void message(emacs_env *env, int log_level, const
char *fmt, ...) {
fprintf(stderr, "\n");
}
-/* Equivalent to (signal symbol '(msg code)) in elisp */
+/* Signal an error condition.
+ Equivalent to (signal symbol '(msg code)) in elisp */
void signal_error(
emacs_env *env,
const char *symbol,
@@ -925,8 +926,11 @@ static void define_error(
env->funcall(env, SYM(env, "define-error"), 2, argv);
}
-/* Since defconst is a special form, we need to do:
- (eval (list '(defconst sym val)))
+/* Since defconst is a special form, args are NOT evaluated. Hence
+ eval is needed:
+
+ (eval (list '(defconst sym val)) t)
+
Reference: https://phst.github.io/emacs-modules#funcall
*/
static void defconst(emacs_env *env, const char *sym, emacs_value val) {
@@ -938,9 +942,6 @@ static void defconst(emacs_env *env, const char *sym,
emacs_value val) {
emacs_value form = make_list(env, 3, list_argv);
emacs_value eval_argv[] = { form, SYM(env, "t") };
env->funcall(env, SYM(env, "eval"), 2, eval_argv);
- /* if (env->non_local_exit_check (env) == emacs_funcall_exit_return) { */
- /* fprintf(stderr, "SCREWED: %s\n", sym); */
- /* } */
}
int emacs_module_init(struct emacs_runtime *ert) {
@@ -1030,7 +1031,8 @@ int emacs_module_init(struct emacs_runtime *ert) {
}
sqlite3_api_log_level = SQLITE3_LOG_LEVEL_ERROR;
-
+ /* consts.c includes all the (defconst sqlite-xxx ....) function
+ calls which is generated by tools/gen-consts.py */
#include "consts.c"
define_error(env, "db-error", "Database Error");
diff --git a/tools/find-sqlite3-h.sh b/tools/find-sqlite3-h.sh
index 082a454f95..ff13bbc6ff 100755
--- a/tools/find-sqlite3-h.sh
+++ b/tools/find-sqlite3-h.sh
@@ -1,2 +1,3 @@
#!/bin/bash
+# locate the path of sqlite3.h
echo '#include <sqlite3.h>' | gcc -x c -H -fsyntax-only - 2>&1 | grep '^\. ' |
cut -f2 -d' '
diff --git a/tools/gen-consts.py b/tools/gen-consts.py
index 0a80786cc8..863b0a6e9d 100755
--- a/tools/gen-consts.py
+++ b/tools/gen-consts.py
@@ -6,10 +6,11 @@ import re
for line in sys.stdin.readlines():
line.rstrip()
+ # fields = [ "#define", "SQLITE_XXXX" "YYYY" ];
fields = re.split("\s+", line, 3)
- name = re.sub("_", "-", fields[1].lower())
+ sym = re.sub("_", "-", fields[1].lower())
if len(fields) > 2 and fields[2] != "":
if fields[2].startswith('"'):
- print('defconst(env, "{0}", env->make_string(env, {1},
strlen({1})));'.format(name, fields[1]))
+ print('defconst(env, "{0}", env->make_string(env, {1},
strlen({1})));'.format(sym, fields[1]))
else:
- print('defconst(env, "{0}", env->make_integer(env, {1}));'.format(name,
fields[1]))
+ print('defconst(env, "{0}", env->make_integer(env, {1}));'.format(sym,
fields[1]))
- [nongnu] elpa/sqlite3 7abb3c6f70 28/62: fixed callback example; added Homebrew linkage, (continued)
- [nongnu] elpa/sqlite3 7abb3c6f70 28/62: fixed callback example; added Homebrew linkage, ELPA Syncer, 2023/03/14
- [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 <=
- [nongnu] elpa/sqlite3 0dfe8e07df 30/62: 26.1 test added, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 b8fc4e2fae 35/62: TOC, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 15697800f8 37/62: Fixed changelog, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 9a2dbb9dc2 38/62: fixed typo, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 f2c30e8b86 16/62: removed 'Package Version', ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 bdb5832e27 17/62: removed 'Package Version' from sqlite3-api-constants.el, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 639ffb711e 20/62: all .el files removed., ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 96e1cdfaa8 34/62: Rewrote README in org, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 33525c1976 29/62: Emacs 26.0-pretest test added, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 00f4591f25 36/62: Fixed TOC, ELPA Syncer, 2023/03/14