Permalink
Browse files

Use different package names for internal ieee-floats and trivial-utf-8

This way they won't clash with the regular distribution of those packages
  • Loading branch information...
1 parent ee8e083 commit dfb9da112410ccc60d92d7bc8ce0c1efb41b6e9e @marijnh committed Aug 2, 2011
Showing with 14 additions and 13 deletions.
  1. +2 −2 cl-postgres/ieee-floats.lisp
  2. +3 −3 cl-postgres/interpret.lisp
  3. +7 −6 cl-postgres/strings-utf-8.lisp
  4. +2 −2 cl-postgres/trivial-utf-8.lisp
@@ -3,15 +3,15 @@
;;;
;;; See http://common-lisp.net/project/ieee-floats/
-(defpackage :ieee-floats
+(defpackage :cl-postgres-ieee-floats
(:use :common-lisp)
(:export :make-float-converters
:encode-float32
:decode-float32
:encode-float64
:decode-float64))
-(in-package :ieee-floats)
+(in-package :cl-postgres-ieee-floats)
;; The following macro may look a bit overcomplicated to the casual
;; reader. The main culprit is the fact that NaN and infinity can be
@@ -93,9 +93,9 @@ interpreted as an array of the given type."
(define-interpreter 1043 "varchar" string)
(define-interpreter 700 "float4" ((bits uint 4))
- (ieee-floats:decode-float32 bits))
+ (cl-postgres-ieee-floats:decode-float32 bits))
(define-interpreter 701 "float8" ((bits uint 8))
- (ieee-floats:decode-float64 bits))
+ (cl-postgres-ieee-floats:decode-float64 bits))
;; Numeric types are rather involved. I got some clues on their
;; structure from http://archives.postgresql.org/pgsql-interfaces/2004-08/msg00000.php
@@ -127,7 +127,7 @@ interpreted as an array of the given type."
"Decode a 64 bit time-related value based on the timestamp format
used. Correct for sign bit when using integer format."
(ecase *timestamp-format*
- (:float (round (* (ieee-floats:decode-float64 bits) 1000000)))
+ (:float (round (* (cl-postgres-ieee-floats:decode-float64 bits) 1000000)))
(:integer (if (logbitp 63 bits)
(dpb bits (byte 63 0) -1)
bits))))
@@ -4,22 +4,23 @@
(declaim (inline enc-byte-length))
(defun enc-byte-length (sequence)
- (trivial-utf-8:utf-8-byte-length sequence))
+ (cl-postgres-trivial-utf-8:utf-8-byte-length sequence))
(declaim (inline enc-write-string))
(defun enc-write-string (string output &key null-terminate)
- (trivial-utf-8:write-utf-8-bytes string output
- :null-terminate null-terminate))
+ (cl-postgres-trivial-utf-8:write-utf-8-bytes string output
+ :null-terminate null-terminate))
(declaim (inline enc-read-string))
(declaim (ftype (function (t &key (:null-terminated t)
(:byte-length unsigned-byte))
string)
enc-read-string))
(defun enc-read-string (input &key null-terminated (byte-length -1))
- (trivial-utf-8:read-utf-8-string input :null-terminated null-terminated
- :byte-length byte-length))
+ (cl-postgres-trivial-utf-8:read-utf-8-string
+ input :null-terminated null-terminated :byte-length byte-length))
(declaim (inline enc-string-bytes))
(defun enc-string-bytes (string &key null-terminate)
- (trivial-utf-8:string-to-utf-8-bytes string :null-terminate null-terminate))
+ (cl-postgres-trivial-utf-8:string-to-utf-8-bytes
+ string :null-terminate null-terminate))
@@ -2,7 +2,7 @@
;;;
;;; See http://common-lisp.net/project/trivial-utf-8/
-(defpackage :trivial-utf-8
+(defpackage :cl-postgres-trivial-utf-8
(:use :common-lisp)
(:export #:utf-8-byte-length
#:string-to-utf-8-bytes
@@ -12,7 +12,7 @@
#:read-utf-8-string
#:utf-8-decoding-error))
-(in-package :trivial-utf-8)
+(in-package :cl-postgres-trivial-utf-8)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter *optimize*

0 comments on commit dfb9da1

Please sign in to comment.