diff --git a/change-logs/bdb.log b/change-logs/bdb.log index 5d5dfc973395b76aef30a2bb568b3ac866eae605..ba8dc06892d7520333ac164011cecb203b1d6c0a 100644 --- a/change-logs/bdb.log +++ b/change-logs/bdb.log @@ -1,3 +1,15 @@ +Fri May 26 01:20:24 CEST 2006 -urso-@web.de + * fixed some bugs preventing secondary databases to work when db-txn is used as database representation + +Thu May 25 22:38:48 CEST 2006 -urso-@web.de + * update-secondary is 'exception-save' now... + +Thu May 25 22:35:02 CEST 2006 -urso-@web.de + * db-associate ensures to run in transaction when used with db-txn + +Thu May 25 21:40:09 CEST 2006 -urso-@web.de + * if database is db-txn, db-del will ensure that it runs in a transaction + Fri May 19 01:30:03 CEST 2006 -urso-@web.de * export new symbols diff --git a/change-logs/cffi-util.log b/change-logs/cffi-util.log index 1263cac762996fb332bd9a0d4a068587da53621a..4fc430504b06be951fe3fa3f2333cc9454956947 100644 --- a/change-logs/cffi-util.log +++ b/change-logs/cffi-util.log @@ -1,3 +1,9 @@ +Fri May 26 01:16:07 CEST 2006 -urso-@web.de + * renamed clear-flag to clr-flag. clf-flag and set-flag may use lists of flags or one flag + +Thu May 25 22:32:31 CEST 2006 -urso-@web.de + * added clear-flag and set-flag to flag-system + Thu May 11 17:49:14 CEST 2006 -urso-@web.de * defcfun* macro now adds a check on class types: if argument is nil or the specified slot is nil and the required type is :pointer or :string, pass a null-pointer diff --git a/change-logs/mycl-util.log b/change-logs/mycl-util.log index 149ad55ab05c107004d88a7f4811e35517dcc981..7b6d0793a22a6c82ca43e19d2ea0e1663ae02453 100644 --- a/change-logs/mycl-util.log +++ b/change-logs/mycl-util.log @@ -1,3 +1,6 @@ +Thu May 25 19:00:26 CEST 2006 -urso-@web.de + * changed to filter to work like remove-if-not + Sun May 7 23:39:47 CEST 2006 -urso-@web.de * WARNING: changed output path of make-qbook diff --git a/qbook/bdb/Auxilliary_0020Bindings.html b/qbook/bdb/Auxilliary_0020Bindings.html index 09ceb4adaaa59fe7c6efaeeaef6c01b6963101d5..34f64d28f454e7aef95752479398d8fa5577c3fa 100644 --- a/qbook/bdb/Auxilliary_0020Bindings.html +++ b/qbook/bdb/Auxilliary_0020Bindings.html @@ -24,7 +24,8 @@ > | toc

(to be used by this library only)

+>

(to be used by this library only) +

(defcfun "strlen" :int
   (str :pointer))
