slackbuilds/development/eisl/patches/02-ndbm.patch

53 lines
2.0 KiB
Diff

--- eisl-3.50/library/ndbm.lsp 2023-09-10 01:16:45.000000000 -0300
+++ eisl-3.50-mod/library/ndbm.lsp 2023-10-26 21:57:30.208196711 -0300
@@ -8,9 +8,9 @@
;;;
;;; See persist.lsp for a higher-level way to do things.
-(c-include "<ndbm.h>")
+(c-include "<gdbm.h>")
(c-include "<fcntl.h>")
-(c-option "-lgdbm_compat -lgdbm" linux)
+(c-option "-lgdbm" linux)
;; This is the best way I could see to export C #define contants?
(defun ndbm-rdonly ()
@@ -30,9 +30,9 @@
(c-lang "res = Fmakefaststrlong(res_str);"))
(defun ndbm-insert ()
- (c-lang "res = DBM_INSERT | INT_FLAG;"))
+ (c-lang "res = GDBM_INSERT | INT_FLAG;"))
(defun ndbm-replace ()
- (c-lang "res = DBM_REPLACE | INT_FLAG;"))
+ (c-lang "res = GDBM_REPLACE | INT_FLAG;"))
(defun ndbm-store (db key content store-mode)
;; Store a record to the file
@@ -40,14 +40,14 @@
(c-lang "datum key, content;");
(c-lang "key.dptr = Fgetname(KEY); key.dsize = strlen(key.dptr) + 1;")
(c-lang "content.dptr = Fgetname(CONTENT); content.dsize = strlen(content.dptr) + 1;")
- (c-lang "res = dbm_store(Fgetlong(DB), key, content, STORE_MODE & INT_MASK) | INT_FLAG;"))
+ (c-lang "res = gdbm_store(Fgetlong(DB), key, content, STORE_MODE & INT_MASK) | INT_FLAG;"))
(defun ndbm-fetch (db key)
;; Fetch a record from the file
(the <longnum> db)(the <string> key)
(c-lang "datum key, content;")
(c-lang "key.dptr = Fgetname(KEY); key.dsize = strlen(key.dptr) + 1;")
- (c-lang "content = dbm_fetch(Fgetlong(DB), key);")
+ (c-lang "content = gdbm_fetch(Fgetlong(DB), key);")
(c-lang "res = (content.dptr == NULL) ? NIL : Fmakestr(content.dptr);"))
(defun ndbm-delete (db key)
@@ -55,7 +55,7 @@
(the <longnum> db)(the <string> key)
(c-lang "datum key;")
(c-lang "key.dptr = Fgetname(KEY); key.dsize = strlen(key.dptr) + 1;")
- (c-lang "res = dbm_delete(Fgetlong(DB), key) | INT_FLAG;"))
+ (c-lang "res = gdbm_delete(Fgetlong(DB), key) | INT_FLAG;"))
(defun ndbm-close (db)
;; Close an open dbm file