1 2003-12-11 Frode Vatvedt Fjeld <frodef@cs.uit.no>
5 * API CHANGE! Map-binary-write functions now receive two
6 arguments: The object (as before), and the name of the binary-type
7 the object is supposed to be mapped to.
9 * Imroved README a bit. Documented :map-binary-read and
10 :map-binary-read-delayed.
12 * Fixed bug as reported by Simon Leinen. Various minor
13 bug-fixes. Changed the defpackage form to use gensym names.
15 2001-08-28 Frode Vatvedt Fjeld <frodef@acm.org>
18 Added utility functions SPLIT-BYTES and MERGE-BYTES that deals with
19 converting lists of bytes to new byte-sizes.
21 2001-08-27 Frode Vatvedt Fjeld <frodef@acm.org>
23 * binary-types.lisp: Added generic function READ-BINARY-RECORD so
24 that it may be specialized.
26 2001-08-27 Frode Vatvedt Fjeld <frodef@acm.org>
29 Added function ENUM-SYMBOLIC-VALUE, the inverse of ENUM-VALUE.
31 2001-08-27 Frode Vatvedt Fjeld <frodef@acm.org>
33 * binary-types.lisp: Added :binary-tags slot-option. The argument
34 specifies a list of "tags" (intended to be symbols, but any lisp
35 objects will do) that will be associated with the slot. The
36 function BINARY-SLOT-TAGS will retrieve the set of tags for a
37 slot. The function BINARY-RECORD-SLOT-NAMES has been modified to
38 take the keyword argument :MATCH-TAGS so that only slots with at
39 least one of those tags are returned.
41 The idea is that sometimes you need to iterate over a sub-set of
42 the slots, in which case a tag can be used to name and reference
45 2001-08-24 Frode Vatvedt Fjeld <frodef@acm.org>
47 * binary-types.lisp: Changed they expansion function of
48 DEFINE-BINARY-CLASS not to generate literal structure
49 objects. Expansions should be much "nicer" for the compiler to
52 2001-08-17 Frode Vatvedt Fjeld <frodef@acm.org>
54 * binary-types.lisp: Added slot-options :MAP-ON-READ and
55 :MAP-ON-READ-DELAYED. The former is analogous to :MAP-ON-WRITE,
56 i.e. at BINARY-READ-time the function named is applied to the
57 (binary) value read, and the result is placed in the
60 :MAP-ON-READ-DELAYED is a variation that delays the mapping
61 operation until the slot is read. Until that time, the slot is
62 unbound and the binary value kept in a "hidden" slot. [This is
63 implemented more or less seamlessly by specializing the
64 SLOT-UNBOUND method.] However, the "hidden" binary value can be
65 read using BINARY-SLOT-VALUE; this will not cause the mapping to
66 occur. The idea is that if you have slots that represent pointers
67 to other records, you probalby don't want the READ-BINARY
68 operation to automatically follow and recursively read such
69 pointers. Using this mechanism, objects referenced by pointers
70 will magically be loaded "on demand".
72 2001-07-27 Frode Vatvedt Fjeld <frodef@acm.org>
75 Removed LET from DEFINE-BINARY-STRUCT expansion, making it a proper top-level-form.
77 2001-07-27 Frode Vatvedt Fjeld <frodef@acm.org>
81 * binary-types.lisp: Removed (superfluous) LET* from
82 DEFINE-BINARY-STRUCT's expansion, so as not to hinder such forms
83 from being proper top-level forms.
85 2001-07-12 Frode Vatvedt Fjeld <frodef@acm.org>
89 * binary-types.lisp: Fixed READ-BINARY-STRING to work correctly
90 for :SIZE 0. It will now return "" and 0, rather than entering
93 2001-06-29 Frode Vatvedt Fjeld <frodef@acm.org>
97 * binary-types.lisp: Added macro WITH-BINARY-OUTPUT-TO-VECTOR.
98 Supposed to resemble CL:WITH-OUTPUT-TO-STRING.
100 2001-06-26 Frode Vatvedt Fjeld <frodef@acm.org>
102 * binary-types.lisp: Fixed buggy function READ-BINARY-STRING.
104 2001-06-22 Frode Vatvedt Fjeld <frodef@acm.org>
106 * binary-types.lisp: Renamed many identifiers from xx-COMPUND-xx
107 to xx-RECORD-xx. Of the exported symbols, only two are changed:
108 WRITE-BINARY-RECORD, and BINARY-RECORD-SLOT-NAMES. A (binary)
109 record is either a lisp struct or class.
113 * binary-types.lisp: Minor fixups to make BT work with CLISP.
115 2001-06-20 Frode Vatvedt Fjeld <frodef@acm.org>
119 * binary-types.lisp: Rewrote and renamed some the binary string
120 types. Macros DEFINE-BINARY-STRING and
121 DEFINE-NULL-TERMINATED-STRING should now be used to define string
124 * binary-types.lisp: Added function READ-BINARY-STRING that should
125 be general enough to read most kinds of strings. It still doesn't
126 do character sets, though.
128 * binary-types.lisp: Removed traces of variable-sized binary
129 types. Everything is now constant-sized. Removed functions
130 SIZEOF-MIN and SIZEOF-MAX.
132 2001-06-09 Frode Vatvedt Fjeld <frodef@acm.org>
134 * binary-types.lisp: Removed one more instance of upcased symbols
135 in the code, in order to facilitate those using case-sensitive
138 2001-06-06 Frode Vatvedt Fjeld <frodef@acm.org>
142 * binary-types.lisp: Added macro WITH-BINARY-INPUT-FROM-VECTOR.
144 * binary-types.lisp: Added check for end-of-list in
145 WITH-BINARY-INPUT-FROM-LIST macro.
147 * Makefile: Forgot to include recently added file
148 type-hierarchy.ps in the distribution tarball.
150 2001-05-03 Frode Vatvedt Fjeld <frodef@acm.org>
152 * binary-types.lisp: Renamed the slot-options (the old ones still
155 :btt => :binary-lisp-type
156 :bt-on-write => :map-binary-write.
158 * binary-types.lisp: Added a pseudo-type :LABEL available only
159 inside DEFINE-BINARY-CLASS and which is a void type intended for
160 "slots" that don't hold any data but are used as labels in the
161 struct in order to determine offsets etc. If this type is declared
162 with the :btt (or :binary-lisp-type) slot-option, the lisp :type
163 NIL is declared (the empty type).
165 2001-04-24 Frode Vatvedt Fjeld <frodef@acm.org>
169 2001-04-23 Frode Vatvedt Fjeld <frodef@acm.org>
171 * type-hierarchy.ps: Added. This is a postscript file displaying
172 the type (meta-) hierarchy, for reference.
174 2001-04-22 Frode Vatvedt Fjeld <frodef@acm.org>
176 * binary-types.lisp: Added macro WITH-BINARY-INPUT-FROM-LIST that
177 sets up a "stream" variable suitable for READ-BINARY that provides
178 8-bit bytes from a list of integers.
180 2001-04-12 Frode Vatvedt Fjeld <frodef@acm.org>
184 * binary-types.lisp: The previous fix for DEFINE-BINARY-STRUCT's
185 lambda list was wrong. Hopefully this actually fixes it.
187 2001-04-11 Frode Vatvedt Fjeld <frodef@acm.org>
191 * binary-types.lisp: Changed in DEFINE-BINARY-STRUCT a (format
192 "MAKE-~A" name) to (format "~A-~A" '#:make name), which should
193 allow for lower-case lisps to work.
195 * binary-types.lisp: Modified DEFINE-BINARY-STRUCT's macro
196 lambda-list slightly to accommodate a bug in clisp. (This
197 shouldn't affect other systems at all.)
199 2001-03-29 Frode Vatvedt Fjeld <frodef@acm.org>
203 2001-03-28 Frode Vatvedt Fjeld <frodef@acm.org>
205 * binary-types.lisp: Added macro WITH-BINARY-OUTPUT-TO-LIST that,
206 given a stream variable S, evaluates its body such that calls to
207 WRITE-BINARY to stream S collects in a list the individual bytes
208 as integers. This list is returned by the macro form.
210 * binary-types.lisp: Added two dynamic variables that allows you
211 to override the low-level IO functions binary-types use to read
212 and write single octets: *BINARY-READ-BYTE* and
213 *BINARY-WRITE-BYTE*, respectively. They default to the standard CL
214 functions READ-BYTE and WRITE-BYTE, and you may rebind them to any
215 function with the same signature.
217 * binary-types.lisp: Fixed bug in the expansion of
218 DEFINE-BINARY-STRUCT that caused nested declarations not to
219 work. This bug even made example.lisp not work. Sigh.
221 2001-02-19 Frode Vatvedt Fjeld <frodef@acm.org>
225 * README: Revamped the documentation somewhat. Fixed up some
228 2001-02-13 Frode Vatvedt Fjeld <frodef@acm.org>
230 * binary-types.lisp: Changed some more syntax (slightly) in order
231 to be more consistent with CL syntax. Specifically,
232 DEFINE-BITFIELD now requires parens around the storage-type (as
235 * example.lisp: Changed to reflext new syntax.
237 2001-02-12 Frode Vatvedt Fjeld <frodef@acm.org>
239 * binary-types.lisp: Changed syntax of DEFINE-ENUM. The
240 storage-type must be put in braces, and you may optionally specify
243 * binary-types.lisp: Added function ENUM-VALUE.
245 2000-11-01 Frode Vatvedt Fjeld <frodef@acm.org>
247 * binary-types.lisp: Changed COMPOUND-SLOT-NAMES to not include
248 padding slots, unless explicity requested.
250 * binary-types.lisp: Added method WRITE-BINARY-COMPOUND that is
251 like WRITE-BINARY only it will automatically look up the correct
252 binary-type from the object, and it only works on compounds (that
253 is, binary-classes and binary-structs).
255 2000-10-31 Frode Vatvedt Fjeld <frodef@acm.org>
257 * binary-types.lisp: Added slot-option :on-write, that provides a
258 function that will be called (at binary-writing time) on the
259 slot's value to obtain the actual value that is written.
261 2000-10-26 Frode Vatvedt Fjeld <frodef@acm.org>
265 * binary-types.lisp: Renamed DEF-BINCLASS to DEFINE-BINARY-CLASS,
266 and DEF-BINSTRUCT to DEFINE-BINARY-STRUCT, and DEF-* to DEFINE-*.
268 * binary-types.lisp: Added a variation of the :BT slot-option. It
269 is named :BTT, and will have the extra effect of adding a :TYPE
270 slot-option to the class or struct slot. Be careful when using
271 this in DEF-BINSTRUCT to provide an slot-initform that is of the
274 * binary-types.lisp: Changed the way nested declarations are
275 expanded. Now, even nested declarations will (in the expansion)
276 become top-level forms, I believe. This means that the
277 type-specifiers (the place after :BT in e.g. DEF-BINCLASS) is no
278 longer really evaluated, rather it is parsed by the
279 macro-expander. This means you no longer have to quote the
280 type-names (See "example.lisp"). Bitfield types are represented
281 symbolically by lists, so they are all of the lisp-type
282 "list". Fixed-size-nt-strings are equivalent to lisp strings (they
283 should really be strings of a maximum size, but lisp can't easily
284 express that concept). Also note that padding binary types which
285 are named by integer objects don't translate to lisp types at
286 all. This is just fine, I think, since padding "slots" are not
287 supposed to hold any lisp data.
289 * binary-types.lisp: Added DEFTYPE declarations so that all
290 binary-types also become lisp-types. For example, if you declare
291 (def-unsigned raw-number 1), you implicitly declare a lisp
292 type-specifier RAW-NUMBER that is equivalent to (integer 0 255).
294 2000-10-25 Frode Vatvedt Fjeld <frodef@acm.org>
298 * binary-types.lisp: Fixed bug in READ-BINARY for signed integers.
300 * binary-types.lisp: Added a WRITE-BINARY for binary-type
301 fixed-size-nt-string. Hopefully, read/write symmetry is complete
302 now. At least it should be possible to write the elf-header from
305 * binary-types.lisp: Added DEF-BINSTRUCT macro, which is (supposed
306 to be) to DEFSTRUCT what DEF-BINCLASS is to DEFCLASS. If nothing
307 else, structs prints and reads more easily than classes. See the
308 definition of E-IDENT in the updated example.lisp.
310 2000-10-24 Frode Vatvedt Fjeld <frodef@acm.org>
312 * binary-types.lisp: Added class-option for DEF-BINCLASS
313 :class-slot-align that allows you to adjust the offsets by
314 declaring the offset of one slot. Like this
315 (:class-slot-align slot-name offset)
317 * binary-types.lisp: Added a class-option for DEF-BINCLASS,
318 :class-slot-offset <integer>, that specifies an offset to add to
319 any slot-offset as returned by SLOT-OFFSET.
321 * README-bitfield: This is my response to a query about how
322 DEF-BITFIELD works, included here to provide some documentation.
324 2000-10-23 Frode Vatvedt Fjeld <frodef@acm.org>
328 * binary-types.lisp: Added a macro WITH-BINARY-FILE that is a thin
329 wrapper around WITH-OPEN-FILE that tries to force the stream to
330 have the correct element-type.
332 2000-10-22 Frode Vatvedt Fjeld <frodef@acm.org>
334 * binary-types.lisp: Changed syntax of DEF-BINCLASS again, so that
335 it now completely matches the DEFCLASS syntax, only you have one
336 extra slot-option, :BT, which declares the slot's
337 binary-type. This slot-option is evaluated, so you may still have
338 nested declarations. What is new is that you may have slots that
339 don't have a binary-type. Such slots are simply ignored by
340 READ-BINARY and WRITE-BINARY.
342 2000-10-21 Frode Vatvedt Fjeld <frodef@acm.org>
344 * binary-types.lisp: Added COMPOUND-SLOT-NAMES, to replace
345 COMPOUND-ALIST and COMPOUND-MERGE which are now deprecated (the
346 functions are still there, but their symbols are no longer
349 * binary-types.lisp: Changed the two BITFIELD-COMPUTE-XX-VALUE
350 from generic to regular functions (no reason for these to be
353 2000-10-20 Frode Vatvedt Fjeld <frodef@acm.org>
355 * example.lisp: Changed the example ELF header declaration to work
356 with the slightly changed syntax. Basically, all slots' type-field
357 is evaluated, so type-names (symbols) must be quoted.
359 * binary-types.lisp: Renamed DEF-COMPOUND to DEF-BINCLASS, and
360 changed the syntax so it looks more like DEFCLASS.
362 * binary-types.lisp: Added the capability of binary-integers to be
363 declared a certain endianess. So an integer is either :BIG-ENDIAN
364 or :LITTLE-ENDIAN (regardless of *ENDIAN*), or it depends
365 dynamically on the value of *ENDIAN*. The DEF-INTEGER macros now
366 takes and optional endianess argument.
368 * binary-types.lisp: Changed the (previously very ugly)
369 implementation of the binary-types name-space. Now use the new
370 accessor FIND-BINARY-TYPE which is implemented with a simple
371 hash-table. This means that BINARY TYPES MUST NOW BE NAMED BY
372 SYMBOLS (binary-types no longer touches the symbol-value of
375 * binary-types.lisp: Removed generic function BIT-SIZEOF, since we
376 only deal with octets anyway.
378 * binary-types.lisp: Changed *ENDIAN* to take keyword symbols
379 :BIG-ENDIAN or :LITTLE-ENDIAN (old BT-interned symbols still
382 2000-08-25 Frode Vatvedt Fjeld <frodef@acm.org>
384 * binary-types.lisp: Fixed reading of signed integers.
386 2000-06-13 Frode Vatvedt Fjeld <frodef@acm.org>
388 * README: Added a little more documentation.
390 * example.lisp: Cleaned up some small things.
392 2000-03-30 Frode Vatvedt Fjeld <frodef@acm.org>
394 * binary-types.lisp: Added write support for bitfield.
396 * binary-types.lisp: Changed the bitfield type to use proper CL
397 "bytes" for subfields.
399 1999-12-08 Frode Vatvedt Fjeld <frodef@acm.org>
401 * test.lisp: Added this file for tests of the BINARY-TYPES
402 package. Not much in it so far.
404 * binary-types.lisp: Fixed READ-BINARY for signed integers so it
407 * binary-types.lisp: Added WRITE-BINARY for integers, char8,
408 padding, and compound.