(mode :int)) -
(defmethod+ ("db_close" %db-close) :error-int
   (db :pointer)
diff --git a/qbook/bdb/Databases.html b/qbook/bdb/Databases.html
index 4ce7833171422668f7014e8b9350674fb5e7b3b6..055e90bf5b4ee1a9681100e33bf5d4139dd232d3 100644
--- a/qbook/bdb/Databases.html
+++ b/qbook/bdb/Databases.html
@@ -37,6 +37,22 @@
   >
 
+
+
+
+
 
 
+
+
 
 
+
+
 
- Berkley DB CFFI-Bindings

Berkley DB CFFI-Bindings

Secondary Databases 

+ Notes: + the C library handles secondaries like this: + db_create: - will create environment, if none specified and + add to db pointer + db_put/__db_put: - create cursor with write-lock + - use __db_c_put on cursor to insert data + __db_c_put: - uses private flag DB_UPDATE_SECONDARY to do puts on + secondary databases + - use __db_s_first and __db_s_next for iterating over + secondaries, they will take care of thread-locking + - in first loop add new keys: + - call callback to get secondary key + - open cursor on secondary with transaction and + lock id of primary database + - use __db_c_put with DB_UPDATE_SECONDARY flag + to insert data into secondary + - close cursor + - in second loop remove old secondary indicies: + - get old secondary key + - if secondary key needs to be deleted than: + - get cursor + - use get to move cursor to position + - delete entry + - update primary database now + + perl/tcl/python/ruby libs weren't much more helpfull :( + + for the lisp library: + - when opening a database it depends on the environment, + wether we'll use the C-based (using db-associate-ll) + implementation or a transaction based if transactions + are supported by environment. + Todo so, db-open returns different kind of classes: + - db-std ;; standard db-class, if txn not allowed + - db-txn ;; if environment supports transactions + + - db-associate needs different implementations for db-std + and db-txn: + - db-std: + - use the old low level method + - use defcallback and go on + - no changes to db-put + - db-txn: + - add callback function and secondary to table + in database + - when closing secondary, remove from table + - don't use defcallback, use lambda directly + - overwrite db-put: + - create an transaction + - add data to primary + - in a loop, add keys to secondaries + + + + +

(defcstruct DBT ;;tried to avoid using DBT directly... :'(
+  (data :pointer)
+  (size :uint32)
+  (ulen :uint32)
+  (dlen :uint32)
+  (doff :uint32)
+  (flags :uint32))
+ + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SEC-OPEN-FLAGS.html b/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SEC-OPEN-FLAGS.html new file mode 100644 index 0000000000000000000000000000000000000000..70fc71bbe35046b4778341ca90e32c220a0c142f --- /dev/null +++ b/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SEC-OPEN-FLAGS.html @@ -0,0 +1,26 @@ +Function ADJUST-SEC-OPEN-FLAGS

Function: ADJUST-SEC-OPEN-FLAGS

Source

(defun adjust-sec-open-flags (flags)
+  (clr-flag flags '(:exclusive :create :truncate :auto-commit)))
Source Context
\ No newline at end of file diff --git a/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SECONDARY-FLAGS.html b/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SECONDARY-FLAGS.html new file mode 100644 index 0000000000000000000000000000000000000000..3d259a782bbb930530a2e3eda7dc0c994e323bbf --- /dev/null +++ b/qbook/bdb/api/function_005FBDB_003A_003AADJUST-SECONDARY-FLAGS.html @@ -0,0 +1,26 @@ +Function ADJUST-SECONDARY-FLAGS

Function: ADJUST-SECONDARY-FLAGS

Source

(defun adjust-secondary-flags (flags)
+  flags)
Source Context
\ No newline at end of file diff --git a/qbook/bdb/api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html b/qbook/bdb/api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html index 31983a0a2fde9cef7cb8912ed0f761acad358365..dd9f91c5def0ebec325338c81713340b079dde22 100644 --- a/qbook/bdb/api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html +++ b/qbook/bdb/api/function_005FBDB_003A_003ABUILD-ASSOC-CALLBACK-MAKER.html @@ -18,15 +18,10 @@ (lambda (fun &optional name) (create-cbuffered-db-assoc-callback (lambda (secondary key-buf data-buf) - (multiple-value-bind (use-ret ret) - (funcall fun secondary + (multiple-value-call (curry #'make-return-buffer buf-writer) + (funcall fun secondary (funcall buf-reader key-buf) - (funcall buf-reader data-buf)) - (if use-ret - (let ((ret-buf (alloc-cbuffer))) - (funcall buf-writer ret ret-buf) - (values t ret-buf)) - (values nil nil)))) + (funcall buf-reader data-buf)))) name)))Source Context(defun build-cbuffered-assoc-lambda (buf-writer buf-reader) (lambda (fun) (lambda (secondary key-buf data-buf) - (multiple-value-bind (use-ret ret) - (funcall fun secondary + (multiple-value-call (curry #'make-return-buffer buf-writer) + (funcall fun secondary (funcall buf-reader key-buf) - (funcall buf-reader data-buf)) - (if use-ret - (let ((ret-buf (alloc-cbuffer))) - (funcall buf-writer ret ret-buf) - (values t ret-buf)) - (values nil nil))))))Source Context

Documentation

creates and opens a new Database
   params: env = Environment the database shall be opened in txn = Transaction db = Database in File (optional) mode = file mode, use create-umask or 0 for default type = :db-btree :db-hash :db-recno or :db-queue flags... see BDB documentation or db.h

creates and opens a new Database + params: env = Environment the database shall be opened in + txn = Transaction + db = Database in File (optional) + mode = file mode, use create-umask or 0 for default + type = :db-btree :db-hash :db-recno or :db-queue + flags... see BDB documentation or db.h

Source

Function MAKE-RETURN-BUFFER

Function: MAKE-RETURN-BUFFER

Source

(defun make-return-buffer (writer use data)
+  (if use
+      (let ((ret-buf (alloc-cbuffer)))
+	(funcall writer data ret-buf)
+	(values t ret-buf))
+      (values nil nil)))
Source Context
\ No newline at end of file diff --git a/qbook/bdb/api/function_005FBDB_003A_003APUT-INTO-SECONDARY.html b/qbook/bdb/api/function_005FBDB_003A_003APUT-INTO-SECONDARY.html new file mode 100644 index 0000000000000000000000000000000000000000..eee0cfd3ef9052da897a24816e090770ee91595e --- /dev/null +++ b/qbook/bdb/api/function_005FBDB_003A_003APUT-INTO-SECONDARY.html @@ -0,0 +1,30 @@ +Function PUT-INTO-SECONDARY

Function: PUT-INTO-SECONDARY

Source

(defun put-into-secondary (db use key data txn)
+  (unwind-protect
+	 (when use
+	   (db-put db key data :txn txn))
+      (when key
+	(free-cbuffer key))))
Source Context
\ No newline at end of file diff --git a/qbook/bdb/api/function_005FBDB_003A_003AUPDATE-SECONDARY.html b/qbook/bdb/api/function_005FBDB_003A_003AUPDATE-SECONDARY.html index 84be91f5e031e110123a3111d1c7945a34f49f7f..9b7518262882b2caeb39a81b4834bfb22870cc09 100644 --- a/qbook/bdb/api/function_005FBDB_003A_003AUPDATE-SECONDARY.html +++ b/qbook/bdb/api/function_005FBDB_003A_003AUPDATE-SECONDARY.html @@ -15,13 +15,10 @@ >Source
(defun update-secondary (db-and-callback key data txn)
-  (multiple-value-bind (use sec-key)
-      (funcall (cdr db-and-callback) (car db-and-callback) key data)
-    (when use
-      (db-put (car db-and-callback) sec-key key
-	      :txn txn))
-    (when sec-key
-      (free-cbuffer sec-key)))
+  (multiple-value-call (lambda (use buf)
+			 (put-into-secondary (car db-and-callback)
+					     use buf key txn))
+    (funcall (cdr db-and-callback) (car db-and-callback) key data))
   t)
Source Context
(defmethod db-associate ((primary db-txn) (secondary db-txn)
 			 callback &key txn callback-maker create)
-  (%db-dummy-associate primary
-		       txn
-		       (db-sec-handle (db-open-sec secondary :txn txn))
-		       :create create)
-  (push (cons secondary
-	      (if (functionp callback-maker)
-		  (funcall callback-maker callback)
-		  callback))
-	(db-assoc primary))
-  (setf (db-assoc secondary) primary)
-  primary)
Source ContextMethod (DB-DEL DB-TXN T)

Method: (DB-DEL DB-TXN T)

Source

(defmethod db-del ((db db-txn) key &key txn)
+  (if (null txn)
+      (with-txn (txn (db-get-env db))
+	(db-del db key :txn txn))
+      (%db-del db txn (cbuffer-data key) (cbuffer-size key) 0)))
Source Context
\ No newline at end of file diff --git a/qbook/bdb/api/method_005FBDB_003A_003A_0028DB-OPEN-SEC_0020DB-TXN_0029.html b/qbook/bdb/api/method_005FBDB_003A_003A_0028DB-OPEN-SEC_0020DB-TXN_0029.html index 7aa5bf6c03bf606f11cc6461377d75f6cb77db11..db75f5818419ef4a44fe6fa7bbf1606ffb8788c9 100644 --- a/qbook/bdb/api/method_005FBDB_003A_003A_0028DB-OPEN-SEC_0020DB-TXN_0029.html +++ b/qbook/bdb/api/method_005FBDB_003A_003A_0028DB-OPEN-SEC_0020DB-TXN_0029.html @@ -18,7 +18,7 @@ (let* ((handle (db-handle db)) (env (%db-get-env handle)) (dbp (bdb-create env 0))) - (%%db-set-flags dbp (%db-get-flags db)) + (%%db-set-flags dbp (adjust-secondary-flags (%db-get-flags db))) (multiple-value-bind (db-file-name db-name) (db-dbname db) (%%db-open dbp @@ -26,7 +26,7 @@ (if (not db-file-name) (null-pointer) db-file-name) (if (not db-name) (null-pointer) db-name) (%db-get-type db) - (%db-open-flags db) + (adjust-sec-open-flags (%db-open-flags db)) 0) (setf (db-sec-handle db) dbp) db)))

Documentation

callback returns a cbuffer, which will be freed by this put function

callback returns a cbuffer, which will be freed by this put function

Source

ADJUST-SECONDARY-FLAGS
ADJUST-SEC-OPEN-FLAGS
BDB-CHECK-ERROR
MAKE-GET-BUFFER
MAKE-RETURN-BUFFER
PUT-INTO-SECONDARY
TXN-SUPPORT-FOR-HANDLEDB-CURSOR-PUT
DB-DEL
[Constant] ADJUST-SEC-OPEN-FLAGS [Function] ADJUST-SECONDARY-FLAGS [Function] [Function] MAKE-RETURN-BUFFER [Function] [Method] DB-DEL [Method] [Constant] DB-DEL [Method] [Method] ADJUST-SEC-OPEN-FLAGS [Function] ADJUST-SECONDARY-FLAGS [Function] [Constant] PUT-INTO-SECONDARY [Function] [Function] MAKE-RETURN-BUFFER [Function] [Method] ADJUST-SEC-OPEN-FLAGS [Function] [Function] PUT-INTO-SECONDARY [Function] [Constant] MAKE-RETURN-BUFFER [Function] [Method] ADJUST-SEC-OPEN-FLAGS [Function] [Function] PUT-INTO-SECONDARY [Function] ADJUST-SECONDARY-FLAGS [Function]

(eval-when (:compile-toplevel :load-toplevel :execute)
  (unless (find-package :cffi-util-system) (defpackage :cffi-util-system (:use :common-lisp :asdf))))

(eval-when (:compile-toplevel :load-toplevel :execute) + (unless (find-package :cffi-util-system) + (defpackage :cffi-util-system + (:use :common-lisp :asdf))))

(in-package :cffi-util-system)

(in-package :cffi-util-system)

(defsystem :cffi-util
  :description "some utilities"
  :author ""
  :version "0.0,0"
  :components
  ((:module :src :components ((:file "packages") (:file "flags" :depends-on ("packages")) (:file "defcfun" :depends-on ("packages" "flags")) (:file "cbuffer" :depends-on ("packages")) (:file "cbuffer-streams" :depends-on ("cbuffer")))))
  :depends-on (:cffi :mycl-util :trivial-gray-streams :flexi-streams))

(defsystem :cffi-util + :description "some utilities" + :author "" + :version "0.0,0" + :components + ((:module :src + :components ((:file "packages") + (:file "flags" + :depends-on ("packages")) + (:file "defcfun" + :depends-on ("packages" "flags")) + (:file "cbuffer" + :depends-on ("packages")) + (:file "cbuffer-streams" + :depends-on ("cbuffer"))))) + :depends-on (:cffi :mycl-util :trivial-gray-streams :flexi-streams))

(defstruct cbuffer
  (data (foreign-alloc :uchar :count 16))
  (size 0)
  (length 16))

(defstruct cbuffer + (data (foreign-alloc :uchar :count 16)) + (size 0) + (length 16)) @@ -87,7 +90,11 @@ >

(defcfun "memcpy" :pointer
  (dest :pointer)
  (src :pointer)
  (length :int))

(defcfun "memcpy" + :pointer + (dest :pointer) + (src :pointer) + (length :int))
CFFI-Util Source

CFFI-Util Source

Packages 

-
(defpackage :cffi-util
-  (:use :cl :cffi :util
-	:trivial-gray-streams
-	:flexi-streams)
-  (:export
-   ;;flag-system
-   #:*current-flag-system*
-   #:make-flag-system #:flag-system-parent
-   #:find-flag-system
-   #:delete-flag-system
-   #:clear-flag-systems
-   #:use-flagsystem
-   #:def-flag-system
-   #:with-flag-system
-   #:direct-flag-value
-   #:flag-value
-   #:clear-flags
-   #:concat-flags
-   #:flags
-   #:def-flag
-   #:def-flag*
-   #:has-flag
-   #:flag-list
-
-   ;;helpers
-   #:defcfun*
-
-   ;;cbuffer
-   #:make-cbuffer
-   #:make-cbuffer-from-pointer
-   #:cbuffer-p
-   #:cbuffer-data
-   #:cbuffer-size
-   #:cbuffer-length
-
-   #:*use-cbuffer-pool*
-   #:*cbuffer-pool-max-size*
-   #:*cbuffer-pool-min-buffer-size*
-   #:*cbuffer-pool-max-buffer-size*
-   #:make-cbuffer-pool
-   #:*cbuffer-pool*
-   #:clear-cbuffer-pool
-   #:alloc-cbuffer
-   #:free-cbuffer
-   
-   #:cbuffer-resize
-   #:cbuffer-eob-p
-   #:cbuffer-ensure-size
-   #:cbuffer-adjust-min-size
-   #:with-cbuffer
-
-   #:cbuffer-checkbounds
-   #:cbuffer-byte
-   #:make-cbuffer-input-stream
-   #:make-cbuffer-output-stream
-   #:stream-position
-   #:stream-cbuffer
-
-   ))
\ No newline at end of file diff --git a/qbook/cffi-util/Utilities.html b/qbook/cffi-util/Utilities.html deleted file mode 100644 index 8fbc94d676baac3baa9e8953728146ebf7c619d1..0000000000000000000000000000000000000000 --- a/qbook/cffi-util/Utilities.html +++ /dev/null @@ -1,31 +0,0 @@ -CFFI-Util Source

CFFI-Util Source

Utilities 

\ No newline at end of file diff --git a/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACBUFFER-ADJUST-MIN-SIZE.html b/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACBUFFER-ADJUST-MIN-SIZE.html index b8e28b939014e210745e67a50fdf0e15aad55d7d..e0914528b7036bf6f93ad9ea69eec46d27403af4 100644 --- a/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACBUFFER-ADJUST-MIN-SIZE.html +++ b/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACBUFFER-ADJUST-MIN-SIZE.html @@ -14,7 +14,9 @@ >

Documentation

WARNING: size must be smaller then length!!! use cbuffer-ensure-size before using cbuffer-adjust-min-size for example

WARNING: size must be smaller then length!!! + use cbuffer-ensure-size before using cbuffer-adjust-min-size + for example

Source

Documentation

resizes cbuffer by creating a new one and copying the data along.
   if new-size < size then buffer may be truncated

resizes cbuffer by creating a new one and copying the data along. + if new-size < size then buffer may be truncated

Source

Function CLR-FLAG

Function: CLR-FLAG

Source

(defun clr-flag (value flag &optional (flag-system *current-flag-system*))
+  (cond ((and (listp flag) (not (null flag))) ;; list of flags?
+	 (clr-flag (clr-flag value (cdr flag) flag-system)
+		   (car flag)
+		   flag-system))
+	 ((not (null flag)) ;;one flag itself
+	  (logand value (lognot (flag-value flag flag-system))))
+	 (t value)))
Source Context
\ No newline at end of file diff --git a/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACONCAT-FLAGS.html b/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACONCAT-FLAGS.html index 3a7db6b13c1d691dc47b8f07775a866ae2f5751f..87441be039c7bd0df7214aca0dbc3c4688383e18 100644 --- a/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACONCAT-FLAGS.html +++ b/qbook/cffi-util/api/function_005FCFFI-UTIL_003A_003ACONCAT-FLAGS.html @@ -14,7 +14,8 @@ >

Documentation

creates an integer using logior using a list of flags:
   e.g. (concat-flags '(:append :create ))

creates an integer using logior using a list of flags: + e.g. (concat-flags '(:append :create <more-symbols>))

Source

Documentation

flag systems may be children of other flag systems

flag systems may be children of other flag systems

Source

Documentation

returns a list of flags, which byte pattern is found in value

returns a list of flags, which byte pattern is found in value

Source

Documentation

make-cbuffer-pool creates a priority-pool using the length
   of buffers as priority... Largest Buffers have highest priority

make-cbuffer-pool creates a priority-pool using the length + of buffers as priority... Largest Buffers have highest priority

Source

Function SET-FLAG

Function: SET-FLAG

Source

(defun set-flag (value flag &optional (flag-system *current-flag-system*))
+  (cond ((and (listp flag) (not (null flag)))
+	 (set-flag (set-flag value (cdr flag) flag-system)
+		   (car flag)
+		   flag-system))
+	((not (null flag))
+	 (logior value (flag-value flag flag-system)))
+	(t value)))
Source Context
\ No newline at end of file diff --git a/qbook/cffi-util/api/macro_005FCFFI-UTIL_003A_003ADEF-FLAG_002A.html b/qbook/cffi-util/api/macro_005FCFFI-UTIL_003A_003ADEF-FLAG_002A.html index c377c464e4f5ccc4f0b0db499dca0e4ddfa91b80..5e02db2193975d42572c481d9eafb148e2766e91 100644 --- a/qbook/cffi-util/api/macro_005FCFFI-UTIL_003A_003ADEF-FLAG_002A.html +++ b/qbook/cffi-util/api/macro_005FCFFI-UTIL_003A_003ADEF-FLAG_002A.html @@ -14,7 +14,7 @@ >

Documentation

same as def-flag, but creates a constant

same as def-flag, but creates a constant

Source

Documentation

if ret-type is keyword :error-int the cfunction will return
   an int indicating an error if ret!=0 and error-fun is called with using
   the returned value
   syntax: (defcfun* (name fun-name <:error-fun symbol> <:method t|nil>) ret-type args) ctype ::= see cffi manual... args ::= (arg ctype [:key]) | (arg :out ctype) | (arg ctype :const value) | (arg :flag flag-list <:flag-type ctype> <:default flag-list> <:flag-system flag-system>) (arg ctype :class class-args) flag-list ::= (flag-keyword) class-args ::= slot-name | (class-name slot-name)
   params: flag-type: default is uint32 default: flags being set to t by default name: cfunction name fun-name: function name for lisp interface error-fun: function called if ret-type id of type :error-int ret-type: see defcfun arglist: see defcfun (if arglist contains :out keyword for several args, these will be returned using values... try macroexpand to find out more :P )

if ret-type is keyword :error-int the cfunction will return + an int indicating an error if ret!=0 and error-fun is called with using + the returned value + syntax: (defcfun* (name fun-name <:error-fun symbol> <:method t|nil>) + ret-type + args*) + ctype ::= see cffi manual... + args ::= (arg ctype [:key]) | (arg :out ctype) | + (arg ctype :const value) | + (arg :flag flag-list + <:flag-type ctype> + <:default flag-list> + <:flag-system flag-system>) + (arg ctype :class class-args) + flag-list ::= (flag-keyword*) + class-args ::= slot-name | (class-name slot-name) + params: flag-type: default is uint32 + default: flags being set to t by default + name: cfunction name + fun-name: function name for lisp interface + error-fun: function called if ret-type id of type :error-int + ret-type: see defcfun + arglist: see defcfun (if arglist contains :out keyword for + several args, these will be returned + using values... try macroexpand to find out + more :P )

Source

Documentation

creates code using a flag-system and a list of args.
   All functions using this macros must be recompiled if
   they're using flags being redefined in a flag-system
   after compilation.
   Uses current-flag-system... use with-flag-system
   if you need to use another flag-system within this macro

creates code using a flag-system and a list of args. + All functions using this macros must be recompiled if + they're using flags being redefined in a flag-system + after compilation. + Uses *current-flag-system*... use with-flag-system + if you need to use another flag-system within this macro

Source

Documentation

max num of buffers in pool

max num of buffers in pool

Source

Documentation

min size of buffers in pool

min size of buffers in pool

Source

Documentation

...

...

Source

 | toc

example usage:

(defcfun* ("test" test :method t) :error-int
  (a :int)
  (b :out :uchar)
  (c :int :key)
  (p :pointer)
  (flag :flag (:create :truncate))
  (aflag :uint32 :const 0)
  (cl :uint32 :class (my-class value))
  (cl2 :uint32 :class any-slot)
  (cl3 :pointer :key :class handle))
 ==>
(PROGN
 (DEFCFUN ("test" %TEST) :INT (A :INT) (B :POINTER) (C :INT) (P :POINTER) (FLAG :UINT32) (AFLAG :UINT32) (CL :UINT32) (CL2 :UINT32) (CL3 :POINTER))
 (DEFMETHOD TEST (A P (CL MY-CLASS) CL2 &KEY C CL3 CREATE TRUNCATE) (WITH-FOREIGN-OBJECTS ((B :UCHAR)) (LET ((RET (%TEST A B C (IF (NOT P) (NULL-POINTER) P) (LOGIOR (IF CREATE 1 0) (IF TRUNCATE 128 0)) 0 (SLOT-VALUE CL 'VALUE) (SLOT-VALUE CL2 'ANY-SLOT) (IF (OR (NOT CL3) (NOT (SLOT-VALUE CL3 'HANDLE))) (NULL-POINTER) (SLOT-VALUE CL3 'HANDLE))))) (WHEN (STD-CHECK-ERROR RET) (VALUES (MEM-REF B :UCHAR)))))))

+>

example usage: + +(defcfun* ("test" test :method t) :error-int + (a :int) + (b :out :uchar) + (c :int :key) + (p :pointer) + (flag :flag (:create :truncate)) + (aflag :uint32 :const 0) + (cl :uint32 :class (my-class value)) + (cl2 :uint32 :class any-slot) + (cl3 :pointer :key :class handle)) + ==> +(PROGN + (DEFCFUN ("test" %TEST) + :INT + (A :INT) + (B :POINTER) + (C :INT) + (P :POINTER) + (FLAG :UINT32) + (AFLAG :UINT32) + (CL :UINT32) + (CL2 :UINT32) + (CL3 :POINTER)) + (DEFMETHOD TEST + (A P (CL MY-CLASS) CL2 &KEY C CL3 CREATE TRUNCATE) + (WITH-FOREIGN-OBJECTS ((B :UCHAR)) + (LET ((RET + (%TEST A + B + C + (IF (NOT P) (NULL-POINTER) P) + (LOGIOR (IF CREATE 1 0) + (IF TRUNCATE 128 0)) + 0 + (SLOT-VALUE CL 'VALUE) + (SLOT-VALUE CL2 'ANY-SLOT) + (IF + (OR (NOT CL3) + (NOT + (SLOT-VALUE CL3 + 'HANDLE))) + (NULL-POINTER) + (SLOT-VALUE CL3 'HANDLE))))) + (WHEN (STD-CHECK-ERROR RET) + (VALUES (MEM-REF B :UCHAR))))))) +