From: Olof-Joachim Frahm Date: Thu, 6 Jun 2013 21:27:08 +0000 (+0200) Subject: UTF-8, untabify, whitespaces. X-Git-Url: http://repo.macrolet.net/gitweb/?p=binary-types.git;a=commitdiff_plain;h=a17caf8890f11fdc56f6ea3a21260bf0fb9c589c UTF-8, untabify, whitespaces. --- diff --git a/README b/README index b784c4b..4b7fac2 100644 --- a/README +++ b/README @@ -1,15 +1,17 @@ +-*- 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 ## 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 @@ -94,45 +96,45 @@ with the form (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) @@ -159,18 +161,19 @@ For a second example, here's an approach to supporting floats: 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))