about summary refs log tree commit diff stats
path: root/cxdrt.lisp
blob: 6c846575c606a294b2c5447032b35118984b4913 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(defun xwrt (fname)
  (with-open-file (f fname :direction :output :if-exists :supersede :element-type '(unsigned-byte 8))
    (frpc:write-xtype :int32 f 1234)
    (frpc:write-xtype :real32 f 3.14159)
    (frpc:write-xtype :real64 f 2.71828d0)
    (frpc:write-xtype :int32 f -5678)
    (frpc:write-xtype :string f "XDR and Common Lisp")
    (frpc:write-xtype :int32 f 21845)))

(defun xrdr (fname)
  (with-open-file (f fname :direction :input :element-type '(unsigned-byte 8))
    (format *standard-output* "~A ~A ~A ~A ~A~%~A~%"
            (frpc:read-xtype :int32 f)
            (frpc:read-xtype :real32 f)
            (frpc:read-xtype :real64 f)
            (frpc:read-xtype :int32 f)
            (frpc:read-xtype :string f)
            (frpc:read-xtype :int32 f))))