From e182272a2927f9ede982b3f63c298d891989e2e7 Mon Sep 17 00:00:00 2001 From: John Connors Date: Tue, 12 Feb 2008 22:03:53 +0000 Subject: [PATCH] Renaming from cl-lwo --- file-3ds.lisp | 2 +- file-lwo.lisp | 2 +- file-md2.lisp | 2 +- lwo-binary.lisp => lodematron-binary.lisp | 2 +- lwo-read.lisp => lodematron-read.lisp | 33 ++++++++++--------------------- lwo-rw.lisp => lodematron-rw.lisp | 2 +- lwo-write.lisp => lodematron-write.lisp | 4 +++- cl-lwo.asd => lodematron.asd | 12 +++++------ package.lisp | 7 +++---- utils.lisp | 2 +- 10 files changed, 28 insertions(+), 40 deletions(-) rename lwo-binary.lisp => lodematron-binary.lisp (98%) rename lwo-read.lisp => lodematron-read.lisp (87%) rename lwo-rw.lisp => lodematron-rw.lisp (98%) rename lwo-write.lisp => lodematron-write.lisp (99%) rename cl-lwo.asd => lodematron.asd (53%) diff --git a/file-3ds.lisp b/file-3ds.lisp index 0fbbbda..43139ef 100644 --- a/file-3ds.lisp +++ b/file-3ds.lisp @@ -1,5 +1,5 @@ -(in-package :cl-lwo) +(in-package :lodematron) (defconstant +MAIN3DS+ #X4D4D) (defconstant +EDIT3DS+ #X3D3D) diff --git a/file-lwo.lisp b/file-lwo.lisp index a93bb9c..987fb3f 100644 --- a/file-lwo.lisp +++ b/file-lwo.lisp @@ -1,5 +1,5 @@ -(in-package :cl-lwo) +(in-package :lodematron) ;; top level iff forms (groups) diff --git a/file-md2.lisp b/file-md2.lisp index 881e5ef..a03e2fd 100644 --- a/file-md2.lisp +++ b/file-md2.lisp @@ -1,5 +1,5 @@ -(in-package :cl-lwo) +(in-package :lodematron) (defconstant +MD2-ANORMS+ ( -0.525731 0.000000 0.850651 ) diff --git a/lwo-binary.lisp b/lodematron-binary.lisp similarity index 98% rename from lwo-binary.lisp rename to lodematron-binary.lisp index 6005e29..bde0a2d 100644 --- a/lwo-binary.lisp +++ b/lodematron-binary.lisp @@ -1,5 +1,5 @@ -(in-package :cl-lwo) +(in-package :lodematron) ;; buffering binary files -------------------- diff --git a/lwo-read.lisp b/lodematron-read.lisp similarity index 87% rename from lwo-read.lisp rename to lodematron-read.lisp index dbbb822..be18890 100644 --- a/lwo-read.lisp +++ b/lodematron-read.lisp @@ -1,6 +1,6 @@ -(in-package :cl-lwo) +(in-package :lodematron) ;; -- reading atomic binary values ----------------------------------------- @@ -17,7 +17,7 @@ (defmethod align-for-read ((self stream) alignment) "Align a file stream for reading at alignment bytes boundary." - (when (not (zerop alignment)) + (when (not (zerop alignment)) (iterate (until (zerop (logand (file-position self) alignment))) (read-byte self)))) @@ -44,21 +44,6 @@ performed by calling (align-for-read self bytes)." ,result) (,read-once)))))) -;; (defmethod read-value ((type (eql 'u8)) (self binary-file-data) &key array-size alignment) -;; (labels ((read-once () -;; (let ((result (aref (buffered-data-of self) (buffer-pos-of self)))) -;; (incf (buffer-pos-of self)) -;; result)))) -;; (when alignment -;; (align-for-read self alignment)) -;; (if array-size -;; (read-once) -;; (let ((result (make-array array-size :element-type '(unsigned-byte 8)))) -;; (loop -;; for index from 0 below array-size -;; do -;; (setf (aref result index) (read-once))) -;; result))) (defmethod read-value ((type (eql 'u8)) (self stream) &key (array-size 0) (alignment 1) (endian :little)) (declare (ignore endian)) @@ -174,9 +159,11 @@ performed by calling (align-for-read self bytes)." (ieee-floats::decode-float64 u64)))) (defmethod read-value ((type (eql 'asciiz)) (self stream) &key ( array-size 0 ) ( alignment 1 ) (endian :little)) - (let ((result (make-array '(0) :element-type 'base-char :fill-pointer 0 :adjustable t))) - (iterate - (for byte = (read-byte self)) - (until (zerop byte)) - (vector-push-extend (code-char byte) result)) - result)) + (with-size-and-alignment-read + t alignment array-size + (let ((result (make-array '(0) :element-type 'base-char :fill-pointer 0 :adjustable t))) + (iterate + (for byte = (read-byte self)) + (until (zerop byte)) + (vector-push-extend (code-char byte) result)) + result))) diff --git a/lwo-rw.lisp b/lodematron-rw.lisp similarity index 98% rename from lwo-rw.lisp rename to lodematron-rw.lisp index c1ea4ef..252d9a0 100755 --- a/lwo-rw.lisp +++ b/lodematron-rw.lisp @@ -1,6 +1,6 @@ ;;;; Silly emacs, this is -*- Lisp -*- -(in-package :cl-lwo) +(in-package :lodematron) ;; define-binary-class ------------------------------------------------------ ;; Heavily influenced by (stolen, really) from Practical Common Lisp diff --git a/lwo-write.lisp b/lodematron-write.lisp similarity index 99% rename from lwo-write.lisp rename to lodematron-write.lisp index 82a3f4e..b4573f7 100644 --- a/lwo-write.lisp +++ b/lodematron-write.lisp @@ -1,5 +1,7 @@ -(in-package :cl-lwo) +(in-package :lodematron) + +;; WIP ;; ;; write aligned binary data ----------------------------------------- diff --git a/cl-lwo.asd b/lodematron.asd similarity index 53% rename from cl-lwo.asd rename to lodematron.asd index d3ab703..d3faaef 100644 --- a/cl-lwo.asd +++ b/lodematron.asd @@ -1,15 +1,15 @@ -;;;; lwo.asd + (in-package :asdf) -(asdf:defsystem :cl-lwo +(asdf:defsystem :lodematron :depends-on ( :iterate :ieee-floats ) :serial t :components ((:file "package") (:file "utils") - (:file "lwo-binary") - (:file "lwo-read" ) - (:file "lwo-write" ) - (:file "lwo-rw" ) + (:file "lodematron-binary") + (:file "lodematron-read" ) + (:file "lodematron-write" ) + (:file "lodematron-rw" ) (:file "file-3ds") (:file "file-lwo"))) diff --git a/package.lisp b/package.lisp index 824e623..8297d79 100644 --- a/package.lisp +++ b/package.lisp @@ -1,9 +1,8 @@ ;;;; package.lisp (in-package :cl-user) -(defpackage :cl-lwo - (:use :cl :ieee-floats :iterate) - (:nicknames :lwo)) +(defpackage :lodematron + (:use :cl :ieee-floats :iterate)) -(in-package :cl-lwo) +(in-package :lodematron) diff --git a/utils.lisp b/utils.lisp index f78cf2d..da1ac14 100644 --- a/utils.lisp +++ b/utils.lisp @@ -1,5 +1,5 @@ -(in-package :cl-lwo) +(in-package :lodematron) ;; utils used throughout the code -- 2.11.4.GIT