1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#!/usr/bin/newlisp
#
# RBin newLisp Test -- pancake
#
(load "rbin.lsp")
(define (die msg)
(println msg)
(exit 1)
)
(define (test-rbin file)
(if (= file nil) (die
(append "Usage " (main-args 1) " [file]")))
(println [text]
=============================
== RBin test using newlisp ==
=============================
[/text])
(println "File: " file)
(setq b (RBin:open-file file))
(define (show-sections b)
(local (s))
(setq s (RBin:sections b))
(dotimes (i (length s))
(println (format " - SECTION: %d " (s i 0)) (s i 1))
)
)
(show-sections b)
(println "libs: " (RBin:libraries b))
(RBin:free b)
)
(test-rbin (main-args 2))
(exit)
|