anchor.diff:     #:with-foreign-string
      #:with-foreign-strings
      #:foreign-string-length              ; not implemented
  +   #:string-to-octets
  +   #:octets-to-string
  +   #:foreign-encoded-octet-count
   
      ;; function call
      #:def-function
  
positive.code: 
  ;;; Some undocumented UFFI operators...
  
  (defmacro convert-from-foreign-string (obj &key length (locale :default)
                                         (null-terminated-p t))
    ;; in effect, (eq NULL-TERMINATED-P (null LENGTH)). Hopefully,
    ;; that's compatible with the intended semantics, which are
    ;; undocumented.  If that's not the case, we can implement
    ;; NULL-TERMINATED-P in CFFI:FOREIGN-STRING-TO-LISP.
    (declare (ignore locale null-terminated-p))
    (let ((ret (gensym)))
      `(let ((,ret (cffi:foreign-string-to-lisp ,obj :count ,length)))
         (if (equal ,ret "")
             nil
             ,ret))))
  
  ;; What's the difference between this and convert-to-cstring?
  (defmacro convert-to-foreign-string (obj)
    (let ((str (gensym)))
      `(let ((,str ,obj))
         (if (null ,str)
             (cffi:null-pointer)
             (cffi:foreign-string-alloc ,str)))))
  
  (defmacro allocate-foreign-string (size &key unsigned)
    (declare (ignore unsigned))
  
negative.code:   (let ((a (make-array len :element-type '(unsigned-byte 8))))
      (dotimes (i len a)
        (setf (aref a i) (cffi:mem-ref s :unsigned-char i)))))
  
  ;;;; String Encodings
  
  (defmacro string-to-octets (str &key encoding null-terminate)
    `(babel:concatenate-strings-to-octets
      (or ,encoding cffi:*default-foreign-encoding*)
      ,str
      (if ,null-terminate
          #.(string #\Nul)
          "")))
  
  (defmacro octets-to-string (octets &key encoding)
    `(babel:octets-to-string
      :encoding (or ,encoding cffi:*default-foreign-encoding*)))
  
  (defun foreign-encoded-octet-count (str &key encoding)
    `(babel:string-size-in-octets
      ,str :encoding (or ,encoding cffi:*default-foreign-encoding*)))
  