#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.668 2008/08/31 07:33:07 cph Exp $
+$Id: runtime.pkg,v 14.669 2008/08/31 07:36:17 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
soft-link-file
string->mime-type
string-is-mime-token?
- string-is-mime-type?)
+ string-is-mime-type?
+ write-mime-type)
(initialization (initialize-package!)))
(define-package (runtime symbol)
#| -*-Scheme-*-
-$Id: sfile.scm,v 14.45 2008/07/27 04:24:26 cph Exp $
+$Id: sfile.scm,v 14.46 2008/08/31 07:36:21 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
unspecific)
\f
(define (mime-type->string mime-type)
- (guarantee-mime-type mime-type 'MIME-TYPE->STRING)
- (string-append (symbol-name (mime-type/top-level mime-type))
- "/"
- (symbol-name (mime-type/subtype mime-type))))
+ (call-with-output-string
+ (lambda (port)
+ (write-mime-type mime-type port))))
+
+(define (write-mime-type mime-type port)
+ (guarantee-mime-type mime-type 'WRITE-MIME-TYPE)
+ (write-string (symbol-name (mime-type/top-level mime-type)) port)
+ (write-string "/" port)
+ (write-string (symbol-name (mime-type/subtype mime-type)) port))
(define (string->mime-type string #!optional start end)
(vector-ref (or (*parse-string parser:mime-type string start end)