* read.scm (include): Use arch-path as file location.
(arch-path): Define it with a default setting.
(-cgen): Update arch-path when "-a" option is specified.
+ * utils.scm (dirname): New function.
2006-05-05 Steve Ellcey <sje@cup.hp.com>
; Generic Utilities.
-; Copyright (C) 2000-2005 Red Hat, Inc.
+; Copyright (C) 2000-2005, 2006 Red Hat, Inc.
; This file is part of CGEN.
; See file COPYING.CGEN for details.
(->string str))
)
+; Return the directory name of the given file name
+
+(define (dirname s)
+ (let loop ((i (string-length s)))
+ (cond ((= i 0) "")
+ ((char=? #\/ (string-ref s (- i 1))) (substring s 0 i))
+ (else (loop (- i 1)))))
+)
+
; Turn STR into lowercase.
(define (string-downcase str)