+-*- mode: text; coding: utf-8-unix; -*-
+
######################################################################
-##
+##
## Copyright (C) 2001,2000, 2003
-## Department of Computer Science, University of Tromsø, Norway
-##
+## Department of Computer Science, University of Tromsø, Norway
+##
## Filename: README
## Author: Frode Vatvedt Fjeld <frodef@acm.org>
## Created at: Wed Dec 8 15:35:53 1999
## Distribution: See the accompanying file COPYING.
-##
+##
## $Id: README,v 1.1.1.1 2004/01/13 11:13:13 ffjeld Exp $
-##
+##
######################################################################
Binary-types is a Common Lisp package for reading and writing binary
(define-binary-class elf-header ()
((e-ident
:binary-type (define-binary-struct e-ident ()
- (ei-magic nil :binary-type
- (define-binary-struct ei-magic ()
- (ei-mag0 0 :binary-type u8)
- (ei-mag1 #\null :binary-type char8)
- (ei-mag2 #\null :binary-type char8)
- (ei-mag3 #\null :binary-type char8)))
- (ei-class nil :binary-type
- (define-enum ei-class (u8)
- elf-class-none 0
- elf-class-32 1
- elf-class-64 2))
- (ei-data nil :binary-type
- (define-enum ei-data (u8)
- elf-data-none 0
- elf-data-2lsb 1
- elf-data-2msb 2))
- (ei-version 0 :binary-type u8)
- (padding nil :binary-type 1)
- (ei-name "" :binary-type
- (define-null-terminated-string ei-name 8))))
+ (ei-magic nil :binary-type
+ (define-binary-struct ei-magic ()
+ (ei-mag0 0 :binary-type u8)
+ (ei-mag1 #\null :binary-type char8)
+ (ei-mag2 #\null :binary-type char8)
+ (ei-mag3 #\null :binary-type char8)))
+ (ei-class nil :binary-type
+ (define-enum ei-class (u8)
+ elf-class-none 0
+ elf-class-32 1
+ elf-class-64 2))
+ (ei-data nil :binary-type
+ (define-enum ei-data (u8)
+ elf-data-none 0
+ elf-data-2lsb 1
+ elf-data-2msb 2))
+ (ei-version 0 :binary-type u8)
+ (padding nil :binary-type 1)
+ (ei-name "" :binary-type
+ (define-null-terminated-string ei-name 8))))
(e-type
:binary-type (define-enum e-type (half)
- et-none 0
- et-rel 1
- et-exec 2
- et-dyn 3
- et-core 4
- et-loproc #xff00
- et-hiproc #xffff))
+ et-none 0
+ et-rel 1
+ et-exec 2
+ et-dyn 3
+ et-core 4
+ et-loproc #xff00
+ et-hiproc #xffff))
(e-machine
:binary-type (define-enum e-machine (half)
- em-none 0
- em-m32 1
- em-sparc 2
- em-386 3
- em-68k 4
- em-88k 5
- em-860 7
- em-mips 8))
+ em-none 0
+ em-m32 1
+ em-sparc 2
+ em-386 3
+ em-68k 4
+ em-88k 5
+ em-860 7
+ em-mips 8))
(e-version :binary-type word)
(e-entry :binary-type addr)
(e-phoff :binary-type off)
The postscript file "type-hierarchy.ps" shows the binary types
-hierarchy. It is generated using psgraph from Quicklisp
-repository:
+hierarchy. It is generated using psgraph and closer-mop, which may be
+loaded via Quicklisp as shown below:
(ql:quickload "psgraph")
(ql:quickload "closer-mop")
+
(with-open-file (*standard-output* "type-hierarchy.ps"
- :direction :output
- :if-exists :supersede)
- (psgraph:psgraph *standard-output* 'binary-types::binary-type
- #'(lambda (p)
- (mapcar #'class-name
- (closer-mop:class-direct-subclasses
- (find-class p))))
- #'(lambda (s) (list (symbol-name s)))
- t))
\ No newline at end of file
+ :direction :output
+ :if-exists :supersede)
+ (psgraph:psgraph *standard-output* 'binary-types::binary-type
+ (lambda (p)
+ (mapcar #'class-name
+ (closer-mop:class-direct-subclasses
+ (find-class p))))
+ (lambda (s) (list (symbol-name s)))
+ t))